WebLogic 12c部署失败

5
我正在从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是ear文件(BizAgi-ear-Weblogic.ear)内的一个模块。
请问如何正确部署我的应用程序?

看起来WebLogic抱怨EJB模块的EJB-jar.xml中的ejb-ref,而不是web.xml中的ejb-ref。 - Robert Panzer
你能分享一下你整个的<session>标签吗?可能还有其他问题。这个链接也许会有帮助:http://www.coderanch.com/t/451012/EJB-JEE/java/EJB-Local-Lookup-working-Weblogic - Display Name is missing
4个回答

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

我发现这个问题只会在Weblogic 12c中出现。 - michael_demonio
嗨。我遇到了同样的问题,但不幸的是你的解决方案对我来说不起作用,因为我的war文件没有MANIFEST.MF文件。你有关于这个问题有什么新发现吗? - Pedro García Medina
在我的情况下,这是由于双重引用库的原因,因为有两个清单文件,一个在.war文件中,另一个在包含war文件的.ear文件中。@PedroGarcíaMedina - michael_demonio

1

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 文件中的 modules 中添加 ejb 模块。

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

3. 在应用程序的pom.xml中,将ejbmodel依赖项的范围更改为provided。

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

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


0

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

解决方案:

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

<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,以便从父级 (EAR,在其中添加了 ejb 模块) 中获取 (ejb.jar)。

希望对您有所帮助


0

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

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


网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接