EJB プロジェクトを開発し、それを jar ファイルにパッケージ化してから、Struts 2.1.15.2 で Web プロジェクトを作成し、jar ファイルをWebRoot/WEB-INF/lib
ディレクトリに配置しました。統合して使おstruts2-ejb3-plugin
うと思っているのですが、executeメソッドを呼び出すとAction
、こんなStrutsの問題報告が出てきました。
スタックトレース:
javax.ejb.EJBException: javax.naming.NamingException: [ENCJNDIName = java:comp/env/edu.sdau.tobacco.action.common.LoginAction/userDAORemote][defaultJNDIName = /UserDAORemote/remote]?????????
cn.agrael.struts.plugin.ejb3.StrutsEJBActionProxyFactory.createActionProxy(StrutsEJBActionProxyFactory.java:33)
com.opensymphony.xwork2.DefaultActionProxyFactory.createActionProxy(DefaultActionProxyFactory.java:58)
org.apache.struts2.dispatcher.Dispatcher.serviceAction(Dispatcher.java:553)
org.apache.struts2.dispatcher.ng.ExecuteOperations.executeAction(ExecuteOperations.java:77)
org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter.doFilter(StrutsPrepareAndExecuteFilter.java:99)
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:280)
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:248)
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:275)
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:161)
org.jboss.as.jpa.interceptor.WebNonTxEmCloserValve.invoke(WebNonTxEmCloserValve.java:50)
org.jboss.as.web.security.SecurityContextAssociationValve.invoke(SecurityContextAssociationValve.java:153)
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:155)
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:368)
org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:877)
org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:671)
org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:930)
java.lang.Thread.run(Thread.java:619)
javax.naming.NamingException: [ENCJNDIName = java:comp/env/edu.sdau.tobacco.action.common.LoginAction/userDAORemote][defaultJNDIName = /UserDAORemote/remote]?????????
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:553)
org.apache.struts2.dispatcher.ng.ExecuteOperations.executeAction(ExecuteOperations.java:77)
org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter.doFilter(StrutsPrepareAndExecuteFilter.java:99)
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:280)
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:248)
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:275)
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:161)
org.jboss.as.jpa.interceptor.WebNonTxEmCloserValve.invoke(WebNonTxEmCloserValve.java:50)
org.jboss.as.web.security.SecurityContextAssociationValve.invoke(SecurityContextAssociationValve.java:153)
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:155)
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:368)
org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:877)
org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:671)
org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:930)
java.lang.Thread.run(Thread.java:619)
You are seeing this page because development mode is enabled. Development mode, or `devMode`, enables extra debugging behaviors and reports to assist developers. To disable this mode, set:
struts.devMode=false
in your WEB-INF/classes/struts.properties file.
これは次のstruts2-ejb3-plugin.properties
とおりです。
ENCPath=java:comp/env/
#ENCPath=ejb:/tobaccoWeb//
ejbContainer=cn.agrael.struts.plugin.ejb3.JbossApplicationServer
isParseResource=true
isParseEJB=true
earFileBaseName=
remote=remote
local=local
そしてjboss-ejb-client.properties
:
remote.connectionprovider.create.options.org.xnio.Options.SSL_ENABLED=false
remote.connections=default
remote.connection.default.host=localhost
remote.connection.default.port = 4447
jndi.properties
:_
remote.connection.default.connect.options.org.xnio.Options.SASL_POLICY_NOANONYMOUS=false