简体   繁体   English

使用OpenEJB在Tomcat上部署Web服务

[英]Deploy web service on Tomcat with OpenEJB

I need to deploy web service on Tomcat with installed OpenEJB. 我需要在安装了OpenEJB的Tomcat上部署Web服务。 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 我编译了简单的Hello服务,它只是用JAX-WS打印“Hello”并尝试在tomcat上部署,但在部署时遇到错误:ERROR - 为servlet部署CXF webservice时出错helloservice.endpoint.Hello java.lang.IllegalArgumentException:找不到web应用程序上下文中的servlet helloservice / helloservice

Please, help what is done wrong here. 请帮助这里做错了。 Is tomcat + openejb is sufficient for web service deployment? tomcat + openejb是否足以进行Web服务部署?

Thanks. 谢谢。

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: 对于可能希望使用Tomcat / OpenEJB进行Web服务的其他人,这是一个使用事务EJB Web服务来添加/列出/删除JPA记录的简单示例:

https://svn.apache.org/repos/asf/openejb/tags/openejb-3.1.2/examples/webapps/moviefun/ 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. 该示例还包括可以读取/写入Web服务的Perl SOAP :: Lite客户端。

Please, help what is done wrong here. 请帮助这里做错了。 Is tomcat + openejb is sufficient for web service deployment? tomcat + openejb是否足以进行Web服务部署?

A servlet/JSP engine is sufficient for web development. servlet / JSP引擎足以进行Web开发。 You don't need OpenEJB for that. 你不需要OpenEJB。

"Service" is a loaded term. “服务”是一个加载的术语。 Do you mean "SOAP web service"? 你的意思是“SOAP网络服务”? Or "EJB stateless session bean"? 还是“EJB无状态会话bean”?

Check your web.xml. 检查您的web.xml。 Sounds like you failed to declare a servlet named helloservice. 听起来你没有声明一个名为helloservice的servlet。 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>

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM