You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@cxf.apache.org by "Chris Eineke (JIRA)" <ji...@apache.org> on 2012/05/18 23:01:07 UTC

[jira] [Created] (CXF-4324) UriInfo uninjectable

Chris Eineke created CXF-4324:
---------------------------------

             Summary: UriInfo uninjectable
                 Key: CXF-4324
                 URL: https://issues.apache.org/jira/browse/CXF-4324
             Project: CXF
          Issue Type: Bug
            Reporter: Chris Eineke
         Attachments: uriinfofail.zip

Spring v3.1.1
CXF v2.5.3
Dozer v5.3.2
(see attached project for further versioning details)

I'm using CXF 2.5.3 and Spring 3.1.1.RELEASE with dozer 5.3.2. 

My restful service code maps domain objects to transfer objects, but for the life of me I cannot get UriInfo injected into my dozer custom mappers. 

The restful services are request-scoped and produced by several RequestScopeResourceFactoryS. I'm using CGLIB as the proxy implementation. My dozer mappers are defined as singletons, same thing for the dozer bean itself. 

I've tried the following: 

1. @Autowire-annotating a UriInfo instance variable => null. 
2. @Context-annotating a UriInfo instance variable => null. 
3. Written a UriInfoInjectable interface { @Context public void setUriInfo(UriInfo value); } and implemented in the service => setter is never called => null. 
4. Tried writing an CXF interceptor that loaded UriInfo into a holder bean trying to intercept in several different phases and using the three last approaches => null. 

I attached a sample project that exhibits the problem.

1. mvn clean tomcat:run
2. http://localhost:8080/uriinfofail/

Note the TRACE messages saying that uriInfo is null.



--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (CXF-4324) UriInfo uninjectable

Posted by "Chris Eineke (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CXF-4324?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13281156#comment-13281156 ] 

Chris Eineke commented on CXF-4324:
-----------------------------------

Sergey,
When I implement UriInfoInjectable in Service, the UriInfo setter in the mapper bean is _not_ called.
The setter in service is called properly, though.
                
> UriInfo uninjectable
> --------------------
>
>                 Key: CXF-4324
>                 URL: https://issues.apache.org/jira/browse/CXF-4324
>             Project: CXF
>          Issue Type: Bug
>            Reporter: Chris Eineke
>              Labels: cxf, dependency-injection, dozer, spring, uriinfo
>         Attachments: uriinfofail.zip
>
>
> Spring v3.1.1
> CXF v2.5.3
> Dozer v5.3.2
> (see attached project for further versioning details)
> I'm using CXF 2.5.3 and Spring 3.1.1.RELEASE with dozer 5.3.2. 
> My restful service code maps domain objects to transfer objects, but for the life of me I cannot get UriInfo injected into my dozer custom mappers. 
> The restful services are request-scoped and produced by several RequestScopeResourceFactoryS. I'm using CGLIB as the proxy implementation. My dozer mappers are defined as singletons, same thing for the dozer bean itself. 
> I've tried the following: 
> 1. @Autowire-annotating a UriInfo instance variable => null. 
> 2. @Context-annotating a UriInfo instance variable => null. 
> 3. Written a UriInfoInjectable interface { @Context public void setUriInfo(UriInfo value); } and implemented in the service => setter is never called => null. 
> 4. Tried writing an CXF interceptor that loaded UriInfo into a holder bean trying to intercept in several different phases and using the three last approaches => null. 
> I attached a sample project that exhibits the problem.
> 1. mvn clean tomcat:run
> 2. http://localhost:8080/uriinfofail/
> Note the TRACE messages saying that uriInfo is null.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (CXF-4324) UriInfo uninjectable

Posted by "Sergey Beryozkin (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CXF-4324?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13281229#comment-13281229 ] 

Sergey Beryozkin commented on CXF-4324:
---------------------------------------

Re UriInfo still not injected into a mapper. 
Mapper is not visible at all to the JAX-RS runtime, it's not even a sub resource locator (which might get the context injection supported in the future).

The best way to get a UriInfo ref injected into a Mapper instance is to do mapper.setUriInfo(uriInfo) from within Service.setUriInfo method. I believe that by the time Service.setUriInfo is called the Service instance has been completely initialized by Spring

                
> UriInfo uninjectable
> --------------------
>
>                 Key: CXF-4324
>                 URL: https://issues.apache.org/jira/browse/CXF-4324
>             Project: CXF
>          Issue Type: Bug
>            Reporter: Chris Eineke
>              Labels: cxf, dependency-injection, dozer, spring, uriinfo
>         Attachments: uriinfofail.zip
>
>
> Spring v3.1.1
> CXF v2.5.3
> Dozer v5.3.2
> (see attached project for further versioning details)
> I'm using CXF 2.5.3 and Spring 3.1.1.RELEASE with dozer 5.3.2. 
> My restful service code maps domain objects to transfer objects, but for the life of me I cannot get UriInfo injected into my dozer custom mappers. 
> The restful services are request-scoped and produced by several RequestScopeResourceFactoryS. I'm using CGLIB as the proxy implementation. My dozer mappers are defined as singletons, same thing for the dozer bean itself. 
> I've tried the following: 
> 1. @Autowire-annotating a UriInfo instance variable => null. 
> 2. @Context-annotating a UriInfo instance variable => null. 
> 3. Written a UriInfoInjectable interface { @Context public void setUriInfo(UriInfo value); } and implemented in the service => setter is never called => null. 
> 4. Tried writing an CXF interceptor that loaded UriInfo into a holder bean trying to intercept in several different phases and using the three last approaches => null. 
> I attached a sample project that exhibits the problem.
> 1. mvn clean tomcat:run
> 2. http://localhost:8080/uriinfofail/
> Note the TRACE messages saying that uriInfo is null.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (CXF-4324) UriInfo uninjectable

Posted by "Sergey Beryozkin (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CXF-4324?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13279825#comment-13279825 ] 

Sergey Beryozkin commented on CXF-4324:
---------------------------------------

Please confirm that having Service to implement InjectableUriInfo fixes the issue
                
> UriInfo uninjectable
> --------------------
>
>                 Key: CXF-4324
>                 URL: https://issues.apache.org/jira/browse/CXF-4324
>             Project: CXF
>          Issue Type: Bug
>            Reporter: Chris Eineke
>              Labels: cxf, dependency-injection, dozer, spring, uriinfo
>         Attachments: uriinfofail.zip
>
>
> Spring v3.1.1
> CXF v2.5.3
> Dozer v5.3.2
> (see attached project for further versioning details)
> I'm using CXF 2.5.3 and Spring 3.1.1.RELEASE with dozer 5.3.2. 
> My restful service code maps domain objects to transfer objects, but for the life of me I cannot get UriInfo injected into my dozer custom mappers. 
> The restful services are request-scoped and produced by several RequestScopeResourceFactoryS. I'm using CGLIB as the proxy implementation. My dozer mappers are defined as singletons, same thing for the dozer bean itself. 
> I've tried the following: 
> 1. @Autowire-annotating a UriInfo instance variable => null. 
> 2. @Context-annotating a UriInfo instance variable => null. 
> 3. Written a UriInfoInjectable interface { @Context public void setUriInfo(UriInfo value); } and implemented in the service => setter is never called => null. 
> 4. Tried writing an CXF interceptor that loaded UriInfo into a holder bean trying to intercept in several different phases and using the three last approaches => null. 
> I attached a sample project that exhibits the problem.
> 1. mvn clean tomcat:run
> 2. http://localhost:8080/uriinfofail/
> Note the TRACE messages saying that uriInfo is null.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (CXF-4324) UriInfo uninjectable

Posted by "Chris Eineke (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CXF-4324?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13280083#comment-13280083 ] 

Chris Eineke commented on CXF-4324:
-----------------------------------

Sergey, I will try to confirm on Tuesday morning.
                
> UriInfo uninjectable
> --------------------
>
>                 Key: CXF-4324
>                 URL: https://issues.apache.org/jira/browse/CXF-4324
>             Project: CXF
>          Issue Type: Bug
>            Reporter: Chris Eineke
>              Labels: cxf, dependency-injection, dozer, spring, uriinfo
>         Attachments: uriinfofail.zip
>
>
> Spring v3.1.1
> CXF v2.5.3
> Dozer v5.3.2
> (see attached project for further versioning details)
> I'm using CXF 2.5.3 and Spring 3.1.1.RELEASE with dozer 5.3.2. 
> My restful service code maps domain objects to transfer objects, but for the life of me I cannot get UriInfo injected into my dozer custom mappers. 
> The restful services are request-scoped and produced by several RequestScopeResourceFactoryS. I'm using CGLIB as the proxy implementation. My dozer mappers are defined as singletons, same thing for the dozer bean itself. 
> I've tried the following: 
> 1. @Autowire-annotating a UriInfo instance variable => null. 
> 2. @Context-annotating a UriInfo instance variable => null. 
> 3. Written a UriInfoInjectable interface { @Context public void setUriInfo(UriInfo value); } and implemented in the service => setter is never called => null. 
> 4. Tried writing an CXF interceptor that loaded UriInfo into a holder bean trying to intercept in several different phases and using the three last approaches => null. 
> I attached a sample project that exhibits the problem.
> 1. mvn clean tomcat:run
> 2. http://localhost:8080/uriinfofail/
> Note the TRACE messages saying that uriInfo is null.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Updated] (CXF-4324) UriInfo uninjectable

Posted by "Chris Eineke (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CXF-4324?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Chris Eineke updated CXF-4324:
------------------------------

    Attachment: uriinfofail.zip

Sample project.
                
> UriInfo uninjectable
> --------------------
>
>                 Key: CXF-4324
>                 URL: https://issues.apache.org/jira/browse/CXF-4324
>             Project: CXF
>          Issue Type: Bug
>            Reporter: Chris Eineke
>              Labels: cxf, dependency-injection, dozer, spring, uriinfo
>         Attachments: uriinfofail.zip
>
>
> Spring v3.1.1
> CXF v2.5.3
> Dozer v5.3.2
> (see attached project for further versioning details)
> I'm using CXF 2.5.3 and Spring 3.1.1.RELEASE with dozer 5.3.2. 
> My restful service code maps domain objects to transfer objects, but for the life of me I cannot get UriInfo injected into my dozer custom mappers. 
> The restful services are request-scoped and produced by several RequestScopeResourceFactoryS. I'm using CGLIB as the proxy implementation. My dozer mappers are defined as singletons, same thing for the dozer bean itself. 
> I've tried the following: 
> 1. @Autowire-annotating a UriInfo instance variable => null. 
> 2. @Context-annotating a UriInfo instance variable => null. 
> 3. Written a UriInfoInjectable interface { @Context public void setUriInfo(UriInfo value); } and implemented in the service => setter is never called => null. 
> 4. Tried writing an CXF interceptor that loaded UriInfo into a holder bean trying to intercept in several different phases and using the three last approaches => null. 
> I attached a sample project that exhibits the problem.
> 1. mvn clean tomcat:run
> 2. http://localhost:8080/uriinfofail/
> Note the TRACE messages saying that uriInfo is null.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira