---------- Forwarded message ----------
From: Tamás Horváth <[EMAIL PROTECTED]>
Date: 2008/7/18
Subject: Axis2 client service error
To: [EMAIL PROTECTED]


Hi,



I've got this client class:

/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package test;

import pilot.IPairTest;
import pilot.PairTestResult;

/**
 *
 * @author tamas
 */
public class AddClient implements IPairTest {

   public static void main(String[] args) {
       AddClient test = new AddClient();

       test.Soap11Test();
       test.Soap12Test();

       System.out.println(test.runPairTest(null, null).getComment());

   }

   private void Soap11Test() {

       try { // Call Web Service Operation
           pilot.Calculator service = new pilot.Calculator();
           pilot.CalculatorPortType port =
service.getCalculatorHttpSoap11Endpoint();
           // TODO initialize WS operation arguments here
           java.lang.Double left = Double.valueOf(5d);
           java.lang.Double right = Double.valueOf(8d);
           // TODO process result here
           java.lang.Double result = port.add(left, right);
           System.out.println("Result = " + result);
       } catch (Exception ex) {
           // TODO handle custom exceptions here
       }


   }

   private void Soap12Test() {

       try { // Call Web Service Operation
           pilot.Calculator service = new pilot.Calculator();
           pilot.CalculatorPortType port =
service.getCalculatorHttpSoap12Endpoint();
           // TODO initialize WS operation arguments here
           java.lang.Double left = Double.valueOf(5d);
           java.lang.Double right = Double.valueOf(8d);
           // TODO process result here
           java.lang.Double result = port.add(left, right);
           System.out.println("Result = " + result);
       } catch (Exception ex) {
           // TODO handle custom exceptions here
       }


   }

   private void HTTPTest() {
   }

   public PairTestResult runPairTest(String address, String dns) {
       PairTestResult pair = new PairTestResult();
       pair.setSuccess(false);
       pair.setComment("Error: PairTestResult not initialized!");


       try { // Call Web Service Operation
           pilot.Calculator service = new pilot.Calculator();
           if(service==null){
               pair.setSuccess(false);
               pair.setComment("Error: service not initialized!");
               System.out.println("service not initialized.");
           }
           pilot.CalculatorPortType port =
service.getCalculatorHttpSoap11Endpoint();
           if(port==null){
               pair.setSuccess(false);
               pair.setComment("Error: Port not initialized!");
               System.out.println("Port not initialized.");
           }
           System.out.println("Port initialized. "+port.toString());
           // TODO initialize WS operation arguments here
           java.lang.Double left = Double.valueOf(5d);
           java.lang.Double right = Double.valueOf(8d);
           // TODO process result here
           java.lang.Double result = Double.valueOf(0);
           result=port.add(left, right);
           System.out.println("Result got! "+result);
           if(result==null){
               pair.setSuccess(false);
               pair.setComment("Error: Result not Found!");
           }
           if(result==13){
               pair.setSuccess(true);
               pair.setComment("ok");
           }else{
               pair.setSuccess(false);
               pair.setComment("Error: Add did not work!");
           }
           System.out.println("End of try!");
       } catch (Exception ex) {
           // TODO handle custom exceptions here
           ex.printStackTrace();
       }




       return pair;
   }
}


If I run this as a Java Application everything works fine.
the result is this:

Result = 13.0
Result = 13.0
Port initialized. JAX-WS RI 2.1.2-b05-RC1: Stub for
http://89.223.229.140:8080/axis2/services/Calculator.CalculatorHttpSoap11Endpoint
Result got! 13.0
End of try!
ok

As I make an Axis2 web service, and deploy it to Tomcat testing the
runPairTest I get the following error:

[INFO] Deploying module: metadataExchange-1.4 - file:/U:/munkához
eszkozok/apache-tomcat-6.0.16/webapps/axis2/WEB-INF/lib/mex-1.4.jar
Port initialized. [EMAIL PROTECTED]
java.lang.NullPointerException
       at 
org.apache.axis2.jaxws.client.proxy.JAXWSProxyHandler.invokeSEIMethod(JAXWSProxyHandler.java:217)
       at 
org.apache.axis2.jaxws.client.proxy.JAXWSProxyHandler.invoke(JAXWSProxyHandler.java:158)
       at $Proxy16.add(Unknown Source)
       at test.AddClient.runPairTest(AddClient.java:84)
       at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
       at 
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
       at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
       at java.lang.reflect.Method.invoke(Method.java:597)
       at 
org.apache.axis2.rpc.receivers.RPCUtil.invokeServiceClass(RPCUtil.java:194)
       at 
org.apache.axis2.rpc.receivers.RPCMessageReceiver.invokeBusinessLogic(RPCMessageReceiver.java:102)
       at 
org.apache.axis2.receivers.AbstractInOutMessageReceiver.invokeBusinessLogic(AbstractInOutMessageReceiver.java:40)
       at 
org.apache.axis2.receivers.AbstractMessageReceiver.receive(AbstractMessageReceiver.java:100)
       at org.apache.axis2.engine.AxisEngine.receive(AxisEngine.java:176)
       at 
org.apache.axis2.transport.http.util.RESTUtil.invokeAxisEngine(RESTUtil.java:136)
       at 
org.apache.axis2.transport.http.util.RESTUtil.processURLRequest(RESTUtil.java:130)
       at 
org.apache.axis2.transport.http.AxisServlet$RestRequestProcessor.processURLRequest(AxisServlet.java:824)
       at 
org.apache.axis2.transport.http.AxisServlet.doGet(AxisServlet.java:253)
       at javax.servlet.http.HttpServlet.service(HttpServlet.java:690)
       at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
       at 
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
       at 
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
       at 
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
       at 
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
       at 
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
       at 
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
       at 
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
       at 
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:286)
       at 
org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
       at 
org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
       at 
org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
       at java.lang.Thread.run(Thread.java:619)
[INFO] Deploying module: metadataExchange-1.4 - file:/U:/munkához
eszkozok/apache-tomcat-6.0.16/webapps/axis2/WEB-INF/lib/mex-1.4.jar
Port initialized. [EMAIL PROTECTED]
java.lang.NullPointerException
       at 
org.apache.axis2.jaxws.client.proxy.JAXWSProxyHandler.invokeSEIMethod(JAXWSProxyHandler.java:217)
       at 
org.apache.axis2.jaxws.client.proxy.JAXWSProxyHandler.invoke(JAXWSProxyHandler.java:158)
       at $Proxy16.add(Unknown Source)
       at test.AddClient.runPairTest(AddClient.java:84)
       at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
       at 
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
       at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
       at java.lang.reflect.Method.invoke(Method.java:597)
       at 
org.apache.axis2.rpc.receivers.RPCUtil.invokeServiceClass(RPCUtil.java:194)
       at 
org.apache.axis2.rpc.receivers.RPCMessageReceiver.invokeBusinessLogic(RPCMessageReceiver.java:102)
       at 
org.apache.axis2.receivers.AbstractInOutMessageReceiver.invokeBusinessLogic(AbstractInOutMessageReceiver.java:40)
       at 
org.apache.axis2.receivers.AbstractMessageReceiver.receive(AbstractMessageReceiver.java:100)
       at org.apache.axis2.engine.AxisEngine.receive(AxisEngine.java:176)
       at 
org.apache.axis2.transport.http.util.RESTUtil.invokeAxisEngine(RESTUtil.java:136)
       at 
org.apache.axis2.transport.http.util.RESTUtil.processURLRequest(RESTUtil.java:130)
       at 
org.apache.axis2.transport.http.AxisServlet$RestRequestProcessor.processURLRequest(AxisServlet.java:824)
       at 
org.apache.axis2.transport.http.AxisServlet.doGet(AxisServlet.java:253)
       at javax.servlet.http.HttpServlet.service(HttpServlet.java:690)
       at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
       at 
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
       at 
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
       at 
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
       at 
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
       at 
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
       at 
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
       at 
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
       at 
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:286)
       at 
org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
       at 
org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
       at 
org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
       at java.lang.Thread.run(Thread.java:619)

Why is this?



--
Horváth Tamás



-- 
Horváth Tamás

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to