【问题标题】:cannot deploy EJB ear file in glassfish 3.1 server无法在 glassfish 3.1 服务器中部署 EJB ear 文件
【发布时间】:2013-07-30 07:38:47
【问题描述】:

我们有运行 ejb 应用程序的 glassfish 2.1 应用程序服务器。现在我们在新服务器中安装了 glassfish 3.1,当我尝试部署其中一个 EJB 应用程序时,出现以下异常.....

Cannot resolve reference Local ejb-ref name=com.alw.mdb.ExtFileUploadedMessageHandlerBean/fileUploaderBean,Local 3.x interface =com.alw.sbi.extuploader.utils.ExtFileManagerLocal,ejb-link=null,lookup=,mappedName=,jndi-name=,refType=Session because there are 2 ejbs in the application with interface com.alw.sbi.extuploader.utils.ExtFileManagerLocal. 
Some of the possible causes: 
1. The EJB bean class was packaged in an ear lib library (or through any other library mechanism which makes the library visible to all component modules), this makes all the component modules include this bean class indirectly. 
2. The EJB bean class was packaged in a component module which references the EJB, either directly or indirectly through Manifest, WEB-INF/lib. 
The EJB bean class should only be packaged in the declaring ejb module and not the referencing modules. The referencing modules should only include EJB interfaces.
java.lang.IllegalArgumentException: Cannot resolve reference Local ejb-ref name=com.alw.mdb.ExtFileUploadedMessageHandlerBean/fileUploaderBean,Local 3.x interface =com.alw.sbi.extuploader.utils.ExtFileManagerLocal,ejb-link=null,lookup=,mappedName=,jndi-name=,refType=Session because there are 2 ejbs in the application with interface com.alw.sbi.extuploader.utils.ExtFileManagerLocal. 
Some of the possible causes: 
1. The EJB bean class was packaged in an ear lib library (or through any other library mechanism which makes the library visible to all component modules), this makes all the component modules include this bean class indirectly. 
2. The EJB bean class was packaged in a component module which references the EJB, either directly or indirectly through Manifest, WEB-INF/lib. 
The EJB bean class should only be packaged in the declaring ejb module and not the referencing modules. The referencing modules should only include EJB interfaces.
        at com.sun.enterprise.deployment.util.EjbBundleValidator.accept(EjbBundleValidator.java:568)
        at com.sun.enterprise.deployment.EjbDescriptor.visit(EjbDescriptor.java:2589)
        at com.sun.enterprise.deployment.EjbBundleDescriptor.visit(EjbBundleDescriptor.java:734)
        at com.sun.enterprise.deployment.Application.visit(Application.java:1768)
        at com.sun.enterprise.deployment.archivist.ApplicationArchivist.validate(ApplicationArchivist.java:799)
        at com.sun.enterprise.deployment.archivist.ApplicationArchivist.openWith(ApplicationArchivist.java:277)
        at com.sun.enterprise.deployment.archivist.ApplicationFactory.openWith(ApplicationFactory.java:240)
        at org.glassfish.javaee.core.deployment.DolProvider.load(DolProvider.java:170)
        at org.glassfish.javaee.core.deployment.DolProvider.load(DolProvider.java:93)
        at com.sun.enterprise.v3.server.ApplicationLifecycle.loadDeployer(ApplicationLifecycle.java:826)

谁能告诉我问题出在哪里?
还有一件事,当我们安装一个应用服务器时,我们应该手动将所需的jar 文件放在服务器的lib 文件夹中,还是这些文件自己来。因为在我们的另一台测试服务器中,glassfish/lib 文件夹中有很多 jar,但新安装的文件夹中没有。

【问题讨论】:

    标签: java jar glassfish ejb


    【解决方案1】:

    这可能会有所帮助:http://docs.oracle.com/cd/E18930_01/html/821-2417/beaek.html

    还有一种方法可以从命令行进行兼容部署:

    asadmin deploy --property compatibility=v2 foo.ear
    

    您可以在 https://java.net/jira/browse/GLASSFISH-10496 中阅读

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2011-07-26
      • 1970-01-01
      • 2013-08-19
      • 1970-01-01
      • 2017-05-09
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多