• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • Paul Clapham
  • Devaka Cooray
  • Bear Bibeault
Sheriffs:
  • Junilu Lacar
  • Knute Snortum
  • Liutauras Vilda
Saloon Keepers:
  • Ron McLeod
  • Stephan van Hulst
  • Tim Moores
  • Tim Holloway
  • Piet Souris
Bartenders:
  • salvin francis
  • Carey Brown
  • Frits Walraven

Calling a web service in a java servlet,.. servlet not finding jar files from axis

 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have created a simple website that invokes a java servlet to validate some form info such as email and phone. In the servlet I am calling several java classes that generated from WSDL url using the WSDL2Java tool that come with Axis (Am using Axis_1.4 and Tomcat 7.0.2 server).
My problem is that am getting a CLASS not found exception: javax.xml.rpc.Service when I submit the form from the website. I've tried testing the webservice on commandline (not from the website) and the web service works fine. The problem seem to be that the servlet when called externally (on form submit), doesn't have a way of finding the jaxrpc.jar file in the lib directory of axis.
Any suggestions on how I can get this working?

Thanks a lot
 
Ranch Hand
Posts: 577
Tomcat Server Notepad Java
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Jeremy,
Seems to me a usual problem. Clearly, you have jax-rpc.jar missing in your server/web application classpath. Add this jar into WEB-INF/lib directory. But, this doesn't work always if there are conflicts between server classes and application classes. For Axis1.4 you need to add following jars unless already existing in your server classpath or conflicting with other versions.
axis2.jar, jaxrpc.jar, wsdl4j-1.5.1.jar, saaj.jar and commons-discovery-0.2.jar
 
Jeremy Peterson
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks a lot Nareen.
I was missing the *.jar files in the WEB-INF/class dir of mywebapp dir. I had the *.jar files under TOMCAT_HOME/webapps/axis/WEB-INF/lib. I copied them to TOMCAT_HOME/webapps/myapp/WEB-INF/lib dir, and it now works!!

 
This. Exactly this. This is what my therapist has been talking about. And now with a tiny ad:
Java file APIs (DOC, XLS, PDF, and many more)
https://products.aspose.com/total/java
    Bookmark Topic Watch Topic
  • New Topic