Monday, January 12, 2009

InvocationTargetException with the Apache Axis2 Eclipse plugin

If you have to use Axis2, and work with Eclipse, it is worth to try this tool:

Code Generator Wizard Guide for Eclipse Plug-in

If you encounter the following problem:



then it means that not all the necessary jar files are available: either not packaged in the plugin download or they are missing from the plugin.xml.

Do the following (this particular solution worked for me, this or a similar one should also work for you):

1. Download the following jar files:

stax-api-1.0.1.jar
backport-util-concurrent-3.1.jar

and save them to eclipse/plugins/[Axis2 Codegen Wizard]/lib (replace [Axis2 Codegen Wizard] with the real plugin directory).

2. Add to the eclipse/plugins/[Axis2 Codegen Wizard]/plugin.xml the followings (to the <runtime> element), if they are missing:

<library name="lib/stax-api-1.0.1.jar">
<export name="*"/>
</library>


<library name="lib/backport-util-concurrent-3.1.jar">
<export name="*"/>
</library>


3. Restart Eclipse:

eclipse -clean

If you still have problems, then open eclipse/plugins/[Axis2 Codegen Wizard]/plugin.xml, and figure out which jar files are still missing. Use http://findjar.com/ for download locations of the missing files.

Links discussing the same problem:

Developing Web Services Using Apache Axis2 Eclipse Plugins

Blogs from Iterox - used this method to track down the problem


4 comments:

Anonymous said...

small fix: close the 'export' nodes
<export name="*"/>

Anonymous said...

Thank you very much!!!

It worked like a gem!!!

Thanks again!!!!!!

|3lackH0l3 said...

It works...

Praveen C said...

it worked generating files but created another issue.
after Generating files it throws the below error org.apache.axis2.databinding.utils.writer.mtomawarexmlstreamwriter cannot be resolved to type