U
unixhack.blogspot.com
Hi,
I'm trying to develop an application that uses SOAP and servlets.
So far I have some servlets and JSP's running fine. They access
the database, modify it, display data, etc.
I want to add some SOAP functionality to the application using
Apache SOAP, but so far I haven't had much luck. I am following
the Apache SOAP docs and the Tomcat/SOAP instructions at:
http://www.onjava.com/pub/a/onjava/2002/02/27/tomcat.html
So far I have modified catalina.sh to
- add xercesImpl.jar at the beginning of the CLASSPATH
- add the path to my soap classes at the end of the CLASSPATH
This works, and I am able to deploy the sample SOAP service
from the OnJava example using the ServiceManagerClient class.
This would be fine if I didn't had to access the classes I
already wrote. Which is not the case.
So, I add the directory where my classes live at the end of
the CLASSPATH in catalina.sh. This directory look something like:
$CLASSPATH:$CATALINA_HOME/webapps/myapp/WEB-INF/classes
This allows the SOAP service to access public methods provided
by my application. However, if I now try to access my application
via the usual URL (http://my.host.com:8080/myapp), I get a 404
error!
The Tomcat log shows a somewhat cryptic stack trace:
Oct 26, 2004 6:35:58 PM org.apache.catalina.startup.HostConfig deployDirectories
SEVERE: Error deploying web application directory myapp
java.lang.NoClassDefFoundError: javax/servlet/http/HttpServlet
at java.lang.ClassLoader.defineClass0(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:539)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:12
3)
at java.net.URLClassLoader.defineClass(URLClassLoader.java:251)
at java.net.URLClassLoader.access$100(URLClassLoader.java:55)
at java.net.URLClassLoader$1.run(URLClassLoader.java:194)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:187)
at java.lang.ClassLoader.loadClass(ClassLoader.java:289)
.... and so on and so forth, without any reference to any of the
classes I actually wrote. BTW this
At this point, I'm completely stumped. Any idea of how to get
SOAP and servlets to live together?
Should I ditch the whole ServiceManagerClient/ RPC router
thing and just chisel the SOAP functionality into my classes?
If this is not the best forum to ask this type of questions, could
you please recommend some other place to go?
Thanks a lot if you read this far, and thanks in advance for any help,
Ernesto
I'm trying to develop an application that uses SOAP and servlets.
So far I have some servlets and JSP's running fine. They access
the database, modify it, display data, etc.
I want to add some SOAP functionality to the application using
Apache SOAP, but so far I haven't had much luck. I am following
the Apache SOAP docs and the Tomcat/SOAP instructions at:
http://www.onjava.com/pub/a/onjava/2002/02/27/tomcat.html
So far I have modified catalina.sh to
- add xercesImpl.jar at the beginning of the CLASSPATH
- add the path to my soap classes at the end of the CLASSPATH
This works, and I am able to deploy the sample SOAP service
from the OnJava example using the ServiceManagerClient class.
This would be fine if I didn't had to access the classes I
already wrote. Which is not the case.
So, I add the directory where my classes live at the end of
the CLASSPATH in catalina.sh. This directory look something like:
$CLASSPATH:$CATALINA_HOME/webapps/myapp/WEB-INF/classes
This allows the SOAP service to access public methods provided
by my application. However, if I now try to access my application
via the usual URL (http://my.host.com:8080/myapp), I get a 404
error!
The Tomcat log shows a somewhat cryptic stack trace:
Oct 26, 2004 6:35:58 PM org.apache.catalina.startup.HostConfig deployDirectories
SEVERE: Error deploying web application directory myapp
java.lang.NoClassDefFoundError: javax/servlet/http/HttpServlet
at java.lang.ClassLoader.defineClass0(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:539)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:12
3)
at java.net.URLClassLoader.defineClass(URLClassLoader.java:251)
at java.net.URLClassLoader.access$100(URLClassLoader.java:55)
at java.net.URLClassLoader$1.run(URLClassLoader.java:194)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:187)
at java.lang.ClassLoader.loadClass(ClassLoader.java:289)
.... and so on and so forth, without any reference to any of the
classes I actually wrote. BTW this
At this point, I'm completely stumped. Any idea of how to get
SOAP and servlets to live together?
Should I ditch the whole ServiceManagerClient/ RPC router
thing and just chisel the SOAP functionality into my classes?
If this is not the best forum to ask this type of questions, could
you please recommend some other place to go?
Thanks a lot if you read this far, and thanks in advance for any help,
Ernesto