You are viewing a plain text version of this content. The canonical link for it is here.
Posted to soap-user@ws.apache.org by Michael Ward <ms...@speakeasy.net> on 2002/08/09 02:38:41 UTC

help please with Error: 500

I've been struggling with this for a while now.  I essentially have the Hello world example where a string is sent in and a string is returned.  I am running 
tomcat3.2.1, xerces1.4.1, jdk1.4 here's a listing of my classpath:

Using CLASSPATH: C:\Progra~1\Apache\tomcat3.2.1\lib\ant.jar;C:\Progra~1\Apache\tomcat3.2.1\lib\activation.jar;C:\Progra~1\Apache\tomcat3.2.1
\lib\mail.jar;C:\Progra~1\Apache\tomcat3.2.1\lib\soap.jar;C:\Progra~1\Apache\tomcat3.2.1\lib\xerces.jar;C:\Progra~1\Apache\tomcat3.2.1
\classes;C:Progra~1\Apache\tomcat3.2.1\lib\activation.jar;C:\Progra~1\Apache\tomcat3.2.1\lib\ant.jar;C:\Progra~1\Apache\tomcat3.2.1\lib
\jasper.jar;C:\Progra~1\Apache\tomcat3.2.1\lib\jaxp.jar;C:\Progra~1\Apache\tomcat3.2.1\lib\mail.jar;C:\Progra~1\Apache\tomcat3.2.1\lib
\parser.jar;C:\Progra~1\Apache\tomcat3.2.1\lib\servlet.jar;C:\Progra~1\Apache\tomcat3.2.1\lib\soap.jar;C:\Progra~1\Apache\tomcat3.2.1\lib
\webserver.jar;C:\Progra~1\Apache\tomcat3.2.1\lib\xerces.jar

I am able deploy the web service and verify it with a listing request but when I actually attempt to make a call I get a 500 error.  Does anyone have an 
idea what is wrong??  I've added my deployment descriptor and client connect info.  Also the client and server side stack trace if that helps.

thanks,
-mike

Deployment Descriptor
<dd:service xmlns:dd="http://xml.apache.org/xml-soap/deployment"
             id="urn:gateIn">
  <dd:provider type="java"
               scope="Application"
               methods="handleGateInRequest">
    <dd:java class="com.ias.test.webService.GateInService" 
             static="false"/>
  </dd:provider>

  <dd:faultListener>
    org.apache.soap.server.DOMFaultListener
  </dd:faultListener>
  <dd:mappings/>
</dd:service>



Client Code
        String result = makeSoapRequest("urn:gateIn",
                                        "handleGateInRequest");


    public static String makeSoapRequest(String targetURI,
                                           String methodName) 
        throws Exception {
        Call call = new Call();
        call.setTargetObjectURI(targetURI);
        call.setMethodName(methodName);
        call.setEncodingStyleURI(Constants.NS_URI_SOAP_ENC);
        Vector params = new Vector();
        params.addElement(new Parameter("gateInXML", 
                                        String.class,
                                        "test string",
                                        null));
        Response response = 
            call.invoke(new URL("http://localhost:8080/soap/servlet/rpcrouter"),
                        "");




Client Side result:
    [junit] 2002-08-08 17:31:47,369 ERROR GateInTest.testGateIn - GateIn test failed
    [junit] [SOAPException: faultCode=SOAP-ENV:Protocol; msg=Unsupported response content type &quot;text/html&quot;, must be: 
&quot;text/xml&quot;. Response was:
    [junit] &lt;h1&gt;Error: 500&lt;/h1&gt;
    [junit] &lt;h2&gt;Location: /soap/servlet/rpcrouter&lt;/h2&gt;&lt;b&gt;Internal Servlet Error:&lt;/b&gt;&lt;br&gt;&lt;pre&gt;javax.servlet.ServletException: 
Error building response envelope: java.lang.NullPointerException
    [junit]     at org.apache.soap.server.http.RPCRouterServlet.doPost(RPCRouterServlet.java:418)
    [junit]     at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
    [junit]     at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
    [junit]     at org.apache.tomcat.core.ServletWrapper.doService(ServletWrapper.java:404)
    [junit]     at org.apache.tomcat.core.Handler.service(Handler.java:286)
    [junit]     at org.apache.tomcat.core.ServletWrapper.service(ServletWrapper.java:372)
    [junit]     at org.apache.tomcat.core.ContextManager.internalService(ContextManager.java:797)
    [junit]     at org.apache.tomcat.core.ContextManager.service(ContextManager.java:743)
    [junit]     at org.apache.tomcat.service.http.HttpConnectionHandler.processConnection(HttpConnectionHandler.java:210)
    [junit]     at org.apache.tomcat.service.TcpWorkerThread.runIt(PoolTcpEndpoint.java:416)
    [junit]     at org.apache.tomcat.util.ThreadPool$ControlRunnable.run(ThreadPool.java:498)
    [junit]     at java.lang.Thread.run(Unknown Source)
    [junit] &lt;/pre&gt;

    [junit] ]
    [junit]     at org.apache.soap.rpc.Call.getEnvelopeString(Call.java:208)
    [junit]     at org.apache.soap.rpc.Call.invoke(Call.java:255)
    [junit]     at com.ias.test.helper.SenderHelper.makeSoapRequest(SenderHelper.java:44)
    [junit]     at com.ias.test.helper.SenderHelper.sendMessage(SenderHelper.java:26)
    [junit]     at com.ias.test.GateInTest.testGateIn(GateInTest.java:29)
    [junit]     at java.lang.reflect.Method.invoke(Native Method)
    [junit]     at junit.framework.TestCase.runTest(TestCase.java:166)
    [junit]     at junit.framework.TestCase.runBare(TestCase.java:140)
    [junit]     at junit.framework.TestResult$1.protect(TestResult.java:106)
    [junit]     at junit.framework.TestResult.runProtected(TestResult.java:124)
    [junit]     at junit.framework.TestResult.run(TestResult.java:109)
    [junit]     at junit.framework.TestCase.run(TestCase.java:131)
    [junit]     at junit.framework.TestSuite.runTest(TestSuite.java:173)
    [junit]     at junit.framework.TestSuite.run(TestSuite.java:168)
    [junit]     at org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner.run(JUnitTestRunner.java:325)
    [junit]     at org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner.main(JUnitTestRunner.java:524)
    [junit] Tests run: 1, Failures: 1, Errors: 0, Time elapsed: 1.382 sec




Server Stack
2002-08-08 05:31:47 - Ctx( /soap ): Exception in: R( /soap + /servlet/rpcrouter
+ null) - javax.servlet.ServletException: Error building response envelope: java
.lang.NullPointerException
        at org.apache.soap.server.http.RPCRouterServlet.doPost(RPCRouterServlet.
java:418)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
        at org.apache.tomcat.core.ServletWrapper.doService(ServletWrapper.java:4
04)
        at org.apache.tomcat.core.Handler.service(Handler.java:286)
        at org.apache.tomcat.core.ServletWrapper.service(ServletWrapper.java:372
)
        at org.apache.tomcat.core.ContextManager.internalService(ContextManager.
java:797)
        at org.apache.tomcat.core.ContextManager.service(ContextManager.java:743
)
        at org.apache.tomcat.service.http.HttpConnectionHandler.processConnectio
n(HttpConnectionHandler.java:210)
        at org.apache.tomcat.service.TcpWorkerThread.runIt(PoolTcpEndpoint.java:
416)
        at org.apache.tomcat.util.ThreadPool$ControlRunnable.run(ThreadPool.java
:498)
        at java.lang.Thread.run(Unknown Source)