tomcat/axis not compiling jws java class

Atheus

Diamond Member
Jun 7, 2005
7,313
2
0
This is not really programming as such, but I thought this was the best place for it...

Basically I have tomcat 6 and axis installed on the server, and happyaxis.jsp validates the install properly, but whenever I try to access a jws web service it spits out the java code rather than compiling and executing - as if it was just a text file served over apache.

Apparently a jws is just java class. This is from the install guide:

Axis' JWS Web Services are java files you save into the Axis webapp anywhere but the WEB-INF tree, giving them the .jws extension. When someone requests the .jws file by giving its URL, it is compiled and executed.

There appears to be a jws servlet mapping the WEB-INF/web.xml so I'm not sure what could be wrong...

Any ideas?
 

Onund

Senior member
Jul 19, 2007
287
0
0
it sounds like your server isn't setup to handle the jws extension properly. Maybe a mim type error? Assuming you're running linux, is the jws associated properly in the /etc/mime.types file? (nore sure if that is standard....)

I'm just guessing, I don't know for sure how things work.
 

Atheus

Diamond Member
Jun 7, 2005
7,313
2
0
Originally posted by: Onund
I'm just guessing, I don't know for sure how things work.

Same here unfortunately...

I looked at /etc/mime.types and I noticed jws is not there, but neither is jsp, so that can't be the problem.
 

Onund

Senior member
Jul 19, 2007
287
0
0
Originally posted by: Atheus
Originally posted by: Onund
I'm just guessing, I don't know for sure how things work.

Same here unfortunately...

I looked at /etc/mime.types and I noticed jws is not there, but neither is jsp, so that can't be the problem.

It sounds like an apache problem to me. Apache doesn't know that the .jws files should be handled by a special application so it just sees it as a text file (my guess)

You might want to try asking around apache support sites or possible the *nix forum?

But if I were in your situation, having just looked up how the /etc/apache2/mods-enabled/php... stuff looks, I'd try doing something similar to that but make .jws be run by whatever that app you just loaded is.
 

Atheus

Diamond Member
Jun 7, 2005
7,313
2
0
Originally posted by: MrChad
Can you post your web.xml?

It's the web.xml from the axis tarball:


<?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>

<servlet>
<servlet-name>AxisServlet</servlet-name>
<display-name>Apache-Axis Servlet</display-name>
<servlet-class>
org.apache.axis.transport.http.AxisServlet
</servlet-class>
</servlet>

<servlet>
<servlet-name>AdminServlet</servlet-name>
<display-name>Axis Admin Servlet</display-name>
<servlet-class>
org.apache.axis.transport.http.AdminServlet
</servlet-class>
<load-on-startup>100</load-on-startup>
</servlet>

<servlet>
<servlet-name>SOAPMonitorService</servlet-name>
<display-name>SOAPMonitorService</display-name>
<servlet-class>
org.apache.axis.monitor.SOAPMonitorService
</servlet-class>
<init-param>
<param-name>SOAPMonitorPort</param-name>
<param-value>5001</param-value>
</init-param>
<load-on-startup>100</load-on-startup>
</servlet>

<servlet-mapping>
<servlet-name>AxisServlet</servlet-name>
<url-pattern>/servlet/AxisServlet</url-pattern>
</servlet-mapping>

<servlet-mapping>
<servlet-name>AxisServlet</servlet-name>
<url-pattern>*.jws</url-pattern>
</servlet-mapping>

<servlet-mapping>
<servlet-name>AxisServlet</servlet-name>
<url-pattern>/services/*</url-pattern>
</servlet-mapping>

<servlet-mapping>
<servlet-name>SOAPMonitorService</servlet-name>
<url-pattern>/SOAPMonitor</url-pattern>
</servlet-mapping>

<!-- uncomment this if you want the admin servlet -->
<!--
<servlet-mapping>
<servlet-name>AdminServlet</servlet-name>
<url-pattern>/servlet/AdminServlet</url-pattern>
</servlet-mapping>
-->

<session-config>
<!-- Default to 5 minute session timeouts -->
<session-timeout>5</session-timeout>
</session-config>

<!-- currently the W3C havent settled on a media type for WSDL;
http://www.w3.org/TR/2003/WD-w...2-20030303/#ietf-draft
for now we go with the basic 'it's XML' response -->
<mime-mapping>
<extension>wsdl</extension>
<mime-type>text/xml</mime-type>
</mime-mapping>


<mime-mapping>
<extension>xsd</extension>
<mime-type>text/xml</mime-type>
</mime-mapping>

<welcome-file-list id="WelcomeFileList">
<welcome-file>index.jsp</welcome-file>
<welcome-file>index.html</welcome-file>
<welcome-file>index.jws</welcome-file>
</welcome-file-list>

</web-app>
 

ahurtt

Diamond Member
Feb 1, 2001
4,283
0
0
I have seen some documentation that suggests you have to put the .jws file under the correct axis directory for it to work, not just any place other than the WEB-INF tree.