[ https://issues.apache.org/jira/browse/CXF-3379?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13006195#comment-13006195 ]
Sergey Beryozkin commented on CXF-3379: --------------------------------------- Hi Ben I think it would work but the existing TL support won't help indeed and as you said it is actually not needed if it is injected only once. You are right, injecting it into the singleton resource only once is exactly what is needed. But the patch will need to be modified because it affect the code which does the injection on every request for both singletons and per-request resources but we only need to do it once for singletons. I have to think how to do it better, especially given that JAX-RS 1.1 also requires supporting the injection into Application instances, so we need to deal with injecting Applications and also with injecting contexts such as UriInfo, etc into the injected Applications, ouch :-) thanks, Sergey > @Context fails to inject Application instance > --------------------------------------------- > > Key: CXF-3379 > URL: https://issues.apache.org/jira/browse/CXF-3379 > Project: CXF > Issue Type: Bug > Components: JAX-RS > Affects Versions: 2.3.3 > Reporter: Ben Noordhuis > > Quoting JSR 311: > "The instance of the application-supplied Application subclass can be > injected into a class field or method parameter using the @Context > annotation. Access to the Application subclass instance allows configuration > information to be centralized in that class. Note that this cannot be > injected into the Application subclass itself since this would create a > circular dependency." > JAXRSUtils.createContextValue() doesn't handle this. This bug exists in 2.3.x > and HEAD. > I'd submit a patch but I don't know where (or if) the Application class is > registered after it's instantiated by CXFNonSpringJaxrsServlet. -- This message is automatically generated by JIRA. For more information on JIRA, see: http://www.atlassian.com/software/jira