0

我正在将应用程序从 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)

任何指向这个请

感谢和问候斯里尼

4

4 回答 4

3

我注意到这一点:

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

正确的无问题是:

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

记住这个区分大小写

于 2012-10-30T14:53:25.217 回答
1

有了这么短的堆栈跟踪,很难说出问题所在。看起来好像您的 JNDI 查找失败了。查看 AS7 中的新JNDI 名称空间名称

于 2012-09-13T10:03:16.120 回答
0

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

于 2012-09-26T04:01:55.697 回答
0

JBoss 每次都创建 JNDI 名称。

例子:

jndi-name="java:global/demo-ear/demo-ejb-0.0.1-SNAPSHOT/TestService!com.TestService"

并点击此链接

JBoss 7.1 开发问题

于 2014-01-23T16:01:18.497 回答