Java weblogic 12c 部署失败

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/24578438/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-14 13:09:56  来源:igfitidea点击:

weblogic 12c deployment failure

javajakarta-eedeploymentweblogicdescriptor

提问by michael_demonio

I'm migrating from Weblogic 11g to 12c, during the deployment process it fails and shows the following error:

我正在从 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.

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.

My web.xml file looks like this:

我的 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>

<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>

The BizAgi-ejb.jar is a module inside the ear (BizAgi-ear-Weblogic.ear).

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

How can i properly deploy my application?

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

回答by michael_demonio

Thank you so much everybody, I've finally found the solution, it is to simply delete/remove the META-INF/MANIFEST.MF file from the .war file. That way the EJBs aren't double referenced.

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

回答by Shipster1234

Make sure that the same EJBs are not loaded multiple times in your deployment. You can check this by using the weblogic console (AdminServer) and checking the EJBs of the deployment (by clicking the little "+" sign next to the deployment that is failing int the deployments overview).

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

In my case I had to fix the maven dependencies (by setting one dependency of one project to "provided") so that it did not load the same EJB twice.

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

回答by sumit kumar

1.Add below dependency in Ear Pom.xml

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

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

2.In Ear pom.xml in modules add ejb module

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

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

3.Change scope of ejbmodel dependency to provided in application pom.xml

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.add persistence.xml of ejbmodel application to resource folder

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

回答by Carlos Alberto Gonzalez

ERROR:weblogic.management.DeploymentException: weblogic.application.naming.ReferenceResolutionException: [J2EE:160199]Error resolving ejb-ref "com.xxx.xxx.xxx.xxx.xxx.xxx.XXXX/xxxRemote" from module "XXX-X.X.X.war" of application "XXX-X.X.X". The ejb-ref does not have an ejb-link and the JNDI name of the target Bean has not been specified.

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

SOLUTION:

解决方案:

1 SOLUTION: pom.xml (Web Project)

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 SOLUTION: Delete xxxxx-ejb.jar

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

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

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

3 Conclusion:

3 结论:

This is because there is a double reference to the ejb.jar, therefore the best way to control this is by saying in pom (web) that the is of type EJB, in order to take the (ejb.jar ) from the parent (EAR, where the ejb module is added).

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

I hope to be of help

我希望能有所帮助