Uploaded image for project: 'CXF'
  1. CXF
  2. CXF-8378

NoClassDefFoundError: org/apache/cxf/common/util/ReflectionUtil from ReferencingAuthenticator

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 3.3.8, 3.4.1
    • Fix Version/s: 3.4.2, 3.3.9
    • Component/s: Transports
    • Labels:
      None
    • Estimated Complexity:
      Unknown

      Description

      After upgrade to 3.3.8 ,there is some not backward compatible change cause this error :

      java.lang.NoClassDefFoundError: org/apache/cxf/common/util/ReflectionUtil
      	at org.apache.cxf.transport.http.ReferencingAuthenticator.tryWith(ReferencingAuthenticator.java:125)
      	at org.apache.cxf.transport.http.ReferencingAuthenticator.getPasswordAuthentication(ReferencingAuthenticator.java:58)
      	at java.net.Authenticator.requestPasswordAuthentication(Authenticator.java:317)
      	at sun.net.www.protocol.http.HttpURLConnection$1.run(HttpURLConnection.java:453)
      	at sun.net.www.protocol.http.HttpURLConnection$1.run(HttpURLConnection.java:448)
      	at java.security.AccessController.doPrivileged(Native Method)
      	at sun.net.www.protocol.http.HttpURLConnection.privilegedRequestPasswordAuthentication(HttpURLConnection.java:447)
      	at sun.net.www.protocol.http.HttpURLConnection.getServerAuthentication(HttpURLConnection.java:2439)
      	at sun.net.www.protocol.http.HttpURLConnection.getInputStream0(HttpURLConnection.java:1737)
      	at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1492)
      	at java.net.HttpURLConnection.getResponseCode(HttpURLConnection.java:480)
      	at org.apache.cxf.transport.http.URLConnectionHTTPConduit$URLConnectionWrappedOutputStream$2.run(URLConnectionHTTPConduit.java:377)
      	at org.apache.cxf.transport.http.URLConnectionHTTPConduit$URLConnectionWrappedOutputStream$2.run(URLConnectionHTTPConduit.java:373)
      	at java.security.AccessController.doPrivileged(Native Method)
      	at org.apache.cxf.transport.http.URLConnectionHTTPConduit$URLConnectionWrappedOutputStream.getResponseCode(URLConnectionHTTPConduit.java:373)
      	at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.doProcessResponseCode(HTTPConduit.java:1597)
      	at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.handleResponseInternal(HTTPConduit.java:1625)
      	at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.handleResponse(HTTPConduit.java:1570)
      	at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.close(HTTPConduit.java:1371)
      	at org.apache.cxf.transport.AbstractConduit.close(AbstractConduit.java:56)
      	at org.apache.cxf.transport.http.HTTPConduit.close(HTTPConduit.java:671)
      	at org.apache.cxf.interceptor.MessageSenderInterceptor$MessageSenderEndingInterceptor.handleMessage(MessageSenderInterceptor.java:63)
      	at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:308)
      	at org.apache.cxf.endpoint.ClientImpl.doInvoke(ClientImpl.java:530)
      	at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:441)
      	at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:356)
      	at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:314)
      	at org.apache.cxf.frontend.ClientProxy.invokeSync(ClientProxy.java:96)
      	at org.apache.cxf.jaxws.JaxWsClientProxy.invoke(JaxWsClientProxy.java:140)
      

      After debug some code, it looks after this change https://github.com/apache/cxf/commit/58539be7c6367b0e7db354cd90467fe006ddef57 it requires ReferencingAuthenticator to load another class ReflectionUtil. But ReferencingAuthenticator is loaded with a special classloader :

      new URLClassLoader(new URL[0], ClassLoader.getSystemClassLoader()
      

      which to aovid the classloader leakage issue described in https://issues.apache.org/jira/browse/CXF-4529. This special classloader always fail to load this new added ReflectionUtil class.

      .

        Attachments

          Activity

            People

            • Assignee:
              ema Jim Ma
              Reporter:
              ema Jim Ma
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: