[jira] [Commented] (CXF-6070) NPE while calling a webservice using a clientproxy

2014-10-29 Thread Daniel Kulp (JIRA)

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

Daniel Kulp commented on CXF-6070:
--

2.4 is fairly old so I'm not 100% sure, but it's possible that the 2.4 proxies 
didn't implement the finalize() stuff that would have shut down the resources 
when no longer in use.   Or the finalize()/close() method didn't completely 
clean everything up.   Or the ClientImpl or Service or something somehow held 
onto the proxy object preventing it from being garbage collected.  Not really 
sure.


> 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 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)


[jira] [Commented] (CXF-6070) NPE while calling a webservice using a clientproxy

2014-10-29 Thread Varun (JIRA)

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

Varun commented on CXF-6070:


Thank you for your valuable comments .
We are planning a upgrade cxf version  in coming months ,we will use as your 
suggestion.

It would be great if you provide your insights so as to why the same issue is 
not occurring when 2.4 version of cxf is used .
Thanks a lot once again!!

> 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 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)


[jira] [Commented] (CXF-6070) NPE while calling a webservice using a clientproxy

2014-10-29 Thread Daniel Kulp (JIRA)

[ 
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 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)


[jira] [Commented] (CXF-6070) NPE while calling a webservice using a clientproxy

2014-10-29 Thread Daniel Kulp (JIRA)

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

Daniel Kulp commented on CXF-6070:
--


This is working kind of as designed.   If you use a "*Service" object to create 
a proxy (service.getXYZ() calls), you are expected to use that proxy for making 
the calls to the service.  Not dig into the proxy and use the client object 
directly for the calls.  The access to the client is there to allow configuring 
of things prior to making the calls.

The issue is that proxy that is generated is being garbage collected (since you 
aren't using it) which is causing it to cleanup and release a bunch of things 
including the HTTP conduits, the request/response contexts, etc...   

If you need just a Client object, use the JaxWsClientFactoryBean.

That said, with 3.0.x, the proxy returned from the service.getXXX() calls 
implements the Client interface directly and thus could be used as above 
without the call to ClientProxy.getClient and using a direct cast instead.   
That would keep the proxy from being garbage collected.

> 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 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)