cxf-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Kiren Pillay <kirenpill...@gmail.com>
Subject NullPointerException with WebClient
Date Mon, 11 Aug 2014 16:19:06 GMT
Hi Sergey,

I am getting a NPE when I use the WebClient as a self-standing
application. We're using Maven and the jar-with-dependencies option
for this client.

It looks like a dependency issue, because if I run the app in my IDE
it works fine. When I run the self-packaged jar it fails. What
dependency could I be missing?

CXF 3.0.1

  protected static PhaseInterceptorChain
setupOutInterceptorChain(ClientConfiguration cfg) {
        PhaseManager pm = cfg.getBus().getExtension(PhaseManager.class);
        List<Interceptor<? extends Message>> i1 =
cfg.getBus().getOutInterceptors();
        List<Interceptor<? extends Message>> i2 = cfg.getOutInterceptors();
        List<Interceptor<? extends Message>> i3 =
cfg.getConduitSelector().getEndpoint().getOutInterceptors();
  ****Fails here -->     PhaseInterceptorChain chain = new
PhaseChainCache().get(pm.getOutPhases(), i1, i2, i3);
        chain.add(new ClientRequestFilterInterceptor());
        return chain;
    }

Stacktrace:

Performing GET against URL:
http://127.0.0.1:8080/foobar/rest/function/perfoery?ACTION_NAME=PREPAID_OVERDRAFT_QUERY&MSISDN=27825557788
java.lang.NullPointerException
    at org.apache.cxf.jaxrs.client.AbstractClient.setupOutInterceptorChain(AbstractClient.java:842)
    at org.apache.cxf.jaxrs.client.AbstractClient.createMessage(AbstractClient.java:904)
    at org.apache.cxf.jaxrs.client.WebClient.finalizeMessage(WebClient.java:1113)
    at org.apache.cxf.jaxrs.client.WebClient.doChainedInvocation(WebClient.java:1086)
    at org.apache.cxf.jaxrs.client.WebClient.doInvoke(WebClient.java:883)
    at org.apache.cxf.jaxrs.client.WebClient.doInvoke(WebClient.java:854)
    at org.apache.cxf.jaxrs.client.WebClient.invoke(WebClient.java:417)
    at org.apache.cxf.jaxrs.client.WebClient.get(WebClient.java:600)
    at....

Mime
View raw message