问题描述
报错:javax.naming.NamingException:[beanName=/EmployeeServiceImpl/][ENCJNDIName=java:comp/env/com.sys.action.privilege.EmployeeAction/employeeService][defaultJNDIName=/EmployeeService/null]没有找到对应资源。cn.agrael.struts.plugin.ejb3.AbstractApplicationServer.lookup(AbstractApplicationServer.java:107)cn.agrael.struts.plugin.ejb3.AbstractApplicationServer.fieldEJBAnnotationLookup(AbstractApplicationServer.java:30)cn.agrael.struts.plugin.ejb3.StrutsEJBUtils.fieldInject(StrutsEJBUtils.java:367)cn.agrael.struts.plugin.ejb3.StrutsEJBUtils.executeEJBInjectAnnotation(StrutsEJBUtils.java:270)cn.agrael.struts.plugin.ejb3.StrutsEJBActionProxyFactory.createActionProxy(StrutsEJBActionProxyFactory.java:25)com.opensymphony.xwork2.DefaultActionProxyFactory.createActionProxy(DefaultActionProxyFactory.java:58)org.apache.struts2.dispatcher.Dispatcher.serviceAction(Dispatcher.java:500)org.apache.struts2.dispatcher.ng.ExecuteOperations.executeAction(ExecuteOperations.java:77)org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter.doFilter(StrutsPrepareAndExecuteFilter.java:91)com.sys.filter.LoginFilter.doFilter(LoginFilter.java:39)org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
//Struts需要注入相应的service结果报错了@Remote@StatefulpublicclassEmployeeActionextendsBaseAction<Employee>{@EJB(beanName="EmployeeServiceImpl")privateEmployeeServiceemployeeService;}
@Remote@StatelesspublicclassEmployeeServiceImplextendsDaoSupport<Employee>implementsEmployeeService{}
有谁知道是怎么回事吗,看错误应该是查找不到对应的类,不知道哪里配置有问题,还望高手指教,小弟先谢谢了!
解决方案
解决方案二:
希望能帮到你
解决方案三:
貌似很复杂,学习了
解决方案四:
@Remote@Stateless(mappdName="service.EmployeeService")publicclassEmployeeServiceImplextendsDaoSupport<Employee>implementsEmployeeService{}@Remote@StatefulpublicclassEmployeeActionextendsBaseAction<Employee>{@Resource(mappdName="service.EmployeeService")privateEmployeeServiceemployeeService;}