[ 
https://issues.apache.org/jira/browse/CXF-7309?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15970544#comment-15970544
 ] 

Ezequiel Rosas Garcia commented on CXF-7309:
--------------------------------------------

Hello. Finally was able to finish the osgi test.
I didn't notice that the proxy was generated by spring-dm, but now I can 
properly reproduce the issue by using it.
Also, I had to add a little Thread.sleep() in there after re starting the 
bundle, because the filter initialization didn't finish in time before the test 
invoked the web-request that produced the issue.

It's all there in the PR now.

Thank you for letting me know about those tests!
If there's anything else I can do, please let me know!

> JAX-RS @Context fields throw NPE in OSGI hot deployed filters
> -------------------------------------------------------------
>
>                 Key: CXF-7309
>                 URL: https://issues.apache.org/jira/browse/CXF-7309
>             Project: CXF
>          Issue Type: Bug
>          Components: JAX-RS
>    Affects Versions: 3.0.12, 3.1.10
>            Reporter: Ezequiel Rosas Garcia
>
> Hello. 
> This happens with a PreMatching filter that is loaded from OSGI.
> I found that when the filter OSGI bundle is hot deployed, all other already 
> running bundles using it would start throwing NPE when trying to access the 
> injected fields inside the filter (like CXF-7248)
> This seems to happen due to other bundles retaining their ThreadLocal 
> references in their own AbstractResourceInfo#getSetterProxyMap() while the 
> OSGI Proxy starts redirecting to a new filter object which has new different 
> ThreadLocal references as soon as it is used for the first time after hot re 
> deployment.
> Test: 
> [Link](https://github.com/nhtzr/osgiee-web/blob/42faf2cbe0c54497ea706e97cd91a9ee8c29e020/src/test/java/mx/nhtzr/osgiee/web/internal/MyFilterTest.java)
> PR: [Link](https://github.com/apache/cxf/pull/253)



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)

Reply via email to