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

NullPointerException in CXFAuthenticator.getPasswordAuthentication() if password is null

Attach filesAttach ScreenshotVotersWatch issueWatchersCreate sub-taskLinkCloneUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 2.2.6
    • 2.2.6
    • Transports
    • None

    Description

      NullPointerException in CXFAuthenticator.getPasswordAuthentication() if password is null.

      Cause of the NPE :

      extract from org.apache.cxf.transport.http.CXFAuthenticator
          protected PasswordAuthentication getPasswordAuthentication() { 
              ...
                          auth = new PasswordAuthentication(httpConduit.getAuthorization().getUserName(),
                                                            httpConduit.getAuthorization()
                                                                .getPassword().toCharArray());
             ...
      

      Stack trace :

      java.lang.RuntimeException: RuntimeException invoking http://localhost:8080/... : java.lang.NullPointerException
      	at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
      	at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
      	at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
      	at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
      	at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.mapException(HTTPConduit.java:2010)
      	at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.close(HTTPConduit.java:1996)
      	at org.apache.cxf.io.CacheAndWriteOutputStream.postClose(CacheAndWriteOutputStream.java:47)
      	at org.apache.cxf.io.CachedOutputStream.close(CachedOutputStream.java:188)
      	at org.apache.cxf.transport.AbstractConduit.close(AbstractConduit.java:66)
      	at org.apache.cxf.transport.http.HTTPConduit.close(HTTPConduit.java:639)
      	at org.apache.cxf.interceptor.MessageSenderInterceptor$MessageSenderEndingInterceptor.handleMessage(MessageSenderInterceptor.java:62)
      	at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:239)
      	at org.apache.cxf.jaxrs.client.ClientProxyImpl.doChainedInvocation(ClientProxyImpl.java:429)
      	at org.apache.cxf.jaxrs.client.ClientProxyImpl.invoke(ClientProxyImpl.java:166)
      	at $Proxy69.sayHello(Unknown Source)
      	...
      Caused by: java.lang.RuntimeException: java.lang.NullPointerException
      	at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1014)
      	at sun.net.www.protocol.http.HttpURLConnection.getHeaderField(HttpURLConnection.java:2211)
      	at java.net.HttpURLConnection.getResponseCode(HttpURLConnection.java:382)
      	at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.handleResponseInternal(HTTPConduit.java:2110)
      	at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.handleResponse(HTTPConduit.java:2086)
      	at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.close(HTTPConduit.java:1984)
      	... 70 more
      Caused by: java.lang.NullPointerException
      	at org.apache.cxf.transport.http.CXFAuthenticator.getPasswordAuthentication(CXFAuthenticator.java:96)
      	at java.net.Authenticator.requestPasswordAuthentication(Authenticator.java:300)
      	at sun.net.www.protocol.http.HttpURLConnection$1.run(HttpURLConnection.java:297)
      	at java.security.AccessController.doPrivileged(Native Method)
      	at sun.net.www.protocol.http.HttpURLConnection.privilegedRequestPasswordAuthentication(HttpURLConnection.java:293)
      	at sun.net.www.protocol.http.HttpURLConnection.getServerAuthentication(HttpURLConnection.java:1795)
      	at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1159)
      	at java.net.HttpURLConnection.getResponseCode(HttpURLConnection.java:373)
      	... 73 more
      

      Attachments

        Activity

          This comment will be Viewable by All Users Viewable by All Users
          Cancel

          People

            dkulp Daniel Kulp
            cleclerc Cyrille Le Clerc
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Slack

                Issue deployment