Home » Fusion Middleware & Colab Suite » Weblogic & Application Server » Weblogic 12c - Deploy an ear twice
Weblogic 12c - Deploy an ear twice [message #679737] Fri, 20 March 2020 06:50
dario-fiore
Messages: 1
Registered: March 2020
Junior Member
I'm trying to deploy an ear file twice on **Weblogic 12.2.1.3.0**. The applications are the same expect for context-root.

They have:

1. Same JPA models
2. Same persistance.xml (with same peristance-unit-name)
3. When I deploy "the second" ear and try to access to db from the first one I receive a

> java.lang.ClassCastException: com.myApplication.models.entityOne
> cannot be cast to com.myApplication.models.entityOne
It seem that the first ear use its own models but the EntityManager of second one ear.

Structure of my ear file is something like that:

/
      - lib
        - jar-with-my-models.jar
        - jar-with-persistance.jar
Persistence.xml is defined as following:

<persistence-unit name="my-persistance-unit" transaction-type="JTA">
          <jar-file>jar-with-my-models.jar</jar-file>
     </persistence-unit>
Weblogic.xml is definied as following:
<weblogic-web-app
    	xmlns="">
    	<context-root>/console</context-root>
    	<container-descriptor>
    		<show-archived-real-path-enabled>true</show-archived-real-path-enabled>
    		<prefer-web-inf-classes>false</prefer-web-inf-classes>
    		<prefer-application-packages>
    			<package-name>antlr.*</package-name>
    		</prefer-application-packages>
    	</container-descriptor>
    
    	<session-descriptor>
    		<persistent-store-type>memory</persistent-store-type>
    		<sharing-enabled>true</sharing-enabled>
    	</session-descriptor>
    </weblogic-web-app>
I'm deploy twice my ear file because I want to replicate an issue that I received during paralell deploy in weblogic
Previous Topic: weblogic 12.2.1.4 and Mysql driver - Issue with JNDI configurartion
Next Topic: WEbLogic server ONS configuration error
Goto Forum:
  


Current Time: Sun Sep 20 04:06:24 CDT 2020