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.







Reply via email to