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 "Fluharty, Fred" <Fr...@ps.net> on 2004/01/07 14:41:32 UTC

Trouble with SOAPException

Hello all.  Hopefully someone can help me here.

I want to have an exception returned to the caller of an exposed SOAP
method, so I'm making the following call:

	throw new SOAPException(Constants.FAULT_CODE_SERVER, <error
message>);

An exception makes it back to the caller, but it's more something about the
content of the response being in HTML, not XML.  On our side, which is a
WebLogic server using Apache SOAP, I get the following in the WebLogic
output:

<Jan 6, 2004 11:42:44 AM PST> <Error> <HTTP> <101018>
<[ServletContext(id=1223009,name=soap,context-path=/soap)] Servlet failed
with ServletException
javax.servlet.ServletException: Error building response envelope:
java.lang.NullPointerException
        at
org.apache.soap.server.http.RPCRouterServlet.doPost(RPCRouterServlet.java:41
8)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
        at
weblogic.servlet.internal.ServletStubImpl$ServletInvocationAction.run(Servle
tStubImpl.java:1075)
        at
weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java
:418)
        at
weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java
:306)
        at
weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(W
ebAppServletContext.java:5528)
        at
weblogic.security.service.SecurityServiceManager.runAs(SecurityServiceManage
r.java:685)
        at
weblogic.servlet.internal.WebAppServletContext.invokeServlet(WebAppServletCo
ntext.java:3155)
        at
weblogic.servlet.internal.ServletRequestImpl.execute(ServletRequestImpl.java
:2519)
        at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:234)
        at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:210)

I don't know why this NPE is happening on my server-side, or why they're not
simply seeing a SOAPException on the client side..  I'd appreciate any help
you could give me.


Thanks,
Fred Fluharty

Re: Trouble with SOAPException

Posted by Scott Nichol <sn...@scottnichol.com>.
Fred,

The error message you see in HTML is not created by Apache SOAP.  Your WebLogic container is catching the NPE and returning this to you.  The real job here is to understand what you get the NPE.  Unfortunately, it appears you are using the 2.3.1 release of Apache SOAP, which hides the root cause of the exception.  Shortly after 2.3.1 was released, the line

          throw new ServletException ("Error building response envelope: " + e);

was changed to 

          throw new ServletException ("Error building response envelope: " + e, e); 

precisely to provide the information needed to track down exceptions like you are experiencing.

In 2.3.1, the most common cause of exceptions like the one you are getting is the deployment descriptor, specifically the element

    <isd:faultListener>org.apache.soap.server.DOMFaultListener</isd:faultListener>

Note that the character content of the element is the name of a Java class.  If the class is not found, the 2.3.1 code ignored the exception, but that eventually led to an NPE.  The most common error is that the line above is *not* equivalent to 

    <isd:faultListener>org.apache.soap.server.DOMFaultListener
    </isd:faultListener>

or

    <isd:faultListener>
    org.apache.soap.server.DOMFaultListener</isd:faultListener>

because the whitespace is significant.  I recommend you check your DD for similar whitespace.

I also recommend you change from the 2.3.1 to a recent nightly build, but I understand that many people want to stick with a formal release.

Scott Nichol

Do not send e-mail directly to this e-mail address,
because it is filtered to accept only mail from
specific mail lists.
----- Original Message ----- 
From: "Fluharty, Fred" <Fr...@ps.net>
To: <so...@ws.apache.org>
Sent: Wednesday, January 07, 2004 8:41 AM
Subject: Trouble with SOAPException


> Hello all.  Hopefully someone can help me here.
> 
> I want to have an exception returned to the caller of an exposed SOAP
> method, so I'm making the following call:
> 
> throw new SOAPException(Constants.FAULT_CODE_SERVER, <error
> message>);
> 
> An exception makes it back to the caller, but it's more something about the
> content of the response being in HTML, not XML.  On our side, which is a
> WebLogic server using Apache SOAP, I get the following in the WebLogic
> output:
> 
> <Jan 6, 2004 11:42:44 AM PST> <Error> <HTTP> <101018>
> <[ServletContext(id=1223009,name=soap,context-path=/soap)] Servlet failed
> with ServletException
> javax.servlet.ServletException: Error building response envelope:
> java.lang.NullPointerException
>         at
> org.apache.soap.server.http.RPCRouterServlet.doPost(RPCRouterServlet.java:41
> 8)
>         at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
>         at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
>         at
> weblogic.servlet.internal.ServletStubImpl$ServletInvocationAction.run(Servle
> tStubImpl.java:1075)
>         at
> weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java
> :418)
>         at
> weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java
> :306)
>         at
> weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(W
> ebAppServletContext.java:5528)
>         at
> weblogic.security.service.SecurityServiceManager.runAs(SecurityServiceManage
> r.java:685)
>         at
> weblogic.servlet.internal.WebAppServletContext.invokeServlet(WebAppServletCo
> ntext.java:3155)
>         at
> weblogic.servlet.internal.ServletRequestImpl.execute(ServletRequestImpl.java
> :2519)
>         at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:234)
>         at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:210)
> 
> I don't know why this NPE is happening on my server-side, or why they're not
> simply seeing a SOAPException on the client side..  I'd appreciate any help
> you could give me.
> 
> 
> Thanks,
> Fred Fluharty
>