You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@cxf.apache.org by "Sergey Beryozkin (JIRA)" <ji...@apache.org> on 2017/04/05 17:02:41 UTC

[jira] [Comment Edited] (CXF-7309) JAX-RS @Context fields throw NPE in OSGI hot deployed filters

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

Sergey Beryozkin edited comment on CXF-7309 at 4/5/17 5:01 PM:
---------------------------------------------------------------

We have a JIRA to rewrite the way thread local proxies are managed but it is all so very sensitive so unless there's a very strong need for it I'd rather not do it.

In general the patch looks OK, thanks for the effort, however it is too late to apply it for 3.1.11 due to be built today, I'll need to think more to make sure we do not introduce some side-effects in a rush.

By the way we have a couple of basic OSGI JAXRS tests in osgi/itests. Can you please consider providing a CXF osgi/itests test reproducing the issue, with a simpler setup/etc ? If it is too tricky then no problems, we can still work on applying the patch

Thanks


was (Author: sergey_beryozkin):
We have a JIRA to rewrite the way thread local proxies are managed but it is all so very sensitive so unless there's a very strong need for it I'd rather not to do it.

In general the patch looks OK, thanks for the effort, however it is too late to apply it for 3.1.11 due to be built today, I'll need to think more to make sure we do not introduce some side-effects in a rush.

By the way we have a couple of basic OSGI JAXRS tests in osgi/itests. Can you please consider providing a CXF osgi/itests test reproducing the issue, with a simpler setup/etc ? If it is too tricky then no problems, we can still work on applying the patch

Thanks

> 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)