【问题标题】:weblogic 12c deployment failureweblogic 12c 部署失败
【发布时间】:2014-07-04 16:52:38
【问题描述】:

我正在从 Weblogic 11g 迁移到 12c,在部署过程中它失败并显示以下错误:

Caused by: weblogic.application.naming.ReferenceResolutionException: [J2EE:160199]Error resolving ejb-ref "ejb/BizRuleFacade" from module "BizAgi-ejb.jar" of application "BizAgi-ear-Weblogic". The ejb-ref does not have an ejb-link and the JNDI name of the target bean has not been specified. Attempts to automatically link the ejb-ref to its target bean failed because multiple EJBs in the application were found to implement the "BizAgi.bpm.rules.entities.BizRuleFacade" interface, including BizAgi-war.war/BizRuleFacadeBean, BizAgi-ejb.jar/BizRuleFacadeBean. Specify a qualified ejb-link for this ejb-ref to indicate which EJB is the target of this ejb-ref.

我的 web.xml 文件如下所示:

<ejb-local-ref> <ejb-ref-name>ejb/BAScopeLogFacade</ejb-ref-name> <ejb-ref-type>Session</ejb-ref-type> <local>BizAgi.PAL.historylog.entities.BAScopeLogFacade</local> <ejb-link>BizAgi-ejb.jar#BAScopeLogFacadeBean</ejb-link> </ejb-local-ref>

BizAgi-ejb.jar 是耳内的一个模块 (BizAgi-ear-Weblogic.ear)。

如何正确部署我的应用程序?

【问题讨论】:

  • 似乎 WebLogic 抱怨的是 EJB 模块的 EJB-jar.xml 中的 ejb-ref,而不是 web.xml 中的那个。
  • 你能分享你的整个&lt;session&gt;标签吗?可能还有另一个问题。这可能也有帮助coderanch.com/t/451012/EJB-JEE/java/…

标签: java jakarta-ee deployment weblogic descriptor


【解决方案1】:

非常感谢大家,我终于找到了解决方案,只需从 .war 文件中删除/删除 META-INF/MANIFEST.MF 文件。这样 EJB 就不会被双重引用。

【讨论】:

  • 我发现这个问题只发生在 weblogic 12c 中。
  • 嗨。我遇到了同样的问题,但不幸的是,您的解决方案对我不起作用,因为我的 war 文件没有 MANIFEST.MF 文件。 ¿ 您是否发现了有关此问题的新信息?
  • @PedroGarcíaMedina 在我的情况下,这是由于两个清单文件的双重引用库,一个在 .war 文件中,另一个在包含 war 文件的 .ear 文件中。
【解决方案2】:

1.在Ear Pom.xml中添加以下依赖

  <dependency>
      <groupId>com.example</groupId>
      <artifactId>ejbModel</artifactId>
      <version>1.0-SNAPSHOT</version>
      <type>ejb</type>
  </dependency> 

2.在Ear pom.xml模块中添加ejb模块

  <modules>
      <ejbModule>
        <groupId>com.example</groupId>
        <artifactId>ejbModel</artifactId>
        <bundleFileName>ejbModel-1.0-SNAPSHOT.jar</bundleFileName>
      </ejbModule>
      .......
   </modules>

3.将ejbmodel依赖的范围改为应用pom.xml中提供的

   <dependency>
     <groupId>com.example</groupId>
     <artifactId>ejbModel</artifactId>
     <version>1.0-SNAPSHOT</version>
     <type>jar</type>
     <scope>provided</scope>
   </dependency>

4.添加ejbmodel应用的persistence.xml到资源文件夹

【讨论】:

    【解决方案3】:

    确保在您的部署中不会多次加载相同的 EJB。您可以通过使用 weblogic 控制台 (AdminServer) 并检查部署的 EJB(通过单击部署概述中失败的部署旁边的小“+”号)来检查这一点。

    在我的情况下,我必须修复 maven 依赖项(通过将一个项目的一个依赖项设置为“已提供”),以便它不会两次加载相同的 EJB。

    【讨论】:

      【解决方案4】:

      错误: weblogic.management.DeploymentException:weblogic.application.naming.ReferenceResolutionException:[J2EE:160199]从模块解析ejb-ref“com.xxx.xxx.xxx.xxx.xxx.xxx.XXXX/xxxRemote”时出错 应用程序“XXX-X.X.X”的“XXX-X.X.X.war”。 ejb-ref 没有 ejb-link 并且没有指定目标 Bean 的 JNDI 名称。

      解决方案:

      1 解决方案:pom.xml(网络项目)

      <dependencies>
              <dependency>
                  <groupId>co.xx.cxxxx</groupId>
                  <artifactId>xxxxx-ejb</artifactId>
                  <version>1.0</version>
                  <type>ejb</type>
                  <scope>provided</scope>
              </dependency>
      <dependencies>
      

      2 解决方法:删除 xxxxx-ejb.jar

      xxxx.ear > xxxx.war > WEB-INF > lib > xxx-ejb.jar [删除]

      3 结论:

      这是因为存在对 ejb.jar 的双重引用,因此控制这种情况的最佳方法是在 pom (web) 中说它是 EJB 类型,以便从 (ejb.jar) 中获取父级(EAR,其中添加了 ejb 模块)。

      希望对您有所帮助

      【讨论】:

        猜你喜欢
        • 2013-08-22
        • 2018-04-12
        • 2012-07-12
        • 2016-11-15
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        相关资源
        最近更新 更多