3

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.

kostya
  • 133
  • 1
  • 3
  • 9

2 Answers2

3

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
  • 19,178
  • 3
  • 53
  • 68
2

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
  • 305,152
  • 44
  • 369
  • 561
  • 1
    Thanks for your answer. I used it with some changes. For web services needs to use com.sun.xml.ws.transport.http.servlet.WSServlet in servlet element and /helloservice in servlet-mapping element. Also need to add sun-jaxws.xml that contains smth like : where helloservice.endpoint.Hello is an implementation of 'helloservice' web service – kostya Jun 22 '10 at 14:56