cxf-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "ASF GitHub Bot (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (CXF-7309) JAX-RS @Context fields throw NPE in OSGI hot deployed filters
Date Wed, 05 Apr 2017 10:55:41 GMT

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

ASF GitHub Bot commented on CXF-7309:
-------------------------------------

Github user sberyozkin commented on a diff in the pull request:

    https://github.com/apache/cxf/pull/253#discussion_r109885798
  
    --- Diff: rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/utils/InjectionUtils.java
---
    @@ -1167,10 +1161,12 @@ public static void injectContextMethods(Object requestObject,
                     if (!cri.isSingleton()) {
                         InjectionUtils.injectThroughMethod(requestObject, method, o, message);
                     } else {
    -                    ThreadLocalProxy<Object> proxy 
    -                        = (ThreadLocalProxy<Object>)cri.getContextSetterProxy(method);
    +                    Object proxy = extractFromSetter(requestObject, method);
    +                    if (!(proxy instanceof ThreadLocalProxy)) {
    --- End diff --
    
    Np, thanks. See if we see an unexpected value then it means there's a problem lying somewhere
else, this is where my concern is. If some code somewhere depends on this 'unexpected' value
then the proposed fix will break that code, right ? If a bean naming pattern is not followed
then IMHO CXF should not worry about it. In case of CXF-7309, what is returned there ? 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)

Mime
View raw message