从JBoss 4.X迁移到7.1问题

时间:2012-09-13 06:26:54

标签: ejb jndi jboss7.x

我正在将应用程序从JBOSS 4.X迁移到JBoss 7.1。我正面临一个问题,如这里所提到的

myApp.ear
     + ---- lib
     |       |------- common.jar
     |
    +----- META-INF
    |       +-- jboss-deployment-structure.xml and  other config files
    |       
    |
    | ---- xxxEJB.jar
    + ---- xxxWebApp.war

jboss-deployment-structure.xml in ear/meta-inf is as follows
<jboss-deployment-structure> 
<ear-subdeployments-isolated>false</ear-subdeployments-isolated>
<deployment>
    <dependencies>
        <module name="javaee.api" export="true"/>//module.xml
        <module name="sun.jdk" export="true"/>
        <module name="com.lib" export="true"/>
        <module name="deployment.myapp.ear.xxxejb.jar"/>
    </dependencies>
</deployment>   
<sub-deployment name="xxxwebapp.war">
    <resources>
         <resource-root path="common.jar" >
         </resource-root>
    </resources>
</sub-deployment>

</jboss-deployment-structure>

尝试调用应用程序时,我收到以下异常

08:05:06,546 ERROR [stderr] (http--127.0.0.1-8080-1) javax.naming.NameNotFoundException: com.xxx.session.UserMgrHome -- service jboss.naming.context.java."com.xxx.session.UserMgrHome"

08:05:06,546 ERROR [stderr] (http--127.0.0.1-8080-1)    at org.jboss.as.naming.ServiceBasedNamingStore.lookup(ServiceBasedNamingStore.java:97)

08:05:06,546 ERROR [stderr] (http--127.0.0.1-8080-1)    at org.jboss.as.naming.NamingContext.lookup(NamingContext.java:178)

08:05:06,546 ERROR [stderr] (http--127.0.0.1-8080-1)    at org.jboss.as.naming.InitialContext.lookup(InitialContext.java:113)

08:05:06,546 ERROR [stderr] (http--127.0.0.1-8080-1)    at org.jboss.as.naming.NamingContext.lookup(NamingContext.java:214)

08:05:06,562 ERROR [stderr] (http--127.0.0.1-8080-1)    at javax.naming.InitialContext.lookup(InitialContext.java:392)

指向此

的任何指示

谢谢和问候 作者Srini

4 个答案:

答案 0 :(得分:3)

我注意到这一点:

<module name="deployment.myapp.ear.xxxejb.jar"/>

没有问题的正确是:

<module name="deployment.myapp.ear.xxxEJB.jar"/>

请记住此区分大小写

答案 1 :(得分:1)

如此短的堆栈跟踪很难说明问题。看起来你的JNDI查找失败了。查看AS7中的新JNDI namespace names

答案 2 :(得分:0)

我使用java:global / earName / ejbjarName / ejbName!com.xxx.ejbNameSessionHome并且工作正常

答案 3 :(得分:0)

JBoss每次都创建JNDI名称。

示例:

JNDI名称= “java的:全球/演示耳/演示EJB-0.0.1-SNAPSHOT / TestService的com.TestService”

并点击此链接

JBoss 7.1 development issues