Forums Register Login

JAX-WS and Servlet2.4 web.xml

+Pie Number of slices to send: Send
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.

<?xml version="1.0" encoding="UTF-8"?>
<web-app id="WebApp_ID" version="2.4" xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">

</web-app>

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
www.devguli.com
[ January 21, 2008: Message edited by: chatchai chailuecha ]
Where does a nanny get ground to air missles? Protect this tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com


reply
reply
This thread has been viewed 1426 times.
Similar Threads
web.xml mandatory tags
doubt in EL
Cannot find endpoint meta data for
scripting-invalid question
cannot find the declaration of element taglib
More...

All times above are in ranch (not your local) time.
The current ranch time is
Mar 19, 2024 05:39:32.