michael_demonio
michael_demonio

Reputation: 188

weblogic 12c deployment failure

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?

Upvotes: 5

Views: 22392

Answers (4)

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

Upvotes: 0

sumit kumar
sumit kumar

Reputation: 51

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

Upvotes: 1

Shipster1234
Shipster1234

Reputation: 1

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.

Upvotes: 0

michael_demonio
michael_demonio

Reputation: 188

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.

Upvotes: 2

Related Questions