5
votes

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

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:

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

How can i properly deploy my application?

4
It seems that WebLogic complains about an ejb-ref in the EJB-jar.xml of the EJB module, not the one from the web.xml.Robert Panzer
Can you share your whole <session> tag? There may be an another issue. This may help as well coderanch.com/t/451012/EJB-JEE/java/…Display Name is missing

4 Answers

2
votes

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.

1
votes

1.Add below dependency in 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

  <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

   <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

0
votes

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

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.

0
votes

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.

SOLUTION:

1 SOLUTION: pom.xml (Web Project)

<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

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

3 Conclusion:

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

I hope to be of help