Blogs from Iterox

Java Enterprise Development

Exploring Apache Axis2 and Eclipse Plug-in Development

with 80 comments

Introduction

Exploring Service Oriented Architecture I decided to dive into Apache Axis2. I like to work with Eclipse IDE and having found this tutorial I started it right away. I use Eclipse Ganymede (SDK 3.4.0) with JDK 1.5.0_16 and Tomcat 6.0.18 (on XP/SP3) and did not pay too much attention to the fact that the tutorial was written for Eclipse SDK v3.2 and Axis2 Eclipse Plug-in v1.3 with JDK 1.4.2.x and Tomcat 4.1.x. Part 1 of the tutorial went fine almost to the last step. I downloaded the two Axis2 Eclipse Plug-ins (of interest for this short story is the Axis2 Code Generator Plug-in which I downloaded from here), unzipped them and installed the two unzipped folders in the dropins folder of Eclipse and restarted Eclipse. Generating the service archive into the deployed Axis2 Web Application went smooth. Generating the WSDL from the Java source gave no problems until I got to the point where I clicked the final Finish button to complete the Axis2 Code Generator Plug-in Wizard.

It said:

No further information. No logging. No nothing. Searching the web lead me to this very same tutorial, where, I now found out, were quite a large number of desperate comments on the occurrence of the java.lang.reflect.InvocationtargetException, but no solution. (Later I found this thread of comments, but that was after I investigated the problem myself). What to do? Since the Axis2 Code Generator Plug-in Wizard came with sources included and a .classpath and a .project file I thought it worthwhile to give it a shot and import the whole thing as a Plug-ins and Fragments into my workspace and debug it! Yeah! Let’s go.

Debugging Axis2 Code Generator Wizard Plug-in

With Eclipse started and the Plug-in Development perspective selected choose Import and from the list select Plug-ins and Fragments like below:


Choose Next. The following screen is displayed:


Choose next. Select Axis2_Codegen_Wizard (1.3.0) in the left panel and click Addà to have the plug-in selected for import. (Make sure that you have the target platform pointing to your Eclipse home directory)


Click Finish. Eclipse will now import the plug-in into the workspace. A couple of errors are displayed. I ignored them.J


Before I move on lets switch over to the Debug perspective and add a Java Exception Breakpoint and select java.lang.reflect.InvocationTargetException like shown below.


Switch back to the Plug-in Development perspective and open plugin.xml with the built-in Plug-in Manifest editor. The Overview tab is shown.


Under the Testing heading click the hyperlink “Launch an Eclipse application in Debug mode”. Ignore the Errors in Workspace notification and click Proceed. A new Eclipse Application is launched in which we now will invoke the Axis2 Code Generator Plug-in Wizard by following the tutorial at the point where the WSDL is to be generated from the java class. Upon clicking the Finish button to complete the wizard you will see that the Eclipse Application from which we launched is now halted at the Java Exception Breakpoint for the InvocationTargetException:


As you can see in the screenshot the Variables view now tells us that a RuntimeException has occurred. This is caused by a NoClassDefFoundError for class javax/xml/stream/XMLStreamException. In Firefox I then went to findjar.com and entered “javax/xml/stream/XMLStreamException”. This lead to stax-api-1.0.1.jar. I downloaded this jar file and added it to the \lib directory of the plug-in residing in the dropins directory of your Eclipse installation. As a matter of fact the jar is listed in the plugin.xml, but apparently the plug-in is provided without the actual jar file in it. After adding the jar file restart Eclipse using the –clean option.

Repeating the same procedure as described above I again launched an Eclipse application in debug mode and invoked the Plug-in Wizard once more. Going through the steps of the wizard I finally clicked the Finish button and again the java Exception Breakpoint for the same InvocationTargetException halted as can be seen in the following screenshot:


Again a RuntimeException, but this time caused by the absence of class edu/emory/mathcs/backport/java/util/concurrent/ConcurrentHashMap. Through findjar.com I established that it’s inside backport-util-concurrent-3.1.jar. This I found to be part of the Axis2 1.4.1 distribution and I copied it from there to the \lib directory of the Plug-in. This time also adding an entry to the plugin.xml, just like the other jar files.

Repeating the steps from the tutorial again, this time clicking the Finish button of the Axis2 Code Generator Plug-in Wizard resulted in the desired WSDL file being created. Yippee!

Conclusion

To get myself familiarized with Apache Axis2 in combination with the Eclipse platform I stumbled upon the Axis2 Code Generator Plug-in Wizard crashing in an exception being thrown. I then used Eclipse Plug-in Development to Import the Plug-in code and start debugging it. (A helpful resource in this respect is the cheat sheet on creating an Eclipse Plug-in). This lead to the discovery of two missing jar files in the lib directory of the plug-in folder. After adding these jar files the Axis2 Code generator Plug-in is working fine. So, now it’s time to continue my journey in the land of SOA.


About these ads

Written by Eric Tamminga

24 October 2008 at 9:33 am

Posted in Eclipse, Java, Jee

Tagged with , ,

80 Responses

Subscribe to comments with RSS.

  1. Thank YOU! Followed your steps and got it going. Thank you.

    mike monk

    28 October 2008 at 5:35 pm

    • First class solution to a very annoying problem…

      Makes you wonder what are the axis2 developers/maintainers doing when there is such a real problem in their distribution. If there were some licensing issues, at least they should document and offer a solution.

      Great bit of research – thanks

      Llies

      5 August 2009 at 9:43 pm

  2. Thank you! It works! But for a novice in development of plugins like me it’s important to say that you need to remove the old folder eclipse/plugins/Axis2_Codegen_Wizard and replace with the new Axis2_Codegen_Wizard folder with the corrections.

    Lucio Agostinho Rocha

    29 October 2008 at 9:37 pm

  3. I actually dropped both Axis2 Plug-ins in the dropins folder and only had to copy the changes to it and then restart Eclipse with the -clean option.
    You can read more about the dropins folder here.

    Eric Tamminga

    29 October 2008 at 10:12 pm

    • Thanks a lot man… Its a great discovery.. I followed all the steps you mentioned except restarting eclipse with -clean option. Changes are not working for me. infect can you tell me how to restart eclipse with -clean option.

      Pankaj

      12 May 2009 at 2:27 pm

    • thanks man!!!

      gitsz

      1 December 2009 at 4:43 pm

  4. God bless you, man!

    Thanks!

    Valentin

    31 October 2008 at 1:52 am

  5. Thanks a lot man… You rock!!!

    Sanket

    3 November 2008 at 10:57 am

  6. One more remark on me dropping the Axis2 Code Generator Wizard Plug-in in the dropins folder. You’d better not do that, since the plug-in assumes you place it under the plugins folder.

    I found out (again by debugging) that when you select the option “Add the Axis2 codegen jars to the resulted project” on the Output page of the wizard it goes looking for the jar-files under ECLIPSE_HOME/plugins/Axis2_Codegen_Wizard_1.3.0/lib to copy them to the resulted project. After finishing the wizard the lib folder of my resulted project remained empty. First I could not understand why, but then it finally became clear: my jar files where under ECLIPSE_HOME/dropins/Axis2_Codegen_Wizard_1.3.0/lib…

    Eric Tamminga

    3 November 2008 at 2:32 pm

  7. I didn’t try this yet, but I ask myself why haven’t the axis people discovered this error if it is so common.
    And there are plenty of tutorials over the web saying that it works fine, or that they don’t notice any type of exception.

    Ervin

    7 November 2008 at 6:01 pm

  8. That’s the question indeed. Anyhow I was very pleased to get the plug-in to work on my configuration/platform. And so far the solution made a couple of other people pleased also. That’s what matters to me.

    Eric Tamminga

    9 November 2008 at 10:19 pm

  9. thanks a lot friend!! (what a problem has you fixed!!)

    gabriel

    11 November 2008 at 3:31 am

  10. Thanks man. Followed your steps and it worked.
    Cheers.

    Rado

    12 November 2008 at 6:32 pm

  11. This really helped me out of a jam. Thanks very much for posting such a well written tutorial on how to fix the problem.

    Tyler

    25 November 2008 at 9:13 pm

  12. Thank a lot, man!

    Generating Java stubs from WSDL didn’t work for me
    until I applied your patch.

    My env:
    Eclipse 3.4.1
    Axis2_Codegen_Wizard_1.3.0
    axis2-1.4.1

    That stax jar from codehaus wasn’t there.

    Great job!

    Leonid

    26 November 2008 at 3:37 am

  13. Thanks so much! This saved me a lot of time..

    Cheers

    belano

    30 November 2008 at 6:57 pm

  14. Great Job! For those who are applying this solution, just don’t forget to add an entry for “backport-util-concurrent-3.1.jar” in “…eclipse/plugins/Axis2_Codegen_Wizard_1.3.0/plugins.xml”

    Rgds
    Hassan.
    DPS.

    Hassan Naqvi

    3 December 2008 at 6:24 pm

  15. Best tutorial I’ve found in a while – if only they were all this detailed and useful.

    marta

    5 December 2008 at 6:02 pm

  16. Forgive me, but I am new to Eclipse and Java (I am a Windows C/C++ and .Net programmer). I am too green when it comes to Eclipse to follow the tutorial all the way through to success.

    When I try to run Eclipse in the debugger, I get an “Unhandled event loop exception” and nothing happens. I am assuming I am missing something.

    Prior to trying to follow the tutorial step by step, I downloaded the backport-util-concurrent-3.1.jar and stax-api-1.0.1.jar (both with a zip extension that I changed to jar) and placed them in “C:\eclipse\plugins\Axis2_Codegen_Wizard_1.3.0\lib” and then started Eclipse with –clean and the error was not fixed.

    What am I doing wrong?

    ehcarleton

    11 December 2008 at 7:18 am

    • As often it’s hard to say what causes the “Unhandled event loop exception” from a distance without detailed information. My guess is that it’s got something to do with the way you setup your eclipse environment. What I can say is that it’s not a good practise to rename a zip-file into a jar-file. For the stax jar-file you can use this link. For the backport jar-file you can use this link. Last a free advice: if your new to Eclipse and Java you better start with some tutorials with a less exotic subject and you probably want to do a lot of them on different subjects to get the hang of it. Good luck!

      Kind regards,
      Eric

      Eric Tamminga

      11 December 2008 at 7:25 pm

  17. Thanks a lot!

    Kangaroo

    13 December 2008 at 10:46 pm

  18. thanks for this

    ad

    27 December 2008 at 10:08 pm

  19. You are everyone’s hero, congrat !

    laszlo

    28 December 2008 at 3:42 am

  20. I’ll add my appreciation to the growing list. This saved lots of time and frustration, thank you!

    Dale

    4 February 2009 at 1:59 am

  21. Same thing here in France. Merci beaucoup ! :)

    Nemo

    12 February 2009 at 3:24 pm

  22. Dude! thanks a lot. This was of great help to me.

    cheers!
    ~v

    Vishwanath

    20 February 2009 at 7:06 am

  23. Saved lot of time, Thank you very much.

    krishnabajo

    27 February 2009 at 9:32 pm

  24. Thanks a lot for this tutorial Eric!

    Hamza

    1 March 2009 at 6:52 pm

  25. still not fixed.. :(
    can u pls help me out with this..

    i did everything in your blog.. did i missed something? im not new in eclipse but this kind of configuration is killing me..

    specs that im using is..

    “Eclipse Ganymede (SDK 3.4.0) with JDK 1.6.06 and Tomcat 6.0.18 (on XP/SP2)”

    In the java source / classpath selection, do i have to put all the jar files from Axis2_Codegen_Wizard_1.3.0 folder?

    im on the debug mode and the error is edu/emory/mathcs/backport/java/util/concurrent/ConcurrentHashMap i already added the backport-util-concurrent-3.1.jar inside F:\eclipse\plugins\Axis2_Codegen_Wizard_1.3.0\lib and added the library tag inside the plugin.xml

    Thanks,
    Loretah

    glam

    4 March 2009 at 8:12 am

    • Did you restart Eclipse using the –clean option after adding the jar files and updating the plugin.xml?

      Eric Tamminga

      6 March 2009 at 9:09 am

  26. This tutorial probably saved me several days of headaches.
    If there is ever going to be an ISO standard of writing online tutorials, it should be based on this one.

    THANKS!

    Jurgen

    5 March 2009 at 3:59 pm

  27. Thanks man….

    Great job…Bravo!!!!!!!

    Hats off for u….

    5@WR0S3

    1 April 2009 at 2:12 pm

  28. U really rocks. Great solution. U saved my lots of work. Thanx once again.

    Mangesh

    2 April 2009 at 8:03 am

  29. Hi Eric,

    It solved the problem, I have been googling past 1.5 hours and keep trying with all the options.

    Finally I tried yours and it works.

    Your a Super star.

    Thanks a lot lot….!
    Cheers,VIJAY

    VIJAY GADDE

    16 April 2009 at 12:52 pm

  30. Thank you so much. It works, yippppiiii

    kate

    22 April 2009 at 4:49 pm

  31. Hi Eric,

    Thanks a lot for this great stuff, I really enjoyed this helpful and detailed description. Keep up the good work.

    Martin van Gunst

    29 April 2009 at 7:51 pm

  32. sorry my previous entry seems to have cut out the xml. It should read:

    Excellent stuff – thank you.

    Here is what I did:

    1. copied the 2 jar files to C:\Program Files\eclipse\plugins\Axis2_Codegen_Wizard_1.3.0\lib

    2. added this:

    [LT]library name=”lib/backport-util-concurrent-3.1.jar”[GT]
    [LT[export name=”*”/[GT]
    [LT]/library[GT]

    where [LT] =

    to C:\Program Files\eclipse\plugins\Axis2_Codegen_Wizard_1.3.0\plugin.xml

    3. re-started Eclipse by opening a DOS window, navigating to C:\Program Files\eclipse and running the command “eclipse.exe -clean”

    Daire

    19 June 2009 at 2:45 pm

  33. Thanks man…,

    It really helped me out…

    Raper

    22 June 2009 at 11:47 am

  34. You SIMPLY ROCK

    Rajasekhar Cherukuri

    17 July 2009 at 10:52 pm

  35. Thanks Alot!!!!

    After spending a day on this problem i finally ended up on your well explained tutorial with easy language and visuals, which helped me to finally resolve this issue.

    I hope i run into your pages/blogs in the future if and when i encounter new headaches.

    Thanks again.

    Antonio

    21 July 2009 at 1:07 am

  36. Thanks a ton man u solved my one day problem …

    Sahil

    30 July 2009 at 7:20 am

  37. Thanks a lot man!!!!
    you really saved my time.

    Anu

    2 August 2009 at 10:14 pm

  38. Excellent article!! Thanks a lot…It was really helpful and saved a lot of time.

    Asi

    4 August 2009 at 12:35 pm

  39. First class solution to a very annoying problem…

    Makes you wonder what are the axis2 developers/maintainers doing when there is such a real problem in their distribution. If there were some licensing issues, at least they should document and offer a solution.

    Great bit of research – thanks

    Llies

    5 August 2009 at 9:45 pm

  40. You have saved me. I became fanatic to run the plugin without knowing the pitfalls.

    Thanks a lot. :) Great post. Please write some more.

    Shankha

    11 August 2009 at 9:54 pm

  41. Hey,

    Thank you. Great tutorial.
    I just would add, how to start eclipse with -clean.

    I think there are different ways, but I moved with my console to the eclipse directory.
    Than I wrote eclipse -clean in my console an it worked.

    Thanks for your tutorial. It helped a lot!

    Philipp

    16 August 2009 at 3:10 pm

  42. Great tut Man!! Keep it up!!

    Anonymous

    17 August 2009 at 3:11 pm

  43. It worked like a charm. Thanks a lot for saving me ;)

    EniX

    25 August 2009 at 10:58 am

  44. thanks, it helps me a lot.

    Mega

    2 September 2009 at 7:44 pm

  45. Thank you Sir. Your explanation is very well written.
    Works for me.

    Toni

    19 September 2009 at 12:54 am

  46. Excellent ! Thanks!

    Arul

    22 September 2009 at 11:10 pm

  47. You rock legend!

    For people having problems after restarting with -clean, I found a way out of that:

    1. prepare a updated directory “Axis2_Codegen_Wizard_1.3.0″ somewhere else by adding 2 jars, and updating plugin.xml and build.properties;

    2. exit eclipse, and remove the current “Axis2_Codegen_Wizard_1.3.0″ directory in eclipse/plugins;

    3. start eclipse, then exit eclipse;

    4. copy the updated directory “Axis2_Codegen_Wizard_1.3.0″ into eclipse/plugins

    5. start eclipse, do a axis2 codegen wizard.

    It works!

    Jason

    25 September 2009 at 4:34 am

  48. First of all, tons of thanks to you.After wasting a few hours,got redirected to your page and bingo !!! :)

    Not only it solves the problem but it shows the way to debug plug-in problems..that’s a great learning too…

    Again thanks a lot for this soo much helpful post !!!!

    Sandip

    27 September 2009 at 1:13 pm

  49. Thanks Eric, but Im still with problems =/

    The same problem that happen with glam happens to me… I restarted eclipse with -clean but nothing changed…
    My plugin canot find ConcurrentHashMap =/

    Can you help me? I dont know how… maybe can you share your plugin? please =)

    elias

    29 September 2009 at 9:25 pm

  50. its important say

    Im using the version 1.4.1 of plugin

    elias

    29 September 2009 at 9:26 pm

  51. Oooo! Eric! Finally it works!
    Its strange… I can generate wsdl or a java sources only in debbug mode, but is works!

    thank you!

    now I can continue my journey in the land of SOA like you! hahaha

    thankz again

    elias

    29 September 2009 at 10:03 pm

  52. Great concise tutorial on how to debug an existing plugin. Thanks.

    shahan

    1 October 2009 at 12:03 pm

  53. Just to say that it is still a great post!
    I needed this fix today – allmost one year after you published this post! Keep up the good work.

    Caveman

    5 October 2009 at 1:53 pm

  54. Eric ! u r truly genius… u saved lot of my time in this issue… and your article is very meticulously planned with each details….hats off to you….

    Gaurav Nigam

    11 October 2009 at 5:16 am

  55. After following all the steps and getting the plugin to (mostly) work, at the final stage of compiling I get the following:

    “An error occurred while completing process -java.lang.InterruptedException: Error running javac.exe compiler”

    Does anyone know where it’s looking for the compiler. Java is correctly added to my system classpath. Is the plugin looking somewhere particular?

    Dominick

    16 October 2009 at 7:54 pm

  56. Thanks a lot for the fix. I had to delete the old plug-in directory first, then restart Eclipse. Then shut down Eclipse and put in the directory with updated files and then restarted Eclipse. Didn’t know why it didn’t work if I just restarted it after the files were put in. Anyway, it’s seems okay now. :-)

    SSDudeman

    18 October 2009 at 1:58 am

  57. many many thanks!

    max

    20 October 2009 at 3:18 pm

  58. Thanks Man..it worked for me…must say very frustrating problem…

    Abhishek Khare

    21 October 2009 at 1:11 pm

  59. Hi,

    After lot of search, I found this site and was able to generate java files from the wsdl. Good job man. Thanks a lot.

    Rajesh

    9 November 2009 at 2:17 pm

  60. Thanks Mate.

    It helped me save a lot of headache. Like some other people I also have to delete the old folder and dump a new copy of the folder and then it worked like charm.

    Once again thanks a lot for saving my day.

    Sri

    3 December 2009 at 7:08 am

  61. Hey Eric,
    Great research man!!! you saved lot of man hours of effort …. your solution just worked any anythig… after 2 days of frustating effort.. ur solution came like panacea… My God do best for you!!!

    just to add, after adding the jars to lib folder, need to start eclipse from command line, eclipse -clean

    Happy Computing
    Peeyush

    Peeyush Kumar

    6 December 2009 at 9:46 pm

  62. Thanks a lot for your help… i could do proceed to the next step because of your giuded instructions… i almost lost it when this thing didnt work

    -m

    anon

    6 December 2009 at 11:34 pm

  63. Thanks a tonne Eric!

    A very well written solution for a mind bogging useless bug!

    Bonson

    9 December 2009 at 2:19 pm

  64. It looks like you are a true specialist. Did you study about the issue? lol

    ZemnHehoose

    12 December 2009 at 3:46 am

  65. Great help!!!

    emily

    29 January 2010 at 6:03 pm

  66. Too Good. Thank you very much

    Geeta

    5 February 2010 at 11:05 am

  67. Thanks a lot. It worked like a charm !

    sgusa

    4 April 2010 at 1:51 pm

  68. Thank you so much. The solution worked right away!

    crocusgirl

    7 May 2010 at 11:00 pm

  69. thank you very much!

    never forger eclipse -clean

    Franx

    3 June 2010 at 4:09 pm

  70. Thank so much, was going crazy trying to find answers. Wish you had higher google ranking.

    AltoAus

    21 June 2010 at 3:01 pm

  71. Thanks a lot.It helped me very much.keep going.. Thanks once again..

    Prasu

    9 November 2010 at 3:25 pm

  72. Too good. Thanks a lot.

    Sabbir Manandhar

    21 July 2011 at 1:24 pm

    • Hi Eric …Really fruit full and worth … u deserve tons of thanks.. thank you .. :)

      Nilesh Pandey

      24 July 2011 at 4:07 pm

  73. Excellent brother it really helped me. ha, now i am free from frustration!

    ataullah

    2 April 2012 at 2:11 am


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Follow

Get every new post delivered to your Inbox.

%d bloggers like this: