2 Replies Latest reply on Feb 22, 2012 10:48 AM by nicolas duminil

    NPE while invoking a web service via a proxy

    nicolas duminil Master

      Greetings,

       

      I have the following test case: an EBWS receives a request and calls, via soapUI SOAPClient a web service proxy who proxies an external web service. Here is the content of the jboss-esb.xml file:

       

      <?xml version="1.0"?>

      <jbossesb parameterReloadSecs="5" xmlns="http://anonsvn.labs.jboss.com/labs/jbossesb/trunk/product/etc/schemas/xml/jbossesb-1.3.0.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"

        xsi:schemaLocation="http://anonsvn.labs.jboss.com/labs/jbossesb/trunk/product/etc/schemas/xml/jbossesb-1.3.0.xsd http://anonsvn.jboss.org/repos/labs/labs/jbossesb/trunk/product/etc/schemas/xml/jbossesb-1.3.0.xsd">

        <services>

          <service category="TestProxyServices" description="A test proxy" name="FakeProxy" invmScope="GLOBAL">

            <listeners>

              <http-gateway name="Proxy_Basic-GwListener"/>

            </listeners>

            <actions>

              <action name="echo-request" class="org.jboss.soa.esb.actions.SystemPrintln">

                <property name="message" value="Message before SOAPProxy" />

              </action>

              <action class="org.jboss.soa.esb.actions.soap.proxy.SOAPProxy" name="proxy">

                <property name="wsdl" value="classpath:///META-INF/ZSearchData025.wsdl" />

                <property name="endpointUrl" value="http://sv102024.ovam.be:8000/sap/bc/srt/rfc/sap/zsearchdata/025/zsearchdata/zsearchdata" />

              </action>

              <action name="echo-response" class="org.jboss.soa.esb.actions.SystemPrintln">

                <property name="message" value="Message after SOAPProxy" />

              </action>

            </actions>

          </service>

          <service category="TestEsbServices" description="Test to consume SAP web services" invmScope="GLOBAL" name="Test01">

            <actions faultXsd="/fault.xsd" inXsd="/request.xsd" outXsd="/response.xsd" validate="true">

              <action class="be.ovam.tests.TestAction" name="testAction" />

              <action class="be.ovam.tests.TestMapRequestAction" name="test-request-mapper" />

              <action class="org.jboss.soa.esb.actions.soap.SOAPClient" name="soapui-client-action">

                <property name="wsdl" value="http://localhost:8080/calling-fake-sap-ws/http/TestProxyServices/FakeProxy?wsdl" />

                <property name="SOAPAction" value="http://soa.jboss.org/TestEsbServices/Test01Op" />

                <property name="responseAsOgnlMap" value="true" />

              </action>

              <action class="be.ovam.tests.TestMapResponseAction" name="test-response-mapper" />

            </actions>

          </service>

        </services>

      </jbossesb>

       

      And here is the stack trace:

       

      16:28:24,973 INFO  [DefaultEndpointRegistry] register: jboss.ws:context=calling-fake-sap-ws,endpoint=TestEsbServices_Test01

      16:28:24,975 INFO  [WebMetaDataModifierImpl] Ignore servlet: org.jboss.soa.esb.listeners.gateway.http.HttpGatewayServlet

      16:28:24,985 INFO  [TomcatDeployment] deploy, ctxPath=/calling-fake-sap-ws

      16:28:25,123 INFO  [WSDLFilePublisher] WSDL published to: file:/opt/jboss-soa-p-5.2.0/jboss-as/server/default/data/wsdl/calling-fake-sap-ws.war/TestEsbServices/Test01.wsdl

      16:28:25,127 INFO  [EsbDeployment] Deploying 'vfszip:/opt/jboss-soa-p-5.2.0/jboss-as/server/default/tmp/esbwarfiles/calling-fake-sap-ws.war/'

      16:28:25,127 INFO  [EsbDeployment] Starting ESB Deployment 'calling-fake-sap-ws.esb'

      16:28:25,291 INFO  [SOAPProxy] mapped soapaction [""] to binding [{urn:sap-com:document:sap:soap:functions:mc-style}ZSearchData]

      16:28:25,291 INFO  [SOAPProxy] mapped operation [{urn:sap-com:document:sap:soap:functions:mc-style}ZGetTestData] to binding [{urn:sap-com:document:sap:soap:functions:mc-style}ZSearchData]

      16:28:25,293 INFO  [SOAPProxy] mapped binding [{urn:sap-com:document:sap:soap:functions:mc-style}ZSearchData] to transport [org.jboss.soa.esb.actions.soap.proxy.HttpSOAPProxyTransport] with endpoint address: [http://sv102024.ovam.be:8000/sap/bc/srt/rfc/sap/zsearchdata/025/zsearchdata/zsearchdata]

      16:28:43,004 INFO  [STDOUT] +++ TestAction.process(): body is body: [ objects: {org.jboss.soa.esb.message.defaultEntry=<proj:projectRequest xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:proj="http://www.ovam.be/project">

               <proj:projectName>?</proj:projectName>

            </proj:projectRequest>} ]

      16:28:43,004 INFO  [STDOUT] +++ TestEntryAction.process(): Received request: <proj:projectRequest xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:proj="http://www.ovam.be/project">

               <proj:projectName>?</proj:projectName>

            </proj:projectRequest>

      16:28:43,004 INFO  [STDOUT] +++ TestEntryAction.process(): index: 147 148

      16:28:43,004 INFO  [STDOUT] +++ TestAction.process() returns: <ovam:projectResponse xmlns:ovam="http://www.ovam.be/project"><ovam:projectName>?</ovam:projectName><ovam:projectDescription>Project01 description</ovam:projectDescription></ovam:projectResponse>

      16:28:43,011 INFO  [STDOUT] ### MaprequestAction.process(): Request map is {getProject1.projectName=<ovam:projectResponse xmlns:ovam="http://www.ovam.be/project"><ovam:projectName>?</ovam:projectName><ovam:projectDescription>Project01 description</ovam:projectDescription></ovam:projectResponse>}

      16:28:43,027 INFO  [STDOUT] Progress: 1 - Caching definition from url [http://localhost:8080/calling-fake-sap-ws/http/TestProxyServices/FakeProxy?wsdl]

      16:28:43,186 INFO  [STDOUT] Progress: 1 - Loading definition from cache

      16:28:43,193 INFO  [STDOUT] Retrieving document at 'http://localhost:8080/calling-fake-sap-ws/http/TestProxyServices/FakeProxy?wsdl'.

      16:28:43,197 INFO  [SchemaUtils] Loading schema types from [http://localhost:8080/calling-fake-sap-ws/http/TestProxyServices/FakeProxy?wsdl]

      16:28:43,197 INFO  [SchemaUtils] Getting schema http://localhost:8080/calling-fake-sap-ws/http/TestProxyServices/FakeProxy?wsdl

      16:28:43,235 INFO  [SchemaUtils] schema for [urn:sap-com:document:sap:rfc:functions] contained [{}] namespaces

      16:28:43,236 INFO  [SchemaUtils] schema for [urn:sap-com:document:sap:soap:functions:mc-style] contained [{}] namespaces

      16:28:43,370 INFO  [WsdlImporter] Finding importer for {urn:sap-com:document:sap:soap:functions:mc-style}ZSearchData

      16:28:43,371 INFO  [WsdlImporter] Importing binding {urn:sap-com:document:sap:soap:functions:mc-style}ZSearchData

      16:28:43,372 INFO  [Soap11HttpBindingImporter] importing endpoint http://localhost:8080/calling-fake-sap-ws/http/TestProxyServices/FakeProxy

      16:28:43,372 INFO  [Soap11HttpBindingImporter] importing operation ZGetTestData

      16:28:43,375 INFO  [SchemaUtils] Getting schema http://localhost:8080/calling-fake-sap-ws/http/TestProxyServices/FakeProxy?wsdl

      16:28:43,397 ERROR [RequestHandlerImpl] Error processing web service request

      org.jboss.ws.WSException: java.lang.NullPointerException

          at org.jboss.ws.WSException.rethrow(WSException.java:68)

          at org.jboss.wsf.stack.jbws.RequestHandlerImpl.handleRequest(RequestHandlerImpl.java:332)

          at org.jboss.wsf.stack.jbws.RequestHandlerImpl.doPost(RequestHandlerImpl.java:203)

          at org.jboss.wsf.stack.jbws.RequestHandlerImpl.handleHttpRequest(RequestHandlerImpl.java:129)

          at org.jboss.wsf.common.servlet.AbstractEndpointServlet.service(AbstractEndpointServlet.java:85)

          at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)

          at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)

          at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)

          at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)

          at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)

          at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)

          at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:235)

          at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)

          at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:183)

          at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:95)

          at org.jboss.web.tomcat.security.SecurityContextEstablishmentValve.process(SecurityContextEstablishmentValve.java:126)

          at org.jboss.web.tomcat.security.SecurityContextEstablishmentValve.invoke(SecurityContextEstablishmentValve.java:70)

          at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)

          at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)

          at org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:158)

          at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)

          at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:330)

          at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:829)

          at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:599)

          at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:451)

          at java.lang.Thread.run(Thread.java:619)

      Caused by: java.lang.NullPointerException

          at java.util.regex.Matcher.getTextLength(Matcher.java:1140)

          at java.util.regex.Matcher.reset(Matcher.java:291)

          at java.util.regex.Matcher.<init>(Matcher.java:211)

          at java.util.regex.Pattern.matcher(Pattern.java:888)

          at org.jboss.wsf.common.Normalizer.normalize(Normalizer.java:45)

          at org.jboss.wsf.common.DOMWriter.normalize(DOMWriter.java:580)

          at org.jboss.wsf.common.DOMWriter.printInternal(DOMWriter.java:432)

          at org.jboss.wsf.common.DOMWriter.printInternal(DOMWriter.java:384)

          at org.jboss.wsf.common.DOMWriter.printInternal(DOMWriter.java:384)

          at org.jboss.wsf.common.DOMWriter.print(DOMWriter.java:233)

          at org.jboss.ws.core.soap.SOAPFaultImpl.writeElement(SOAPFaultImpl.java:803)

          at org.jboss.ws.core.soap.SOAPElementImpl.writeElementContent(SOAPElementImpl.java:904)

          at org.jboss.ws.core.soap.SOAPElementImpl.writeElement(SOAPElementImpl.java:889)

          at org.jboss.ws.core.soap.SOAPElementImpl.writeElementContent(SOAPElementImpl.java:904)

          at org.jboss.ws.core.soap.SOAPElementImpl.writeElement(SOAPElementImpl.java:889)

          at org.jboss.ws.core.soap.SOAPElementWriter.writeElementInternal(SOAPElementWriter.java:147)

          at org.jboss.ws.core.soap.SOAPElementWriter.writeElement(SOAPElementWriter.java:128)

          at org.jboss.ws.core.soap.SOAPMessageImpl.writeTo(SOAPMessageImpl.java:425)

          at org.jboss.wsf.stack.jbws.RequestHandlerImpl.sendResponse(RequestHandlerImpl.java:397)

          at org.jboss.wsf.stack.jbws.RequestHandlerImpl.handleRequest(RequestHandlerImpl.java:327)

          ... 24 more

      16:28:43,398 ERROR [[TestEsbServices_Test01]] Servlet.service() for servlet TestEsbServices_Test01 threw exception

      java.lang.NullPointerException

          at java.util.regex.Matcher.getTextLength(Matcher.java:1140)

          at java.util.regex.Matcher.reset(Matcher.java:291)

          at java.util.regex.Matcher.<init>(Matcher.java:211)

          at java.util.regex.Pattern.matcher(Pattern.java:888)

          at org.jboss.wsf.common.Normalizer.normalize(Normalizer.java:45)

          at org.jboss.wsf.common.DOMWriter.normalize(DOMWriter.java:580)

          at org.jboss.wsf.common.DOMWriter.printInternal(DOMWriter.java:432)

          at org.jboss.wsf.common.DOMWriter.printInternal(DOMWriter.java:384)

          at org.jboss.wsf.common.DOMWriter.printInternal(DOMWriter.java:384)

          at org.jboss.wsf.common.DOMWriter.print(DOMWriter.java:233)

          at org.jboss.ws.core.soap.SOAPFaultImpl.writeElement(SOAPFaultImpl.java:803)

          at org.jboss.ws.core.soap.SOAPElementImpl.writeElementContent(SOAPElementImpl.java:904)

          at org.jboss.ws.core.soap.SOAPElementImpl.writeElement(SOAPElementImpl.java:889)

          at org.jboss.ws.core.soap.SOAPElementImpl.writeElementContent(SOAPElementImpl.java:904)

          at org.jboss.ws.core.soap.SOAPElementImpl.writeElement(SOAPElementImpl.java:889)

          at org.jboss.ws.core.soap.SOAPElementWriter.writeElementInternal(SOAPElementWriter.java:147)

          at org.jboss.ws.core.soap.SOAPElementWriter.writeElement(SOAPElementWriter.java:128)

          at org.jboss.ws.core.soap.SOAPMessageImpl.writeTo(SOAPMessageImpl.java:425)

          at org.jboss.wsf.stack.jbws.RequestHandlerImpl.sendResponse(RequestHandlerImpl.java:397)

          at org.jboss.wsf.stack.jbws.RequestHandlerImpl.handleRequest(RequestHandlerImpl.java:327)

          at org.jboss.wsf.stack.jbws.RequestHandlerImpl.doPost(RequestHandlerImpl.java:203)

          at org.jboss.wsf.stack.jbws.RequestHandlerImpl.handleHttpRequest(RequestHandlerImpl.java:129)

          at org.jboss.wsf.common.servlet.AbstractEndpointServlet.service(AbstractEndpointServlet.java:85)

          at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)

          at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)

          at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)

          at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)

          at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)

          at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)

          at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:235)

          at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)

          at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:183)

          at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:95)

          at org.jboss.web.tomcat.security.SecurityContextEstablishmentValve.process(SecurityContextEstablishmentValve.java:126)

          at org.jboss.web.tomcat.security.SecurityContextEstablishmentValve.invoke(SecurityContextEstablishmentValve.java:70)

          at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)

          at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)

          at org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:158)

          at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)

          at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:330)

          at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:829)

          at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:599)

          at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:451)

          at java.lang.Thread.run(Thread.java:619)

       

      Many thanks in advance for any help.

       

      Nicolas