Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

deploying JAX-WS webservice on tomcat 5.0 gives 404 error

 
ratna sargurp
Ranch Hand
Posts: 32
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi:

I have a simple hello world JAX-WS webservice that I am trying to deploy to Tomcat 5.0. But I get an http 404 error.

Here are the steps I tried:

1) I basically tried to repeat the steps as provided in this web site (http://www.mkyong.com/webservices/jax-ws/deploy-jax-ws-web-services-on-tomcat/)

2) I copied all the libraries from the JAX-WS lib folder into /WEB-INF/lib folder

3) I copied the mentioned jars in the website on step1., into the tomcat/shared/lib folder.

4) Generated the WAR file.

5) Copied it under /webapps on tomcat.

6) Added port 8181 on the server.xml

7) Stopped and started tomcat.

I still get the 404 error.

Any help on this is appreciated.
 
Ulf Dittmer
Rancher
Posts: 42968
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What is the exact name of the WAR file? Which URL, exactly, are you trying to access?
 
K. Gil
Ranch Hand
Posts: 75
Java Linux Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
as far as I can see, with step (5) from documentation you linked, you have to put these dependiences (libs) to your tomcat's lib directory, not as you mentioned:
> 2) I copied all the libraries from the JAX-WS lib folder into /WEB-INF/lib folder
As that's global libraries that have to be available and deployed before tomcat will try to start your application, so WEB-INF/lib is way too late for these.
and that's probably why you're getting 404 for this app, application simply can't be started due to missing dependiences.
 
ratna sargurp
Ranch Hand
Posts: 32
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you for your replies. I did copy the jar files into the tomcat/common/lib folder. It did not help.
 
Ulf Dittmer
Rancher
Posts: 42968
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
So what are the answers to the questions I asked? And another question: Are there any error messages in the Tomcat log files?
 
Tim Holloway
Saloon Keeper
Pie
Posts: 18277
56
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
One thing that is not going to help is that Tomcat 5.0 is extremely old and no longer supported. If you are trying to mix a recent copy of JAX-WS with Tomcat 5, I cannot predict what the results would be.
 
ratna sargurp
Ranch Hand
Posts: 32
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The WAR file is called JAXWS-Tmcat-HelloWorld.WAR.

The error message from the log files is:

2013-01-23 09:40:22 StandardContext[/JAXWS-Tmcat-HelloWorld]Error configuring application listener of class com.sun.xml.ws.transport.http.servlet.WSServletContextListener
java.lang.UnsupportedClassVersionError: com/sun/xml/ws/transport/http/servlet/WSServletContextListener (Unsupported major.minor version 50.0)

I have included the jar files from JAX-WS version 2.2 lib folder in the /WEB-INF/lib folder.

Is Tomcat 6 better or 7 to run with JAX-WS? Also, I read somewhere that JAX-WS 2.2 is buggy. I know this question is not relevant in this forum, but if whic version of JAX-WS is better to download?
 
K. Gil
Ranch Hand
Posts: 75
Java Linux Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
> (Unsupported major.minor version 50.0)

Here you go. incompatible java version.
Probably everything was compiled with 1.7
I would suggest to try Tomcat 7 with JDK 1.7

and as mentioned before, Tomcat 5.0 is pretty old, not supported since a long, long time. There's absolutely no reason to use 5.0 in first place, 5.5 is pretty much 100% compatible but brings a lot of improvements. 5.5 is still old anyway. If you don't have any specific requirements to use old version of tomcat, then you should definitely go with 7.0

 
Ulf Dittmer
Rancher
Posts: 42968
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
> (Unsupported major.minor version 50.0)

Probably everything was compiled with 1.7


Version 50.0 is what's used by Java 6. It sounds if you're using a Java 5 JRE to run this - start by upgrading to Java 6 (at least), Java 5 is way obsolete.

Also, I read somewhere that JAX-WS 2.2 is buggy. I know this question is not relevant in this forum, but if whic version of JAX-WS is better to download?

Unless that is from a very substantive source, I would dismiss that as hearsay. JAX-WS is stable; just download the latest version and you should be fine.
 
ratna sargurp
Ranch Hand
Posts: 32
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I installed Tomcat 7 and it worked beautifully!

Thanks everyone for all your help!
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic