4

My webservice depends upon a jar (which contains a custom Exception class among others).

When I deploy simply my webservice without this jar, axis2 complains that the Exception class is not known.

So I guess that I must deploy my jar too... But I feel reluctant to put it in: tomcat\webapps\axis2\WEB-INF\lib, since it's already filled with lots of axis2 and 3rd party jars...

i'd prefer something like tomcat\webapps\axis2\WEB-INF\usr\lib

Where would you put it ?

Stephane Rolland
  • 38,876
  • 35
  • 121
  • 169

2 Answers2

4

Consider deploying your webservice and it's dependencies as a single WAR web application. Then you could put your dependency in WEB-INF/lib of your webapp.

Konstantin V. Salikhov
  • 4,554
  • 2
  • 35
  • 48
  • And how do I do that ? I have two projects, one jar and one war, how do I include the jar so as it becomes only one war ? – Stephane Rolland May 10 '12 at 12:32
  • It depends on your build system. If you build your project with Maven - simply add your jar as dependency in your pom.xml. If you are using kind of IDE like Eclipse - refer to your IDE help how to establish dependency relationship between the projects. And as an ugly solution you can just put your compiled jar into deployed WAR WEB-INF/lib folder. – Konstantin V. Salikhov May 10 '12 at 12:41
  • I'm using Eclipse, and also Ant: it should work with Ant... Why is the lattest ugly (jar in WEB-INF/lib) ? – Stephane Rolland May 10 '12 at 12:44
  • 1
    Jar in WEB-INF is not ugly itself. Ugly is placing it here with your hands instead of build system. – Konstantin V. Salikhov May 10 '12 at 12:47
  • I used the technique explained here: http://stackoverflow.com/questions/515428/clean-way-to-combine-multiple-jars-preferably-using-ant with the Ant zipgroupfileset tag. – Stephane Rolland May 10 '12 at 13:03
3

If you're deploying an Axis2 AAR, you can put the jar into a lib directory inside the AAR.

Kenster
  • 23,465
  • 21
  • 80
  • 106