You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cxf.apache.org by jordan <zh...@cn.ibm.com> on 2015/02/10 04:07:54 UTC

Report NPE when client async request a non-exist URI

Hi,

I found there is a issue:
When client with a response filter (empty operation is enough) to request an
async request to a non-exist url, cxf client will report a NPE and make the
async thread hand:


java.lang.NullPointerException
	at
org.apache.cxf.jaxrs.client.spec.ClientResponseFilterInterceptor.getResponse(ClientResponseFilterInterceptor.java:79)
	at
org.apache.cxf.jaxrs.client.spec.ClientResponseFilterInterceptor.handleMessage(ClientResponseFilterInterceptor.java:60)
	at
org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:307)
......


I check the code and found the method:
ClientResponseFilterInterceptor.getResponse

        ResponseBuilder rb = JAXRSUtils.toResponseBuilder((Integer)
inMessage.get(Message.RESPONSE_CODE));
        rb.entity(inMessage.get(InputStream.class));

If the URL which client request is not exist, then the (Integer)
inMessage.get(Message.RESPONSE_CODE) is null, so report NPE.


So that I cannot continue....

Could you please help take a look. Thanks!!


The full exception stack:

java.lang.NullPointerException
	at
org.apache.cxf.jaxrs.client.spec.ClientResponseFilterInterceptor.getResponse(ClientResponseFilterInterceptor.java:79)
	at
org.apache.cxf.jaxrs.client.spec.ClientResponseFilterInterceptor.handleMessage(ClientResponseFilterInterceptor.java:60)
	at
org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:307)
	at
org.apache.cxf.jaxrs.client.ClientMessageObserver.onMessage(ClientMessageObserver.java:56)
	at
org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream$1.run(HTTPConduit.java:1154)
	at
org.apache.cxf.workqueue.AutomaticWorkQueueImpl$3.run(AutomaticWorkQueueImpl.java:428)
	at
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1157)
	at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:627)
	at
org.apache.cxf.workqueue.AutomaticWorkQueueImpl$AWQThreadFactory$1.run(AutomaticWorkQueueImpl.java:353)
	at java.lang.Thread.run(Thread.java:863)



--
View this message in context: http://cxf.547215.n5.nabble.com/Report-NPE-when-client-async-request-a-non-exist-URI-tp5754128.html
Sent from the cxf-user mailing list archive at Nabble.com.

Re: Report NPE when client async request a non-exist URI

Posted by jordan <zh...@cn.ibm.com>.
Sorry, I mean you can test in your env.

And the url "http://localhost:9081/jaxrs20App/rest/bookstore/delete" is not
exist. You can use any non-exist, such as "http://test.test" instead.



--
View this message in context: http://cxf.547215.n5.nabble.com/Report-NPE-when-client-async-request-a-non-exist-URI-tp5754128p5754211.html
Sent from the cxf-user mailing list archive at Nabble.com.

Re: Report NPE when client async request a non-exist URI

Posted by jordan <zh...@cn.ibm.com>.
Hi Sergey,

Yes, my exception is UnknownHostException.

Wait for your new fix and thanks for your time! :)



--
View this message in context: http://cxf.547215.n5.nabble.com/Report-NPE-when-client-async-request-a-non-exist-URI-tp5754128p5754296.html
Sent from the cxf-user mailing list archive at Nabble.com.

Re: Report NPE when client async request a non-exist URI

Posted by Sergey Beryozkin <sb...@gmail.com>.
We analyzed and thought the reason it fails in Jenkins is that there 
might be a localhost:80 endpoint available hence an address like 
"http://localhost/books" can actually be satisfied.
The reason you are still seeing the error is that the fix was limited to 
checking ConnectException but it may be UnknownHostException/etc.
I did a minor update to AbstractClient. That should do it

SErgey

On 11/02/15 14:13, Sergey Beryozkin wrote:
> Just rebuilt 3.0.x with Java 6, test passed.
> Not sure why the jenkins build failed
> Sergey
> On 11/02/15 14:07, Sergey Beryozkin wrote:
>> Hmm...apparently it fails with in a Java6 build:
>>
>> https://builds.apache.org/job/CXF-3.0.x/org.apache.cxf.systests$cxf-systests-jaxrs/3350/testReport/
>>
>>
>>
>> But I've double checked, Java7 is fine...
>> Needs to be resolved...
>>
>> Sergey
>> On 11/02/15 10:16, Sergey Beryozkin wrote:
>>> Hi
>>>
>>> May be you still have the old jar still loaded, see:
>>>
>>> https://fisheye6.atlassian.com/browse/cxf/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/JAXRSAsyncClientTest.java?r=52598eb9b31ea7dfc7b4b87048e4ded459fbeb87
>>>
>>>
>>>
>>>
>>> testNonexistent()
>>> and
>>> testNonexistentJaxrs20() - added just now
>>>
>>> Sergey
>>>
>>>
>>> On 11/02/15 03:22, jordan wrote:
>>>> Hi Sergey,
>>>>
>>>> Thanks for your quick repsonse and fix.
>>>>
>>>> But I have apply in my env, it's not work for my code.
>>>>
>>>> I downloaded from here and apply into my cxf jar file:
>>>> https://fisheye6.atlassian.com/browse/~raw,r=272b8533f84653a9da0d462600d64dd3c44829f3/cxf/rt/rs/client/src/main/java/org/apache/cxf/jaxrs/client/AbstractClient.java
>>>>
>>>>
>>>>
>>>>
>>>> Here is my code, it's simple:
>>>>
>>>> public static void main(String[] args) throws Exception {
>>>>         String uri =
>>>> "http://localhost:9081/jaxrs20App/rest/bookstore/delete";
>>>>         Client c = ClientBuilder.newClient();
>>>>         c.register(new testFilter());
>>>>         WebTarget t1 = c.target(uri);
>>>>         Future<Response> future = t1.request().async().get();
>>>>
>>>>         try{
>>>>             future.get();
>>>>         } catch (Exception e){
>>>>             System.out.println("I'm Exception!");
>>>>         }
>>>>         c.close();
>>>>     }
>>>>
>>>> The *important *code is we register a testFilter:
>>>> public class testFilter implements ClientResponseFilter{
>>>>     @Override
>>>>     public void filter(ClientRequestContext arg0,
>>>> ClientResponseContext arg1)
>>>>             throws IOException {
>>>>         // TODO Auto-generated method stub
>>>>     }
>>>> }
>>>>
>>>> The exception also same:
>>>> java.lang.NullPointerException
>>>>     at
>>>> org.apache.cxf.jaxrs.client.spec.ClientResponseFilterInterceptor.getResponse(ClientResponseFilterInterceptor.java:79)
>>>>
>>>>
>>>>
>>>>     at
>>>> org.apache.cxf.jaxrs.client.spec.ClientResponseFilterInterceptor.handleMessage(ClientResponseFilterInterceptor.java:60)
>>>>
>>>>
>>>>
>>>>     at
>>>> org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:307)
>>>>
>>>>
>>>>
>>>>     at
>>>> org.apache.cxf.jaxrs.client.ClientMessageObserver.onMessage(ClientMessageObserver.java:56)
>>>>
>>>>
>>>>
>>>>     at
>>>> org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream$1.run(HTTPConduit.java:1154)
>>>>
>>>>
>>>>
>>>>     at
>>>> org.apache.cxf.workqueue.AutomaticWorkQueueImpl$3.run(AutomaticWorkQueueImpl.java:428)
>>>>
>>>>
>>>>
>>>>     at
>>>> java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1176)
>>>>
>>>>
>>>>
>>>>     at
>>>> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
>>>>
>>>>
>>>>
>>>>     at
>>>> org.apache.cxf.workqueue.AutomaticWorkQueueImpl$AWQThreadFactory$1.run(AutomaticWorkQueueImpl.java:353)
>>>>
>>>>
>>>>
>>>>     at java.lang.Thread.run(Thread.java:795)
>>>>
>>>>
>>>> So I think it's not work. You have tested this sample in you env.
>>>> Thanks!
>>>>
>>>>
>>>>
>>>> --
>>>> View this message in context:
>>>> http://cxf.547215.n5.nabble.com/Report-NPE-when-client-async-request-a-non-exist-URI-tp5754128p5754210.html
>>>>
>>>>
>>>>
>>>> Sent from the cxf-user mailing list archive at Nabble.com.
>>>>
>>>
>>>
>>
>
>


Re: Report NPE when client async request a non-exist URI

Posted by Sergey Beryozkin <sb...@gmail.com>.
Just rebuilt 3.0.x with Java 6, test passed.
Not sure why the jenkins build failed
Sergey
On 11/02/15 14:07, Sergey Beryozkin wrote:
> Hmm...apparently it fails with in a Java6 build:
>
> https://builds.apache.org/job/CXF-3.0.x/org.apache.cxf.systests$cxf-systests-jaxrs/3350/testReport/
>
>
> But I've double checked, Java7 is fine...
> Needs to be resolved...
>
> Sergey
> On 11/02/15 10:16, Sergey Beryozkin wrote:
>> Hi
>>
>> May be you still have the old jar still loaded, see:
>>
>> https://fisheye6.atlassian.com/browse/cxf/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/JAXRSAsyncClientTest.java?r=52598eb9b31ea7dfc7b4b87048e4ded459fbeb87
>>
>>
>>
>> testNonexistent()
>> and
>> testNonexistentJaxrs20() - added just now
>>
>> Sergey
>>
>>
>> On 11/02/15 03:22, jordan wrote:
>>> Hi Sergey,
>>>
>>> Thanks for your quick repsonse and fix.
>>>
>>> But I have apply in my env, it's not work for my code.
>>>
>>> I downloaded from here and apply into my cxf jar file:
>>> https://fisheye6.atlassian.com/browse/~raw,r=272b8533f84653a9da0d462600d64dd3c44829f3/cxf/rt/rs/client/src/main/java/org/apache/cxf/jaxrs/client/AbstractClient.java
>>>
>>>
>>>
>>> Here is my code, it's simple:
>>>
>>> public static void main(String[] args) throws Exception {
>>>         String uri =
>>> "http://localhost:9081/jaxrs20App/rest/bookstore/delete";
>>>         Client c = ClientBuilder.newClient();
>>>         c.register(new testFilter());
>>>         WebTarget t1 = c.target(uri);
>>>         Future<Response> future = t1.request().async().get();
>>>
>>>         try{
>>>             future.get();
>>>         } catch (Exception e){
>>>             System.out.println("I'm Exception!");
>>>         }
>>>         c.close();
>>>     }
>>>
>>> The *important *code is we register a testFilter:
>>> public class testFilter implements ClientResponseFilter{
>>>     @Override
>>>     public void filter(ClientRequestContext arg0,
>>> ClientResponseContext arg1)
>>>             throws IOException {
>>>         // TODO Auto-generated method stub
>>>     }
>>> }
>>>
>>> The exception also same:
>>> java.lang.NullPointerException
>>>     at
>>> org.apache.cxf.jaxrs.client.spec.ClientResponseFilterInterceptor.getResponse(ClientResponseFilterInterceptor.java:79)
>>>
>>>
>>>     at
>>> org.apache.cxf.jaxrs.client.spec.ClientResponseFilterInterceptor.handleMessage(ClientResponseFilterInterceptor.java:60)
>>>
>>>
>>>     at
>>> org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:307)
>>>
>>>
>>>     at
>>> org.apache.cxf.jaxrs.client.ClientMessageObserver.onMessage(ClientMessageObserver.java:56)
>>>
>>>
>>>     at
>>> org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream$1.run(HTTPConduit.java:1154)
>>>
>>>
>>>     at
>>> org.apache.cxf.workqueue.AutomaticWorkQueueImpl$3.run(AutomaticWorkQueueImpl.java:428)
>>>
>>>
>>>     at
>>> java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1176)
>>>
>>>
>>>     at
>>> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
>>>
>>>
>>>     at
>>> org.apache.cxf.workqueue.AutomaticWorkQueueImpl$AWQThreadFactory$1.run(AutomaticWorkQueueImpl.java:353)
>>>
>>>
>>>     at java.lang.Thread.run(Thread.java:795)
>>>
>>>
>>> So I think it's not work. You have tested this sample in you env.
>>> Thanks!
>>>
>>>
>>>
>>> --
>>> View this message in context:
>>> http://cxf.547215.n5.nabble.com/Report-NPE-when-client-async-request-a-non-exist-URI-tp5754128p5754210.html
>>>
>>>
>>> Sent from the cxf-user mailing list archive at Nabble.com.
>>>
>>
>>
>


-- 
Sergey Beryozkin

Talend Community Coders
http://coders.talend.com/

Blog: http://sberyozkin.blogspot.com

Re: Report NPE when client async request a non-exist URI

Posted by Sergey Beryozkin <sb...@gmail.com>.
Hmm...apparently it fails with in a Java6 build:

https://builds.apache.org/job/CXF-3.0.x/org.apache.cxf.systests$cxf-systests-jaxrs/3350/testReport/

But I've double checked, Java7 is fine...
Needs to be resolved...

Sergey
On 11/02/15 10:16, Sergey Beryozkin wrote:
> Hi
>
> May be you still have the old jar still loaded, see:
>
> https://fisheye6.atlassian.com/browse/cxf/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/JAXRSAsyncClientTest.java?r=52598eb9b31ea7dfc7b4b87048e4ded459fbeb87
>
>
> testNonexistent()
> and
> testNonexistentJaxrs20() - added just now
>
> Sergey
>
>
> On 11/02/15 03:22, jordan wrote:
>> Hi Sergey,
>>
>> Thanks for your quick repsonse and fix.
>>
>> But I have apply in my env, it's not work for my code.
>>
>> I downloaded from here and apply into my cxf jar file:
>> https://fisheye6.atlassian.com/browse/~raw,r=272b8533f84653a9da0d462600d64dd3c44829f3/cxf/rt/rs/client/src/main/java/org/apache/cxf/jaxrs/client/AbstractClient.java
>>
>>
>> Here is my code, it's simple:
>>
>> public static void main(String[] args) throws Exception {
>>         String uri =
>> "http://localhost:9081/jaxrs20App/rest/bookstore/delete";
>>         Client c = ClientBuilder.newClient();
>>         c.register(new testFilter());
>>         WebTarget t1 = c.target(uri);
>>         Future<Response> future = t1.request().async().get();
>>
>>         try{
>>             future.get();
>>         } catch (Exception e){
>>             System.out.println("I'm Exception!");
>>         }
>>         c.close();
>>     }
>>
>> The *important *code is we register a testFilter:
>> public class testFilter implements ClientResponseFilter{
>>     @Override
>>     public void filter(ClientRequestContext arg0,
>> ClientResponseContext arg1)
>>             throws IOException {
>>         // TODO Auto-generated method stub
>>     }
>> }
>>
>> The exception also same:
>> java.lang.NullPointerException
>>     at
>> org.apache.cxf.jaxrs.client.spec.ClientResponseFilterInterceptor.getResponse(ClientResponseFilterInterceptor.java:79)
>>
>>     at
>> org.apache.cxf.jaxrs.client.spec.ClientResponseFilterInterceptor.handleMessage(ClientResponseFilterInterceptor.java:60)
>>
>>     at
>> org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:307)
>>
>>     at
>> org.apache.cxf.jaxrs.client.ClientMessageObserver.onMessage(ClientMessageObserver.java:56)
>>
>>     at
>> org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream$1.run(HTTPConduit.java:1154)
>>
>>     at
>> org.apache.cxf.workqueue.AutomaticWorkQueueImpl$3.run(AutomaticWorkQueueImpl.java:428)
>>
>>     at
>> java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1176)
>>
>>     at
>> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
>>
>>     at
>> org.apache.cxf.workqueue.AutomaticWorkQueueImpl$AWQThreadFactory$1.run(AutomaticWorkQueueImpl.java:353)
>>
>>     at java.lang.Thread.run(Thread.java:795)
>>
>>
>> So I think it's not work. You have tested this sample in you env. Thanks!
>>
>>
>>
>> --
>> View this message in context:
>> http://cxf.547215.n5.nabble.com/Report-NPE-when-client-async-request-a-non-exist-URI-tp5754128p5754210.html
>>
>> Sent from the cxf-user mailing list archive at Nabble.com.
>>
>
>


Re: Report NPE when client async request a non-exist URI

Posted by Sergey Beryozkin <sb...@gmail.com>.
Hi

May be you still have the old jar still loaded, see:

https://fisheye6.atlassian.com/browse/cxf/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/JAXRSAsyncClientTest.java?r=52598eb9b31ea7dfc7b4b87048e4ded459fbeb87

testNonexistent()
and
testNonexistentJaxrs20() - added just now

Sergey


On 11/02/15 03:22, jordan wrote:
> Hi Sergey,
>
> Thanks for your quick repsonse and fix.
>
> But I have apply in my env, it's not work for my code.
>
> I downloaded from here and apply into my cxf jar file:
> https://fisheye6.atlassian.com/browse/~raw,r=272b8533f84653a9da0d462600d64dd3c44829f3/cxf/rt/rs/client/src/main/java/org/apache/cxf/jaxrs/client/AbstractClient.java
>
> Here is my code, it's simple:
>
> public static void main(String[] args) throws Exception {
> 		String uri = "http://localhost:9081/jaxrs20App/rest/bookstore/delete";
> 		Client c = ClientBuilder.newClient();
> 		c.register(new testFilter());
> 		WebTarget t1 = c.target(uri);
> 		Future<Response> future = t1.request().async().get();
> 		
> 		try{
> 			future.get();
> 		} catch (Exception e){
> 			System.out.println("I'm Exception!");
> 		}
> 		c.close();
> 	}
>
> The *important *code is we register a testFilter:
> public class testFilter implements ClientResponseFilter{
> 	@Override
> 	public void filter(ClientRequestContext arg0, ClientResponseContext arg1)
> 			throws IOException {
> 		// TODO Auto-generated method stub	
> 	}
> }
>
> The exception also same:
> java.lang.NullPointerException
> 	at
> org.apache.cxf.jaxrs.client.spec.ClientResponseFilterInterceptor.getResponse(ClientResponseFilterInterceptor.java:79)
> 	at
> org.apache.cxf.jaxrs.client.spec.ClientResponseFilterInterceptor.handleMessage(ClientResponseFilterInterceptor.java:60)
> 	at
> org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:307)
> 	at
> org.apache.cxf.jaxrs.client.ClientMessageObserver.onMessage(ClientMessageObserver.java:56)
> 	at
> org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream$1.run(HTTPConduit.java:1154)
> 	at
> org.apache.cxf.workqueue.AutomaticWorkQueueImpl$3.run(AutomaticWorkQueueImpl.java:428)
> 	at
> java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1176)
> 	at
> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
> 	at
> org.apache.cxf.workqueue.AutomaticWorkQueueImpl$AWQThreadFactory$1.run(AutomaticWorkQueueImpl.java:353)
> 	at java.lang.Thread.run(Thread.java:795)
>
>
> So I think it's not work. You have tested this sample in you env. Thanks!
>
>
>
> --
> View this message in context: http://cxf.547215.n5.nabble.com/Report-NPE-when-client-async-request-a-non-exist-URI-tp5754128p5754210.html
> Sent from the cxf-user mailing list archive at Nabble.com.
>


-- 
Sergey Beryozkin

Talend Community Coders
http://coders.talend.com/

Blog: http://sberyozkin.blogspot.com

Re: Report NPE when client async request a non-exist URI

Posted by jordan <zh...@cn.ibm.com>.
Hi Sergey,

Thanks for your quick repsonse and fix.

But I have apply in my env, it's not work for my code.

I downloaded from here and apply into my cxf jar file:
https://fisheye6.atlassian.com/browse/~raw,r=272b8533f84653a9da0d462600d64dd3c44829f3/cxf/rt/rs/client/src/main/java/org/apache/cxf/jaxrs/client/AbstractClient.java

Here is my code, it's simple:

public static void main(String[] args) throws Exception {
		String uri = "http://localhost:9081/jaxrs20App/rest/bookstore/delete";
		Client c = ClientBuilder.newClient();
		c.register(new testFilter());
		WebTarget t1 = c.target(uri);
		Future<Response> future = t1.request().async().get();
		
		try{
			future.get();
		} catch (Exception e){
			System.out.println("I'm Exception!");
		}
		c.close();
	}

The *important *code is we register a testFilter:
public class testFilter implements ClientResponseFilter{
	@Override
	public void filter(ClientRequestContext arg0, ClientResponseContext arg1)
			throws IOException {
		// TODO Auto-generated method stub	
	}
}

The exception also same:
java.lang.NullPointerException
	at
org.apache.cxf.jaxrs.client.spec.ClientResponseFilterInterceptor.getResponse(ClientResponseFilterInterceptor.java:79)
	at
org.apache.cxf.jaxrs.client.spec.ClientResponseFilterInterceptor.handleMessage(ClientResponseFilterInterceptor.java:60)
	at
org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:307)
	at
org.apache.cxf.jaxrs.client.ClientMessageObserver.onMessage(ClientMessageObserver.java:56)
	at
org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream$1.run(HTTPConduit.java:1154)
	at
org.apache.cxf.workqueue.AutomaticWorkQueueImpl$3.run(AutomaticWorkQueueImpl.java:428)
	at
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1176)
	at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
	at
org.apache.cxf.workqueue.AutomaticWorkQueueImpl$AWQThreadFactory$1.run(AutomaticWorkQueueImpl.java:353)
	at java.lang.Thread.run(Thread.java:795)


So I think it's not work. You have tested this sample in you env. Thanks!



--
View this message in context: http://cxf.547215.n5.nabble.com/Report-NPE-when-client-async-request-a-non-exist-URI-tp5754128p5754210.html
Sent from the cxf-user mailing list archive at Nabble.com.

Re: Report NPE when client async request a non-exist URI

Posted by Sergey Beryozkin <sb...@gmail.com>.
Hi

Thanks for reporting it
Dan helped me to get to the bottom of the problem, has been fixed:
https://issues.apache.org/jira/browse/CXF-6252

Thanks, Sergey
On 10/02/15 03:07, jordan wrote:
> Hi,
>
> I found there is a issue:
> When client with a response filter (empty operation is enough) to request an
> async request to a non-exist url, cxf client will report a NPE and make the
> async thread hand:
>
>
> java.lang.NullPointerException
> 	at
> org.apache.cxf.jaxrs.client.spec.ClientResponseFilterInterceptor.getResponse(ClientResponseFilterInterceptor.java:79)
> 	at
> org.apache.cxf.jaxrs.client.spec.ClientResponseFilterInterceptor.handleMessage(ClientResponseFilterInterceptor.java:60)
> 	at
> org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:307)
> ......
>
>
> I check the code and found the method:
> ClientResponseFilterInterceptor.getResponse
>
>          ResponseBuilder rb = JAXRSUtils.toResponseBuilder((Integer)
> inMessage.get(Message.RESPONSE_CODE));
>          rb.entity(inMessage.get(InputStream.class));
>
> If the URL which client request is not exist, then the (Integer)
> inMessage.get(Message.RESPONSE_CODE) is null, so report NPE.
>
>
> So that I cannot continue....
>
> Could you please help take a look. Thanks!!
>
>
> The full exception stack:
>
> java.lang.NullPointerException
> 	at
> org.apache.cxf.jaxrs.client.spec.ClientResponseFilterInterceptor.getResponse(ClientResponseFilterInterceptor.java:79)
> 	at
> org.apache.cxf.jaxrs.client.spec.ClientResponseFilterInterceptor.handleMessage(ClientResponseFilterInterceptor.java:60)
> 	at
> org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:307)
> 	at
> org.apache.cxf.jaxrs.client.ClientMessageObserver.onMessage(ClientMessageObserver.java:56)
> 	at
> org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream$1.run(HTTPConduit.java:1154)
> 	at
> org.apache.cxf.workqueue.AutomaticWorkQueueImpl$3.run(AutomaticWorkQueueImpl.java:428)
> 	at
> java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1157)
> 	at
> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:627)
> 	at
> org.apache.cxf.workqueue.AutomaticWorkQueueImpl$AWQThreadFactory$1.run(AutomaticWorkQueueImpl.java:353)
> 	at java.lang.Thread.run(Thread.java:863)
>
>
>
> --
> View this message in context: http://cxf.547215.n5.nabble.com/Report-NPE-when-client-async-request-a-non-exist-URI-tp5754128.html
> Sent from the cxf-user mailing list archive at Nabble.com.
>