File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Web Services and the fly likes how to install a standalone axis on jboss 4.0 (failed to compile .jws) Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Web Services
Bookmark "how to install a standalone axis on jboss 4.0 (failed to compile .jws)" Watch "how to install a standalone axis on jboss 4.0 (failed to compile .jws)" New topic
Author

how to install a standalone axis on jboss 4.0 (failed to compile .jws)

sam joe
Greenhorn

Joined: Jul 23, 2003
Posts: 24
I tried to install a standalone axis on jboss 4.0. I copied 'axis' folder to jboss 'deploy' folder, rename from 'axis' to 'axis.war'. Create a new file jboss-web.xml and add a context root '/axis'. Now, start the jboss server, I can view happyaxis.jsp. Everything looks fine except when I try to visit EchoHeaders.jws. The axis failed to compile by not finding javax.servlet.http.HttpServletRequest. If I copied $JBOSS_HOME/server/all/lib/javax.servlet.jar to axis.war/WEB-INF/lib. Everything works. But I don't want my web services depend on jboss and that's not the right way to do it. Is there anyway that I can config to let axis know the classpath to that jar in jboss?

<pre>

<soapenv:Envelope>

<soapenv:Body>

<soapenv:Fault>
<faultcode>ns1:Server.compileError</faultcode>

<faultstring>
Error while compiling: D:\server\jboss-4.0.2\server\default\.\deploy\axis.sar\axis.war\WEB-INF\jwsClasses\EchoHeaders.java
</faultstring>

<detail>

<Errors>
Error compiling D:\server\jboss-4.0.2\server\default\.\deploy\axis.sar\axis.war\WEB-INF\jwsClasses\EchoHeaders.java:
Line 0, column 0: could not parse error message: Note: sun.tools.javac.Main has been deprecated.
D:\server\jboss-4.0.2\server\default\.\deploy\axis.sar\axis.war\WEB-INF\jwsClasses\EchoHeaders.java:21: Class javax.servlet.http.HttpServletRequest not found in import.
import javax.servlet.http.HttpServletRequest;
</Errors>
</detail>
</soapenv:Fault>
</soapenv:Body>
</soapenv:Envelope>

</pre>

Thanks a lot!
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 42919
    
  68
This sounds odd. Axis (like any web app) needs to have access to the servlet API interfaces, because it uses those classes internally. So adding the jar file to the Axis lib directory shouldn't make a difference. JBoss may be different, but, e.g., with Tomcat it's not necessary to add the API jar.
sam joe
Greenhorn

Joined: Jul 23, 2003
Posts: 24
You are right. Drop axis into Tomcat, everything just works.

The only explaination is that the standalone axis runtime classpath in jboss and the classpath picked by axis classloader to compile .jws are different.
Patrick Bernardina
Greenhorn

Joined: Jul 18, 2005
Posts: 7
I have the same problem.

any solution?
Mark Kempster
Greenhorn

Joined: Aug 29, 2006
Posts: 2
I attempted this same task today by removing jboss-4.0.4's jbossws14.sar and
adding axis.war as described on the axis install guide

http://ws.apache.org/axis/java/install.html

The missing piece to getting the EchoHeaders.jws test script (and its dependence
on javax.servlet.http.HttpServletRequest was this text from the axis install guide:

http://ws.apache.org/axis/java/install.html#Tomcat4.xAndJava1.4


"Java 1.4 changed the rules as to how packages beginning in java.* and javax.* get loaded. Specifically, they only get loaded from endorsed directories."




The instructions talk about jaxrpc.jar and saaj.jar, but the same seems to
apply to javax.servlet.jar. Various instructions for copying that jar into
jbossweb-tomcat55.sar/ or listing it in JBOSS_CLASSPATH didn't seem to work.
I was able to get it working by copying javax.servlet.jar into JBOSS_HOME/lib/endorsed/, and noticed an entry in boot.log that it was picked up. Alternately, I imagine you could muck with the JBOSS_ENDORSED_DIRS
variable in run.sh/run.conf.
sunny theonly
Greenhorn

Joined: Apr 24, 2008
Posts: 1
Hi Mark
Thanks so much for posting that it really helped me out.
Sunny
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: how to install a standalone axis on jboss 4.0 (failed to compile .jws)