NullPointerException in CXFAuthenticator.getPasswordAuthentication() if
password is null
----------------------------------------------------------------------------------------
Key: CXF-2584
URL: https://issues.apache.org/jira/browse/CXF-2584
Project: CXF
Issue Type: Bug
Components: Transports
Affects Versions: 2.2.5
Reporter: Cyrille Le Clerc
{{NullPointerException}} in {{CXFAuthenticator.getPasswordAuthentication()}} if
password is {{null}}.
Cause of the NPE :
{code:title=extract from org.apache.cxf.transport.http.CXFAuthenticator}
protected PasswordAuthentication getPasswordAuthentication() {
...
auth = new
PasswordAuthentication(httpConduit.getAuthorization().getUserName(),
httpConduit.getAuthorization()
.getPassword().toCharArray());
...
{code}
Stack trace :
{noformat}
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
{noformat}
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.