Uploaded image for project: 'CXF'
  1. CXF
  2. CXF-6070

NPE while calling a webservice using a clientproxy

    XMLWordPrintableJSON

    Details

    • Type: Test
    • Status: Closed
    • Priority: Major
    • Resolution: Done
    • Affects Version/s: 2.7.12, 3.0.1, 2.7.13, 2.6.16
    • Fix Version/s: 3.0.3, 2.7.14
    • Component/s: Simple Frontend
    • Labels:
      None
    • Estimated Complexity:
      Unknown

      Description

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

        Attachments

          Activity

            People

            • Assignee:
              dkulp Daniel Kulp
              Reporter:
              varuns Varun
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: