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 WEB-INF/ WEB-INF/classes/ WEB-INF/classes/news/ WEB-INF/classes/news/jaxws/ WEB-INF/classes/news/jaxws/GetLatestHeadline.class WEB-INF/classes/news/jaxws/GetLatestHeadlineResponse.class WEB-INF/classes/news/NewsFeed.class WEB-INF/lib/ wsdl/ wsdl/NewsFeedService_schema1.xsd wsdl/NewsFeedService.wsdl
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.
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?