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/05/26 16:34:04 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=16026476#comment-16026476 ] 

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

Hi, 
well I applied a patch and did a commit to 3.1.x and then decided to revert, for now at least. The reason is that I'm still honestly not 100% sure how safe it is, I found myself staring at the code and realizing I was just not understanding the implications :-) 

Having to reflect every time the instance is injected into a tl proxy is a bit of a problem (that check where you first try to extract from the getter) because that will affect all services, with no hot redeployments happeing around. 

I'm just thinking, in the production, would one really expect to redeploy a filter ?

I'm not saying this issue does not have to be addressed, I'm just having a bit of a doubt at the moment. I thought after I saw my commit, that I need to first try to reproduce the issue the original code was trying to address, and then do another iteration...
Thanks, Sergey


was (Author: sergey_beryozkin):
Hi, 
well I applied a patch and did a commit to 3.1.x and then decided to revert, for now at least. The reason is that I'm still honestly not 100% sure how safe it is, I found myself staring at the code and realizing I was just not understanding the implications :-) 

Having to reflect every time the instance is injected into a tl proxy is a bit of a problem (that check where you first try to extract from the getter) because that will affect all services, with no hot redeployments haooeing around. 

I'm just thinking, in the production, would one really expect to redeploy a filter ?

I'm not saying this issue does not have to be addressed, I'm just having a bit of a doubt at the moment. I thought after I saw my commit, that I need to first try to reproduce the issue the original code was trying to address, and then do another iteration...
Thanks, Sergey

> 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
>             Fix For: 3.2.0, 3.1.12
>
>
> 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)