Java Mailing List Archive

http://www.junlu.com/

Google
Google
Mailing List
Home
Forum Home
JBoss - Java Application Server
Struts - A MVC web framework
Tomcat - JSP/Servlet container
iText - An open source PDF Java Library
JDOM - JDOM XML Parser
J2EE - A mailing list for Java(tm) 2 Platform, Enterprise Edition
J2EE Pattern - An interest list for Sun Java Center J2EE Pattern Catalog
Servlet - A mailing list for discussion about Sun Microsystem's Java Servlet API Technology
JSP - A mailing list about Java Server Pages specification and reference
Struts & Hibernate
Subjects
JSP editor plugin for eclipse ?
org apache jasper JasperException: Unable to compile class for JSP
Tomcat: Connection reset by peer: socket write error
Cannot retrieve definition for form bean null
Struts Tiles Tutorial (free Struts training)
Where do I download Tomcat 4 0 6?
Data Access Object (DAO) pattern, example DAO 's
Where to download Tomcat v 4 1 24 from?
Tomcat 5 0 16 Requested resource not available
Oracle Connection Pooling in 3 2 2
Servlet : Session invalidate
Servlet action is currently unavailable
Tomcat/Struts Unicode Encoding/Decoding problems
Tomcat and webapplication specific java library path
Running a Simple JMS Example
Mapping in workers2 properties
org apache jasper JasperException
Cannot find message resources under key org apache struts action
   MESSAGE
problem with html:text bean throwing exception
Cannot find message resources under key org apache struts action MESSAGE
invalid direct reference problem with solution
Tool for jsp debug Try Sysdeo Eclipse Plugin
Tomcat 5 Cannot load JDBC driver class 'null ' SQL state: null
weblogic ejbc
java properties file
Jboss 3 2 3 Coyote Can 't re
Tomcat 5, Apache2 and mod jk2 integration problem
JBoss example problem new to J2EE
url string for connecting jboss to oracle
Value attribute of <html:checkbox
javax servlet ServletException: BeanUtils populate
HTTP Status 404 The requested resource is not available
5 0 18: Windows XP Pro vs Windows 2000
 
Apache SOAP Messaging Error (org.apache.soap.Envelope)

Apache SOAP Messaging Error (org.apache.soap.Envelope)

2003-12-09       - By Clive Jordan

 Back
Reply:     1     2     3     4  

Hello,

I am having a lot of difficulty getting apache SOAP messaging to work
properly. It does not seem to be  able to find  org.soap.apache.Envelope
for some reason.

Sorry for  the  large amount of spam but I thought I'd  put down as much
info as possible.

My environment is:
Windows 2000
jsdk 1.4.1_01
Tomcat 4.1.29
SOAP 2.3.1
Xerces 1.4.4

Backgroud:
I have been through the archives and seen there are problems with
classloaders in the past and I have tried the following:

Clean install of Tomcat 4.1.29
put soap.war in webapps and restart.
the .war file is unpacked ok.

I have looked through these
http://nagoya.apache.org/eyebrowse/ReadMsg?listName=tomcat-dev@(protected)
.org&msgNo=32379


and tried the following:
- removed xerces2 files from distribution and put Xerces 1.4.4
xerces.jar in $CATALINA_HOME/common/lib
- remove soap.war from webapps
- removed org directory from webapps/soap/WEB-INF/classes
- put soap.jar into $CATALINA_HOME/common/lib

My command-line classpath (for client use):
c:\bin\Tomcat4.1\common\lib\xerces.jar;c:\bin\j2sdk1.4.1_01;c:\bin\Tomcat4.1
\common\lib\servlet.jar;c:\bin\Tomcat4.1\common\lib\soap.jar;c:\bin\Tomcat4.1
\common\lib\mail.jar;c:\bin\Tomcat4.1\common\lib\activation.jar;.

As you can see, all the appropriate classes are in the tomcat tree.

Here is my processing class, TstSoap.java:
import java.io.*;
import org.apache.soap.*;
import org.apache.soap.rpc.SOAPContext;
import javax.mail.MessagingException Source code of javax.mail.MessagingException;

public class TstSoap
{
   public void tstMethod (Envelope env, SOAPContext reqCtx, SOAPContext
resCtx)
                           throws MessagingException, IOException
   {
       resCtx.setRootPart("OK it works.", "text/xml");
   }
}

Here is the Deployment Descriptor, DeploymentDescriptor.xml:
<isd:service xmlns:isd="http://xml.apache.org/xml-soap/deployment"
            id="urn:soaptest" type="message">
 <isd:provider type="java"
               scope="Application"
               methods="tstMethod">
   <isd:java class="TstSoap" static="false"/>
 </isd:provider>

<isd:faultListener>org.apache.soap.server.DOMFaultListener</isd:faultListener>
</isd:service>

And finally, here is the SOAP message that is sent:
<SOAP-ENV:Envelope
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
   SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
   <SOAP-ENV:Body>
       <tstMethod xmlns="urn:soaptest" >
       </tstMethod>
   </SOAP-ENV:Body>
</SOAP-ENV:Envelope>

All  three of the above are in the directory
c:/bin/cygwin/home/clive/src/woko on my computer.

-Within catalina.sh, I have added this to the classpath of the server:
CLASSPATH="$CLASSPATH":"$CATALINA_HOME"../../cygwin/home/clive/src/woko

Then I start the server:
startup.sh

Next I register the DeploymentDescriptor from the woko directory:
java org.apache.soap.server.ServiceManagerClient
http://localhost:8080/soap/servlet/rpcrouter deploy
DeploymentDescriptor.xml

This seems to work ok as I can then see if it is registered with tomcat:
java org.apache.soap.server.ServiceManagerClient
http://localhost:8080/soap/servlet/rpcrouter list

gives:
Deployed Services:
       urn:soaptest

Now I send the xml message to the messagerouter (where msg1.xml is the
aml message above):
java SOAPClient4XG http://localhost:8080/soap/servlet/messagerouter msg1.xml

And (finally), this is what I get back:
java.io.IOException Source code of java.io.IOException: Server returned HTTP response code: 500 for URL:
http://localhost:8080/soap/servlet/messagerouter
       at
sun.net.www.protocol.http.HttpURLConnection.getInputStream(Unknown Source)
       at SOAPClient4XG.main(SOAPClient4XG.java:72)
Exception in thread "main"

Not that useful :-(
If instead I start the apache TunnelGui on port 4040, and try again,
this is what I get. (Note the line I have changed to bold)
HTTP/1.1 500 Internal Server Error
Set-Cookie: JSESSIONID=84720BCEC2C28DD4AEDF25B02B4B3207; Path=/soap
Content-Type: text/xml;charset=utf-8 (See http://utf-8.ora-code.com)
Content-Length: 4066
Date: Tue, 09 Dec 2003 17:05:15 GMT
Server: Apache-Coyote/1.1
Connection: close

<?xml version='1.0' encoding='UTF-8 (See http://UTF-8.ora-code.com)'?>
<SOAP-ENV:Envelope
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<SOAP-ENV:Body>
<SOAP-ENV:Fault>
<faultcode>SOAP-ENV:Server</faultcode>
<faultstring>Exception while handling service request:
org/apache/soap/Envelope</faultstring>
<faultactor>/soap/servlet/messagerouter</faultactor>
<detail>
<stackTrace>java.lang.NoClassDefFoundError Source code of java.lang.NoClassDefFoundError: org/apache/soap/Envelope
   at java.lang.Class Source code of java.lang.Class(Native Method)
.... lots of java errors......


So why can't the system find this:
java.lang.NoClassDefFoundError Source code of java.lang.NoClassDefFoundError: org/apache/soap/Envelope

Poking into the soap.jar library in common/lib and it is there ok.
*Please*, does anyone know what I am doing wrong here, I really am
rather stumped :-(

If I explicitly put soap.jar on the server classpath, I cannot deploy
servlets and get web pages returned rather than XML and the parser does
not like that (I won't put this in the email as I'm sure I've used
enough space already).

So, does anyone know if (1) I am being stupid or (2) is there a fault or
issue/workaround I should know about.

Would really appreciate some help with this.

Thanks,
Clive


-- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ------
To unsubscribe, e-mail: tomcat-user-unsubscribe@(protected)
For additional commands, e-mail: tomcat-user-help@(protected)




©2008 junlu.com - Jax Systems, LLC, U.S.A.