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 Jonah Bossewitch <jo...@sonatainc.com> on 2001/05/16 22:10:59 UTC

Fault handling in SOAP 2.1

I am still having major problems with exception and fault handling in SOAP
2.1. (I apologize if I am posting this question again - I am not sure if my
first attempt succeeded)

For example, I have a method that throws an exception inside one of the
provider's exposed methods:
 
When I was Using SOAP 2.0 the exception would be caught and returned as a
Fault
String
Generated fault:
  Fault Code   = SOAP-ENV:Server
  Fault String = I have deliberately been thrown

Using SOAP 2.1 the exception is uncaught (stack trace below)- and tomcat
returns the standard html 500 error page. 

Does anyone have an idea what might be going on here?  Are the service
methods allowed to throw exceptions or are they responsible for wrapping
them up
in a Fault themselves and return a Response object???

(I am running Xerces 1.3.0, Tomcat 3.2.1, RH Linux 7.0)

Thank you very much -
Jonah

----
here is the stack trace:

java.lang.NullPointerException
        at
org.apache.soap.server.SOAPFaultRouter.notifyListeners(SOAPFaultRouter.java:
101)
        at
org.apache.soap.server.http.RPCRouterServlet.doPost(RPCRouterServlet.java:28
4)
        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:404)
        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:79
7)
        at
org.apache.tomcat.core.ContextManager.service(ContextManager.java:743)
        at
org.apache.tomcat.service.http.HttpConnectionHandler.processConnection(HttpC
onnectionHandler.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(Thread.java:484)


---------------------------------------------------------------------
To unsubscribe, e-mail: soap-user-unsubscribe@xml.apache.org
For additional commands, email: soap-user-help@xml.apache.org


Re: Fault handling in SOAP 2.1

Posted by "William A. Nagy" <na...@watson.ibm.com>.
Jonah,

Could you please post your deployment descriptor?

Also, are you creating an actual SOAP provider, or by provider do you
mean your service implementation (i.e. the class whose methods you are
exposing as a service)?

Have you tried grabbing one of the nightly builds
(http://xml.apache.org/dist/soap/nightly) or building a new version of
SOAP from the CVS tree?  (I tried to recreate your exception with the
newest code, using all of the possible combinations that I could think
of, but was unsuccessful.)

Thanks,
-Bill


>I am still having major problems with exception and fault handling in SOAP
>2.1. (I apologize if I am posting this question again - I am not sure if my
>first attempt succeeded)
>
>For example, I have a method that throws an exception inside one of the
>provider's exposed methods:
> 
>When I was Using SOAP 2.0 the exception would be caught and returned as a
>Fault
>String
>Generated fault:
>  Fault Code   = SOAP-ENV:Server
>  Fault String = I have deliberately been thrown
>
>Using SOAP 2.1 the exception is uncaught (stack trace below)- and tomcat
>returns the standard html 500 error page. 
>
>Does anyone have an idea what might be going on here?  Are the service
>methods allowed to throw exceptions or are they responsible for wrapping
>them up
>in a Fault themselves and return a Response object???
>
>(I am running Xerces 1.3.0, Tomcat 3.2.1, RH Linux 7.0)
>
>Thank you very much -
>Jonah
>
>----
>here is the stack trace:
>
>java.lang.NullPointerException
>        at
>org.apache.soap.server.SOAPFaultRouter.notifyListeners(SOAPFaultRouter.java:
>101)
>        at
>org.apache.soap.server.http.RPCRouterServlet.doPost(RPCRouterServlet.java:28
>4)
>        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:404)
>        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:79
>7)
>        at
>org.apache.tomcat.core.ContextManager.service(ContextManager.java:743)
>        at
>org.apache.tomcat.service.http.HttpConnectionHandler.processConnection(HttpC
>onnectionHandler.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(Thread.java:484)



Re: Fault handling in SOAP 2.1

Posted by "William A. Nagy" <na...@watson.ibm.com>.
Jonah,

Could you please post your deployment descriptor?

Also, are you creating an actual SOAP provider, or by provider do you
mean your service implementation (i.e. the class whose methods you are
exposing as a service)?

Have you tried grabbing one of the nightly builds
(http://xml.apache.org/dist/soap/nightly) or building a new version of
SOAP from the CVS tree?  (I tried to recreate your exception with the
newest code, using all of the possible combinations that I could think
of, but was unsuccessful.)

Thanks,
-Bill


>I am still having major problems with exception and fault handling in SOAP
>2.1. (I apologize if I am posting this question again - I am not sure if my
>first attempt succeeded)
>
>For example, I have a method that throws an exception inside one of the
>provider's exposed methods:
> 
>When I was Using SOAP 2.0 the exception would be caught and returned as a
>Fault
>String
>Generated fault:
>  Fault Code   = SOAP-ENV:Server
>  Fault String = I have deliberately been thrown
>
>Using SOAP 2.1 the exception is uncaught (stack trace below)- and tomcat
>returns the standard html 500 error page. 
>
>Does anyone have an idea what might be going on here?  Are the service
>methods allowed to throw exceptions or are they responsible for wrapping
>them up
>in a Fault themselves and return a Response object???
>
>(I am running Xerces 1.3.0, Tomcat 3.2.1, RH Linux 7.0)
>
>Thank you very much -
>Jonah
>
>----
>here is the stack trace:
>
>java.lang.NullPointerException
>        at
>org.apache.soap.server.SOAPFaultRouter.notifyListeners(SOAPFaultRouter.java:
>101)
>        at
>org.apache.soap.server.http.RPCRouterServlet.doPost(RPCRouterServlet.java:28
>4)
>        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:404)
>        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:79
>7)
>        at
>org.apache.tomcat.core.ContextManager.service(ContextManager.java:743)
>        at
>org.apache.tomcat.service.http.HttpConnectionHandler.processConnection(HttpC
>onnectionHandler.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(Thread.java:484)



---------------------------------------------------------------------
To unsubscribe, e-mail: soap-user-unsubscribe@xml.apache.org
For additional commands, email: soap-user-help@xml.apache.org


Re: Fault handling in SOAP 2.1

Posted by "William A. Nagy" <na...@watson.ibm.com>.
Jonah,

Could you please post your deployment descriptor?

Also, are you creating an actual SOAP provider, or by provider do you
mean your service implementation (i.e. the class whose methods you are
exposing as a service)?

Have you tried grabbing one of the nightly builds
(http://xml.apache.org/dist/soap/nightly) or building a new version of
SOAP from the CVS tree?  (I tried to recreate your exception with the
newest code, using all of the possible combinations that I could think
of, but was unsuccessful.)

Thanks,
-Bill


>I am still having major problems with exception and fault handling in SOAP
>2.1. (I apologize if I am posting this question again - I am not sure if my
>first attempt succeeded)
>
>For example, I have a method that throws an exception inside one of the
>provider's exposed methods:
> 
>When I was Using SOAP 2.0 the exception would be caught and returned as a
>Fault
>String
>Generated fault:
>  Fault Code   = SOAP-ENV:Server
>  Fault String = I have deliberately been thrown
>
>Using SOAP 2.1 the exception is uncaught (stack trace below)- and tomcat
>returns the standard html 500 error page. 
>
>Does anyone have an idea what might be going on here?  Are the service
>methods allowed to throw exceptions or are they responsible for wrapping
>them up
>in a Fault themselves and return a Response object???
>
>(I am running Xerces 1.3.0, Tomcat 3.2.1, RH Linux 7.0)
>
>Thank you very much -
>Jonah
>
>----
>here is the stack trace:
>
>java.lang.NullPointerException
>        at
>org.apache.soap.server.SOAPFaultRouter.notifyListeners(SOAPFaultRouter.java:
>101)
>        at
>org.apache.soap.server.http.RPCRouterServlet.doPost(RPCRouterServlet.java:28
>4)
>        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:404)
>        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:79
>7)
>        at
>org.apache.tomcat.core.ContextManager.service(ContextManager.java:743)
>        at
>org.apache.tomcat.service.http.HttpConnectionHandler.processConnection(HttpC
>onnectionHandler.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(Thread.java:484)



---------------------------------------------------------------------
To unsubscribe, e-mail: soap-user-unsubscribe@xml.apache.org
For additional commands, email: soap-user-help@xml.apache.org