将EJB 2.0的项目从JBoss 4.0移动到TomEE时,会发生错误

时间:2017-12-11 02:01:34

标签: jboss ejb apache-tomee

当我将项目从JBoss 4.0移动到TomEE时,会发生错误! 这是我的一些ejb-jar.xml:

makers

<ejb-jar >

当TomEE启动时, 出现此错误:

  <!-- Session Beans -->
  <session >
     <description><![CDATA[<p> RiskAssessmentRouter Manager Bean </p>]]></description>

     <ejb-name>RiskAssessmentRouterManagerBean</ejb-name>

     <home>com.spokesoft.component.riskassessmentrouter.ejb.RiskAssessmentRouterManagerHome</home>
     <remote>com.spokesoft.component.riskassessmentrouter.ejb.RiskAssessmentRouterManager</remote>
     <ejb-class>com.spokesoft.component.riskassessmentrouter.ejb.RiskAssessmentRouterManagerBean</ejb-class>
     <session-type>Stateless</session-type>
     <transaction-type>Container</transaction-type>

     <env-entry>
        <env-entry-name>daoType</env-entry-name>
        <env-entry-type>java.lang.Integer</env-entry-type>
        <env-entry-value><![CDATA[1]]></env-entry-value>
     </env-entry>
     <env-entry>
        <env-entry-name>dbNamespace</env-entry-name>
        <env-entry-type>java.lang.String</env-entry-type>
        <env-entry-value><![CDATA[null]]></env-entry-value>
     </env-entry>

     <resource-ref >
        <res-ref-name>SrsData</res-ref-name>
        <res-type>javax.sql.DataSource</res-type>
        <res-auth>Container</res-auth>
     </resource-ref>

  </session>
</enterprise-beans>

在代码中:

com.spokesoft.component.service.ServiceException: Name [RiskAssessmentRouterManagerBean] is not bound in this Context. Unable to find [RiskAssessmentRouterManagerBean].
at com.spokesoft.component.service.RiskAssessmentRouterDelegate.handleException(RiskAssessmentRouterDelegate.java:178)
at com.spokesoft.component.service.RiskAssessmentRouterDelegate.findServices(RiskAssessmentRouterDelegate.java:78)
at com.spokesoft.http.servlet.service.RiskAssessmentRouterManager.initServices(RiskAssessmentRouterManager.java:345)
at com.spokesoft.http.servlet.service.RiskAssessmentRouter.init(RiskAssessmentRouterManager.java:138)
at org.apache.catalina.core.StandardWrapper.initServlet(StandardWrapper.java:1280)
at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1193)
at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:1088)
at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:5176)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5460)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:901)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:877)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:633)
at org.apache.tomee.catalina.TomcatWebAppBuilder.deployWar(TomcatWebAppBuilder.java:622)
at org.apache.tomee.catalina.TomcatWebAppBuilder.deployWebApps(TomcatWebAppBuilder.java:591)
at org.apache.openejb.assembler.classic.Assembler.createApplication(Assembler.java:855)
at org.apache.openejb.assembler.classic.Assembler.createApplication(Assembler.java:612)
at org.apache.openejb.assembler.classic.Assembler.createApplication(Assembler.java:608)
at org.apache.tomee.catalina.TomcatWebAppBuilder.checkHost(TomcatWebAppBuilder.java:1973)
at org.apache.tomee.catalina.GlobalListenerSupport.lifecycleEvent(GlobalListenerSupport.java:133)
at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119)
at org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:90)
at org.apache.catalina.core.ContainerBase.backgroundProcess(ContainerBase.java:1374)
at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1530)
at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1540)
at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.run(ContainerBase.java:1519)
at java.lang.Thread.run(Thread.java:722)

我的ejb-jar.xml问题或其他一些配置问题,还是我错过了一些重要的配置? 我不知道为什么,有人能帮我解决这个问题吗?非常感谢你,

1 个答案:

答案 0 :(得分:1)

你几乎肯定不能在你在JBoss 4.0中使用的TomEE中使用相同的JNDI名称。旧的J2EE规范没有标准化全局JNDI名称,因此在供应商之间迁移可能是一项重要工作。 Java EE 6和更新版本标准化了这些名称。

所有版本的WildFly都会在您的应用程序启动时记录标准化名称。也许TomEE会做同样的事情。

如果没有,您可以通过在Java EE规范文档的第5节中阅读它们来推断它们。