Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » ServerTools (WTP) » InvocationTargetException when calling service methods
InvocationTargetException when calling service methods [message #534835] Thu, 20 May 2010 13:28 Go to next message
Tim Shelley is currently offline Tim ShelleyFriend
Messages: 60
Registered: July 2009
Member
Hi All,

I've used Eclipse 3.5.1 with WTP to develop some webservices and some server and client side JUnit tests. I developed it using the Tomcat that runs inside Eclipse and all my test green bar. So I decided to create a war file of the server WebContents and deploy it to another Tomcat installation. This installation is on the same machine so the URL does not change.
My problem is that when I now run my client junit tests I now get the following exception:

org.apache.axis2.AxisFault: java.lang.RuntimeException: java.lang.reflect.InvocationTargetException
at org.apache.axis2.util.Utils.getInboundFaultFromMessageContex t(Utils.java:512)

The service method I call returns an object. I've looked in the deployed war and the class is there. I'm wondering why it works when Tomcat runs in Eclipse but not when I run it in a separate Tomcat. Have I missed something out when creating the war - I just archive the Webcontents directory.

Thanks in advance.
Re: InvocationTargetException when calling service methods [message #534874 is a reply to message #534835] Thu, 20 May 2010 14:06 Go to previous messageGo to next message
Larry Isaacs is currently offline Larry IsaacsFriend
Messages: 1354
Registered: July 2009
Senior Member
Tim Shelley wrote:
> Hi All,
>
> I've used Eclipse 3.5.1 with WTP to develop some webservices and some
> server and client side JUnit tests. I developed it using the Tomcat that
> runs inside Eclipse and all my test green bar. So I decided to create a
> war file of the server WebContents and deploy it to another Tomcat
> installation. This installation is on the same machine so the URL does
> not change. My problem is that when I now run my client junit tests I
> now get the following exception:
>
> org.apache.axis2.AxisFault: java.lang.RuntimeException:
> java.lang.reflect.InvocationTargetException
> at org.apache.axis2.util.Utils.getInboundFaultFromMessageContex
> t(Utils.java:512)
>
> The service method I call returns an object. I've looked in the deployed
> war and the class is there. I'm wondering why it works when Tomcat runs
> in Eclipse but not when I run it in a separate Tomcat. Have I missed
> something out when creating the war - I just archive the Webcontents
> directory.
>
> Thanks in advance.

Try File -> Export -> Web -> "WAR file", since that is more likely to
give you a WAR that contains the same content that Tomcat is serving
within Eclipse.

Cheers,
Larry
Re: InvocationTargetException when calling service methods [message #535084 is a reply to message #534835] Fri, 21 May 2010 09:19 Go to previous messageGo to next message
Tim Shelley is currently offline Tim ShelleyFriend
Messages: 60
Registered: July 2009
Member
Hi Larry,

Thanks for the reply. I've now tried that and still get the same exception.
Re: InvocationTargetException when calling service methods [message #535194 is a reply to message #535084] Fri, 21 May 2010 13:29 Go to previous messageGo to next message
Larry Isaacs is currently offline Larry IsaacsFriend
Messages: 1354
Registered: July 2009
Senior Member
Tim Shelley wrote:
> Hi Larry,
>
> Thanks for the reply. I've now tried that and still get the same exception.

Within Eclipse, the webapp for your project that the Eclipse Tomcat is
serving is likely to be found under the "<your
workspace> /.metadata/.plugins/org.eclipse.wst.server.core/tmp?/wtpweba pps "
directory. For details, see the WTP Tomcat FAQ[1]. If you compare it to
the expanded version of the WAR you deployed, do you find any differences?

Cheers,
Larry

[1] http://wiki.eclipse.org/WTP_Tomcat_FAQ
Re: InvocationTargetException when calling service methods [message #535199 is a reply to message #534835] Fri, 21 May 2010 14:21 Go to previous messageGo to next message
Tim Shelley is currently offline Tim ShelleyFriend
Messages: 60
Registered: July 2009
Member
Hi Larry,

Thanks, but I've already delved into the depths of org.eclipse.wst.server.core to see if I could spot any differences with folder and files everything seems to be there. I did a quick look to see if the files and folder count and the total size differ. But both are identical.

Thanks for the WTP FAQ link, I will read through that to see if it shines any light on my issue.

I've not had this issue with other web service projects I written in WTP, this seems to be the first one to give me issues so I do not fully understand why...
Re: InvocationTargetException when calling service methods [message #535209 is a reply to message #535199] Fri, 21 May 2010 15:00 Go to previous message
Larry Isaacs is currently offline Larry IsaacsFriend
Messages: 1354
Registered: July 2009
Senior Member
Tim Shelley wrote:
> Hi Larry,
>
> Thanks, but I've already delved into the depths of
> org.eclipse.wst.server.core to see if I could spot any differences with
> folder and files everything seems to be there. I did a quick look to see
> if the files and folder count and the total size differ. But both are
> identical.
>
> Thanks for the WTP FAQ link, I will read through that to see if it
> shines any light on my issue.
>
> I've not had this issue with other web service projects I written in
> WTP, this seems to be the first one to give me issues so I do not fully
> understand why...

Since they are running in separate instances of Tomcat, it is certainly
possible for their "configurations" to diverge. If you think there
could be changes to your installed Tomcat instance, you could try
creating a "fresh" Tomcat from a binary zip. Then create a new server
in Eclipse and try your project with the new Tomcat inside Eclipse and
outside of Eclipse. If your project works in both Tomcats, then it
would confirm there is something different in your original Tomcat.

I haven't worked that much with Axis2, but I would guess that the
InvocationTargetException is just a symptom of the "real" problem. You
might have to check the Tomcat logs to see if any additional clues are
showing up there.

Cheers,
Larry
Previous Topic:WTP CSS Code Assist
Next Topic:How can I customize the WTP?
Goto Forum:
  


Current Time: Fri Apr 26 02:22:30 GMT 2024

Powered by FUDForum. Page generated in 0.03611 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top