views:

202

answers:

2

Hi,

I need to deploy web service on Tomcat with installed OpenEJB. I compiled simple Hello service that just prints "Hello" with JAX-WS and tried to deploy on tomcat, but got errors while deployment : ERROR - Error deploying CXF webservice for servlet helloservice.endpoint.Hello java.lang.IllegalArgumentException: Could not find servlet helloservice in web application context /helloservice

Please, help what is done wrong here. Is tomcat + openejb is sufficient for web service deployment?

Thanks.

+1  A: 

Please, help what is done wrong here. Is tomcat + openejb is sufficient for web service deployment?

A servlet/JSP engine is sufficient for web development. You don't need OpenEJB for that.

"Service" is a loaded term. Do you mean "SOAP web service"? Or "EJB stateless session bean"?

Check your web.xml. Sounds like you failed to declare a servlet named helloservice. It ought to look like this:

<servlet>
    <servlet-name>helloservlet</servlet-name>
    <servlet-class>com.your.package.HelloServlet</servlet-class>
</servlet>

<servlet-mapping>
    <servlet-name>helloservlet</servlet-name> <!-- names must match -->
    <url-pattern>*.html</url-pattern>
</servlet-mapping>
duffymo
Thanks for your answer. I used it with some changes.For web services needs to use <servlet-class>com.sun.xml.ws.transport.http.servlet.WSServlet</servlet-class>in servlet element and <url-pattern>/helloservice</url-pattern>in servlet-mapping element.Also need to add sun-jaxws.xml that contains smth like :<endpoint name='helloservice' implementation='helloservice.endpoint.Hello' url-pattern='/helloservice' />where helloservice.endpoint.Hello is an implementation of 'helloservice' web service
kostya
A: 

For others who might be looking to do web services with Tomcat/OpenEJB, here's a simple example that uses an transactional EJB web service to add/list/delete records with JPA:

https://svn.apache.org/repos/asf/openejb/tags/openejb-3.1.2/examples/webapps/moviefun/

The example also includes a Perl SOAP::Lite client that can read/write to the web service.

David Blevins