You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@axis.apache.org by Rafe Colburn <ra...@gmail.com> on 2004/04/21 15:09:45 UTC

InvocationTargetException

  I have a method that I'm calling using Axis 1.1. The method contains
only a single call to a static method of another class. That method
returns an object, and my SOAP-accessible method pulls a string out of
that object and returns it.

 Or, that's what it's supposed to do.  Instead it returns an
InvocationTargetException by way of a fault.  If I remove the method
call from my SOAP-accessible method and just return a static string,
everything works fine.  If I call the SOAP-accessible method outside
the SOAP context (by instantiating the class directly and calling the
method), everything works fine.

 I've tried running the server side code in a debugger (it's running
under Tomcat 5), but the method just ceases execution when it gets to
the static method call.  Nothing is printed in the logs and I can't
step through it at all.

 I have two questions. The first is whether I'm missing something
obvious. It seems like a simple problem that I'm just missing.

 The second is how you do the forensics on these problems. I think the
InvocationTargetException encapsulates an exception of another kind,
but I'm not sure how to access it within the SOAP client code. Any
ideas?  getCause() on the exception won't work.

 Thanks,
 Rafe

Re: InvocationTargetException

Posted by Rafe Colburn <ra...@gmail.com>.
On Wed, 21 Apr 2004 09:09:45 -0400, Rafe Colburn <ra...@gmail.com> wrote:
>   I have a method that I'm calling using Axis 1.1. The method contains
> only a single call to a static method of another class. That method
> returns an object, and my SOAP-accessible method pulls a string out of
> that object and returns it.
> 
>  Or, that's what it's supposed to do.  Instead it returns an
> InvocationTargetException by way of a fault.  If I remove the method
> call from my SOAP-accessible method and just return a static string,
> everything works fine.  If I call the SOAP-accessible method outside
> the SOAP context (by instantiating the class directly and calling the
> method), everything works fine.

 As it turns out the problem here occurs only when the class being
called is in a jar file in the lib directory of my webapp.  If I
extract the classes from the jar file and put them in the classes
directory of the webapp, it works as expected.  Anyone ever seen this
behavior?  Any idea what causes it and whether there's a workaround?

 --Rafe