Win a copy of Java EE 8 High Performance this week in the Java/Jakarta EE forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

JAX-WS and Servlet2.4 web.xml  RSS feed

Posts: 18
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi everybody,
I am trying to find a way to create a JAX-WS package which is portable over JavaEE container. I have created a simple webservice starting from java source below.

I used wsgen(in JDK6)to generate all ws artifacts and my final war package looks like this

There was no web.xml, no webservices.xml or any server specific deployment descriptor. It should be auto-generated from the annotation in NewsFeed class

I deployed the package just like a normal java web application and Sun Java System Application Server 9.1 nicely detected the annotation and report that I had a NewsFeed web application and NewsFeed webservices in my system (It presented on web console).

My problem is that when I add a web.xml to the package and deployed it.

<?xml version="1.0" encoding="UTF-8"?>
<web-app id="WebApp_ID" version="2.4" xmlns="" xmlns:xsi="" xsi:schemaLocation="">


SJS9.1 couldn't detect the annotation; I got only the NewsFeed web application but no web services. I can resolved it by changing the web.xml to use servlet2.5 declaration.

My guess is that servlet annotation(e.g injecting resource to servlet) has been introduced in servlet2.5 so when the container found a web.xml with servlet2.4 declaration somehow it didn't bother to scan for any annotated class. The side effect is that the @WebService hasn't been detected.

I have tried the package with servlet2.4 web.xml with websphere and it worked just fine so I am not sure this is the implementation problem in Sun application server or not.

Are there any part in JAX-WS, JSR181, JSR109 specification or any document state something about how a Java EE container should discover the webservices annotation?

Thanks very much

Chatchai Chailuecha
[ January 21, 2008: Message edited by: chatchai chailuecha ]
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!