[
https://issues.apache.org/jira/browse/CXF-6070?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14188732#comment-14188732
]
Daniel Kulp commented on CXF-6070:
----------------------------------
That all said, I'm adding:
{code:java}
if (bus == null) {
throw new IllegalStateException("Message received on a Client that
has been closed or destroyed.");
}
{code}
to the method to make the exception message a little clearer instead of an NPE.
> NPE while calling a webservice using a clientproxy
> --------------------------------------------------
>
> Key: CXF-6070
> URL: https://issues.apache.org/jira/browse/CXF-6070
> Project: CXF
> Issue Type: Test
> Components: Simple Frontend
> Affects Versions: 2.7.12, 3.0.1, 2.7.13, 2.6.16
> Reporter: Varun
>
> We have implemented a webservice client using apache-cxf .
> When calling a webservice through a ClientProxy, for some reason there is an
> exception
> [main] INFO org.apache.cxf.service.factory.ReflectionServiceFactoryBean -
> Creating Service
> [main] WARN org.apache.cxf.phase.PhaseInterceptorChain - Interceptor for has
> thrown exception, unwinding now
> java.lang.NullPointerException: NullPointerException invoking
> at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
> at
> sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
> at
> sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
> at java.lang.reflect.Constructor.newInstance(Constructor.java:526)
> at
> org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.mapException(HTTPConduit.java:1347)
> at
> org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.close(HTTPConduit.java:1336)
> at
> org.apache.cxf.transport.AbstractConduit.close(AbstractConduit.java:56)
> at org.apache.cxf.transport.http.HTTPConduit.close(HTTPConduit.java:632)
> at
> org.apache.cxf.interceptor.MessageSenderInterceptor$MessageSenderEndingInterceptor.handleMessage(MessageSenderInterceptor.java:62)
> at
> org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:272)
> at org.apache.cxf.endpoint.ClientImpl.doInvoke(ClientImpl.java:570)
> at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:479)
> at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:382)
> at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:335)
> at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:355)
> at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:341)
> Caused by: java.lang.NullPointerException
> at org.apache.cxf.endpoint.ClientImpl.onMessage(ClientImpl.java:764)
> at
> org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.handleResponseInternal(HTTPConduit.java:1626)
> at
> org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.handleResponse(HTTPConduit.java:1515)
> at
> org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.close(HTTPConduit.java:1318)
> ... 12 more
> Exception in thread "main" java.lang.NullPointerException
> at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:339)
> ------------------------------------------------------------------------------------------------------------
> 1. Testing using a standalone java program.
> 2. This doesn’t happen when apache cxf version 2.4 is used .
> 3. When upgraded the version to 2.6 and above ,we are facing this issue.
> Code used to invoke the webservice is :
> TestService service=new TestService();
> Client client = ClientProxy.getClient(service.get*);
> Map<String, Object> requestContext = client.getRequestContext();
> requestContext.put(org.apache.cxf.message.Message.MAINTAIN_SESSION,
> Boolean.TRUE);
> requestContext.put(ENDPOINT_ADDRESS_PROPERTY,faxUrl);
> Object[] logOnResp= client.invoke(“webservice”,param1,param2,param3,param4);
>
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)