Web services 作为EJB和WebSphere7上的web服务访问EJB3.0
我想将EJB3.0无状态bean部署到WAS7,这样我就可以通过本地接口作为EJB访问它,也可以作为jax ws web服务访问它 我的bean如下所示:Web services 作为EJB和WebSphere7上的web服务访问EJB3.0,web-services,jakarta-ee,ejb-3.0,websphere-7,Web Services,Jakarta Ee,Ejb 3.0,Websphere 7,我想将EJB3.0无状态bean部署到WAS7,这样我就可以通过本地接口作为EJB访问它,也可以作为jax ws web服务访问它 我的bean如下所示: @Stateless @WebService public class UserManagerImpl implements UserManager { public UserManagerImpl() { } @WebMethod public String getName(){ return
@Stateless
@WebService
public class UserManagerImpl implements UserManager {
public UserManagerImpl() {
}
@WebMethod
public String getName(){
return "UserName";
}
}
问题是,如果我将其打包到EJB-JAR中并进行部署,它就不能在WAS-7上作为web服务工作
对我来说,唯一有效的配置是将EJB-JAR放入EAR中,并将此EJB-JAR放入EAR中的WAR中,如下所示:
EAR/
|--EJB-JAR
|--WAR/
|WEB-INF/lib/
|EJB-JAR
所以我的豆子是重复的
这个设计有什么问题吗?如果是,有更好的解决方案吗 如果您的应用程序包含
@WebService
带注释的EJB,那么在部署EAR之前,您需要使用WebSphere附带的endptEnabler
工具处理EAR。请注意,这不适用于Web模块中的@WebService
注释类