1 Reply Latest reply on Oct 1, 2007 6:04 AM by Aldo Lezza

    Problem testing application

    Aldo Lezza Newbie

      Hi,
      I full realized a BPEL project. I.e. just running
      ant deploy-definition
      ant generate-service
      ant generate-artifacts
      ant deploy

      I have succssfully deployed my project without any hand made modify.

      Now I'm trying to test my project.

      The client-side code is:

      String urlString = "http://localhost:8080/Sportello/SportelloServlet?wsdl";
      URL testWsdlUrl = null;
      try {
      testWsdlUrl = new URL(urlString);
      } catch (MalformedURLException ex) {
      ex.printStackTrace();
      }
      String nameSpaceUri = "http://enterprise.netbeans.org/bpel/Sportello";
      String serviceName = "SportelloService";
      String portName = "SportelloCentraleProcessRolePort";
      ServiceFactory serviceFactory = null;
      try {
      serviceFactory = ServiceFactory.newInstance();
      } catch (ServiceException ex) {
      ex.printStackTrace();
      }
      Service testService = null;

      try {
      // TODO code application logic here
      testService = serviceFactory.createService(testWsdlUrl, new QName(nameSpaceUri, serviceName));
      } catch (ServiceException ex) {
      ex.printStackTrace();
      }

      System.out.println("Testing method via proxy...\n\n");
      testViaProxy(testService, nameSpaceUri, portName, testWsdlUrl, serviceName, serviceFactory);
      System.out.println("\n\nEnd testing method via proxy...");


      with

      public static void testViaDii(Service testService, String portTypeNS, String port, String methName){
      Call call = null;
      try {
      call = testService.createCall(new QName(portTypeNS, port), methName);
      } catch (ServiceException ex) {
      ex.printStackTrace();
      }
      try {
      // invoke operation using request/response interaction mode
      Esegui es = new Esegui("Aldo", "Lezza", "servizio");
      EseguiResponse greeting = (EseguiResponse) call.invoke(new Object[] { es });
      printResponse(greeting);

      } catch (RemoteException ex) {
      ex.printStackTrace();
      }

      }

      Getting the proxy is OK, but when the client reaches

      EseguiResponse greeting = (EseguiResponse) call.invoke(new Object[] { es });

      I get

      javax.xml.rpc.soap.SOAPFaultException: java.lang.NullPointerException
      at com.sun.xml.rpc.client.StreamingSender._raiseFault(StreamingSender.java:528)
      at com.sun.xml.rpc.client.StreamingSender._send(StreamingSender.java:307)
      at com.sun.xml.rpc.client.dii.CallInvokerImpl.doInvoke(CallInvokerImpl.java:103)
      at com.sun.xml.rpc.client.dii.BasicCall.invoke(BasicCall.java:486)
      at com.sun.xml.rpc.client.dii.CallInvocationHandler.doCall(CallInvocationHandler.java:121)
      at com.sun.xml.rpc.client.dii.CallInvocationHandler.invoke(CallInvocationHandler.java:85)
      at $Proxy0.esegui(Unknown Source)
      at sportellotester.Main.testViaProxy(Main.java:96)
      at sportellotester.Main.main(Main.java:67)



      On server side, I read

      11:51:29,614 ERROR [HandlerChainBaseImpl] RuntimeException in request handler
      java.lang.NullPointerException
      at org.jbpm.bpel.integration.server.SoapHandler.sendRequest(SoapHandler.java:324)
      at org.jbpm.bpel.integration.server.SoapHandler.handleRequest(SoapHandler.java:188)
      at org.jboss.ws.handler.HandlerWrapper.handleRequest(HandlerWrapper.java:121)
      at org.jboss.ws.handler.HandlerChainBaseImpl.handleRequest(HandlerChainBaseImpl.java:245)
      at org.jboss.ws.handler.ServerHandlerChain.handleRequest(ServerHandlerChain.java:53)
      at org.jboss.ws.server.ServiceEndpointInvoker.callRequestHandlerChain(ServiceEndpointInvoker.java:224)
      at org.jboss.ws.server.ServiceEndpointInvoker.invoke(ServiceEndpointInvoker.java:98)
      at org.jboss.ws.server.ServiceEndpoint.handleRequest(ServiceEndpoint.java:209)
      at org.jboss.ws.server.ServiceEndpointManager.processSOAPRequest(ServiceEndpointManager.java:355)
      at org.jboss.ws.server.StandardEndpointServlet.doPost(StandardEndpointServlet.java:115)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
      at org.jboss.ws.server.StandardEndpointServlet.service(StandardEndpointServlet.java:76)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
      at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
      at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
      at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
      at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:175)
      at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:74)
      at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
      at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
      at org.jboss.web.tomcat.tc5.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:156)
      at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
      at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
      at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:869)
      at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:664)
      at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
      at org.apache.tomcat.util.net.MasterSlaveWorkerThread.run(MasterSlaveWorkerThread.java:112)
      at java.lang.Thread.run(Thread.java:595)
      11:51:29,615 ERROR [SOAPFaultExceptionHelper] SOAP request exception
      java.lang.NullPointerException
      at org.jbpm.bpel.integration.server.SoapHandler.sendRequest(SoapHandler.java:324)
      at org.jbpm.bpel.integration.server.SoapHandler.handleRequest(SoapHandler.java:188)
      at org.jboss.ws.handler.HandlerWrapper.handleRequest(HandlerWrapper.java:121)
      at org.jboss.ws.handler.HandlerChainBaseImpl.handleRequest(HandlerChainBaseImpl.java:245)
      at org.jboss.ws.handler.ServerHandlerChain.handleRequest(ServerHandlerChain.java:53)
      at org.jboss.ws.server.ServiceEndpointInvoker.callRequestHandlerChain(ServiceEndpointInvoker.java:224)
      at org.jboss.ws.server.ServiceEndpointInvoker.invoke(ServiceEndpointInvoker.java:98)
      at org.jboss.ws.server.ServiceEndpoint.handleRequest(ServiceEndpoint.java:209)
      at org.jboss.ws.server.ServiceEndpointManager.processSOAPRequest(ServiceEndpointManager.java:355)
      at org.jboss.ws.server.StandardEndpointServlet.doPost(StandardEndpointServlet.java:115)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
      at org.jboss.ws.server.StandardEndpointServlet.service(StandardEndpointServlet.java:76)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
      at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
      at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
      at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
      at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:175)
      at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:74)
      at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
      at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
      at org.jboss.web.tomcat.tc5.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:156)
      at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
      at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
      at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:869)
      at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:664)
      at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
      at org.apache.tomcat.util.net.MasterSlaveWorkerThread.run(MasterSlaveWorkerThread.java:112)
      at java.lang.Thread.run(Thread.java:595)
      11:51:29,616 WARN [HandlerWrapper] Handler is in state DOES_NOT_EXIST, skipping Handler.handleFault for: org.jbpm.bpel.integration.server.SoapHandler@9ac00f


      Can anybody help me? If you need other files (wsdl, classes), I'll provide you. Bye






        • 1. Re: Problem testing application
          Aldo Lezza Newbie

          I pasted the wrong method implementation. Read this


          public static void testViaProxy(Service testService, String nameSpaceUri, String portName, URL testWsdlUrl, String serviceName, ServiceFactory serviceFactory){

          SportelloCentrale myProxy = null;
          try {
          myProxy = (SportelloCentrale) testService.getPort(new QName(nameSpaceUri, portName), SportelloCentrale.class);
          } catch (ServiceException ex) {
          ex.printStackTrace();
          }

          if (myProxy== null){
          System.err.println("No proxy");
          return;
          }

          System.out.println("Proxy OK. Testing method...");

          try {

          EseguiResponse res = (EseguiResponse) myProxy.esegui(new Esegui("Aldo", "Lezza", "servizio"));
          printResponse(res);
          } catch (Exception ex) {
          ex.printStackTrace();
          }

          }