Re: SOAP and servlets living together?
From: Bryan Castillo (rook_5150_at_yahoo.com)
Date: 10/28/04
- Next message: Bryan Castillo: "Re: Character encoding between Win and *nix"
- Previous message: George W. Cherry: "Re: Java Textbook and Instructor's Kit for Highschool"
- In reply to: unixhack.blogspot.com: "SOAP and servlets living together?"
- Next in thread: unixhack.blogspot.com: "Re: SOAP and servlets living together?"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: 27 Oct 2004 21:14:40 -0700
unix.hack@gmail.com (unixhack.blogspot.com) wrote in message news:<7d46b4f8.0410262129.400f2ae6@posting.google.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:
>
I don't think that Apache SOAP has been updated for quite awhile and I
would reccomend you use Apache Axis. http://ws.apache.org/axis/
I was able to get Axis to work inside of a web app. It comes with a
web application, however you do need to download the JAF jar from sun
and put it into the webapps WEB-INF/lib directory. Once you get that
working its pretty easy to merge the stuff in the Axis WEB-INF/web.xml
into your own webapps web.xml. You have to copy the libs of course
and I think there is a file wsdd.config? (if you have already deployed
some services to the web-app)
For simple stuff services in Axis, check out the jws deployment (its
very cool).
> 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
- Next message: Bryan Castillo: "Re: Character encoding between Win and *nix"
- Previous message: George W. Cherry: "Re: Java Textbook and Instructor's Kit for Highschool"
- In reply to: unixhack.blogspot.com: "SOAP and servlets living together?"
- Next in thread: unixhack.blogspot.com: "Re: SOAP and servlets living together?"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|