• Post Reply Bookmark Topic Watch Topic
  • New Topic

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

 
Jeremy Peterson
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
 
Naren Chivukula
Ranch Hand
Posts: 577
Java Notepad Tomcat Server
  • 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!!

 
What are you doing? You are supposed to be reading this tiny ad!
the new thread boost feature brings a LOT of attention to your favorite threads
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!