aspose file tools*
The moose likes Web Services and the fly likes Apache Tomcat Axis and the web.xml Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Web Services
Bookmark "Apache Tomcat Axis and the web.xml" Watch "Apache Tomcat Axis and the web.xml" New topic
Author

Apache Tomcat Axis and the web.xml

Dan Kempten
Greenhorn

Joined: Dec 26, 2008
Posts: 25
I've put Axis 1.4 under Tomcat 6.0.18 and it does almost everything
as described.

However, I can compile and deploy the calculator.jws app only because it imports no classes. Another app EchoHeaders.jws cannot be compiled and deployed because the class javax.servlet.http.HttpServletRequest cannot be found.

One observation : the web.xml file in D:\Tomcat\webapps\axis\WEB-INF has :

<?xml version="1.0" encoding="ISO-8859-1"?>

<!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web
Application 2.3//EN" "http://java.sun.com/dtd/web-app_2_3.dtd">

<web-app>
<display-name>Apache-Axis</display-name>

<listener>
<listener-class>org.apache.axis.transport.http.AxisHTTPSessionListener</listener-class>
</listener>

etc.

etc.

Then starting Tomcat shows a "can't find class" error :
..
INFO: Starting Servlet Engine: Apache Tomcat/6.0.18
- Unable to find config file. Creating new servlet engine config file: /WEB-INF/server-config.wsdd
- Unable to find required classes (javax.activation.DataHandler and javax.mail.internet.MimeMultipart).

Attachment support is disabled.
27.12.2008 19:58:24 org.apache.coyote.http11.Http11Protocol start
..
..

But (!!!) when I reduce the axis web.xml to this :

<?xml version="1.0" encoding="ISO-8859-1"?>

<!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web
Application 2.3//EN" "http://java.sun.com/dtd/web-app_2_3.dtd">

<web-app>
</web-app>

Then Tomcat starts without a hitch :
..
INFO: Starting Servlet Engine: Apache Tomcat/6.0.18
27.12.2008 18:45:08 org.apache.coyote.http11.Http11Protocoll start
..
..
I've got Java 1.6 and the env vari classpath also points to j2ee.jar.

are axis and Tomcat stepping on each other's toes?

must server.xml in Tomcat be modified to take axis into account?

What am I doing wrong?
Dan Kempten
Greenhorn

Joined: Dec 26, 2008
Posts: 25
There are a few secrets I found in the last 12 hours.

One may define AXISCLASSPATH as all the D:\Tomcat\webapps\axis\lib jars, one after the other. An even better tactic is to effectively do :

set CLASSPATH = %CLASSPATH%;%AXISCLASSPATH%

then running java or javac in a cmd.exe box doesn't
require -cp %AXISCLASSPATH% each time.

The warning about two classes not being found, appearing in the start of Tomcat can be ignored when running java or javac while compiling and deploying web services.

To do away with the warning completely I found that one needs activation.jar and mail.jar in %CATALINA_HOME%\webapps\axis\lib and also !! %CATALINA_HOME%\webapps\axis\WEB-INF\lib. Both folders !!!

Both jars can be found in the j2ee SDK, known as Glassfish I believe.

After a check of the env varis and a complete restart of the windows system all the problems described above went away.
 
 
subject: Apache Tomcat Axis and the web.xml