0 Replies Latest reply: Dec 3, 2013 3:38 AM by c1cec41a-8e5f-456d-a591-225bc737c82d RSS

    JPA 2.0 with weblogic10.3.6 facing ClassCastExecption

    c1cec41a-8e5f-456d-a591-225bc737c82d

      Hi All,

       

      I am facing below issue when deploying the the webapplication with JPA2.0 . I have gone through the forums and found like for weblogic10.3.* is not JPA2 compitable by default. For that we need to add the below path in setCommandEnv.cmd.

       

      set PRE_CLASSPATH=%wls_modules%\javax.persistence_1.0.0.0_1-0-2.jar;%wls_modules%\com.oracle.jpa2support_1.0.0.0_2-1.jar

       

      whereas in weblogic10.3.6 , I have not found above jar file versions in mentioned path. So I set the path as below with nearest jar file versions which I found in mentioned path.

       

      set PRE_CLASSPATH=%wls_modules%\javax.persistence_1.1.0.0_2-0.jar;%wls_modules%\com.oracle.jpa2support_1.0.0.0_2-1.jar

       

      But still I am facing the same issue as given below

       

      Caused by: weblogic.deployment.EnvironmentException: Error processing persistence unit hibernate_test of module lexicon.war: Error instantiating the Persistence

      Provider class org.hibernate.ejb.HibernatePersistence of the PersistenceUnit hibernate_test: java.lang.ClassCastException: org.hibernate.ejb.HibernatePersistence

      cannot be cast to javax.persistence.spi.PersistenceProvider

              at weblogic.deployment.BasePersistenceUnitInfoImpl.getPersistenceProvider(BasePersistenceUnitInfoImpl.java:375)

              at weblogic.deployment.BasePersistenceUnitInfoImpl.initializeEntityManagerFactory(BasePersistenceUnitInfoImpl.java:393)

              at weblogic.deployment.BasePersistenceUnitInfoImpl.initializeEntityManagerFactory(BasePersistenceUnitInfoImpl.java:386)

              at weblogic.deployment.BasePersistenceUnitInfoImpl.<init>(BasePersistenceUnitInfoImpl.java:158)

              at weblogic.deployment.PersistenceUnitInfoImpl.<init>(PersistenceUnitInfoImpl.java:39)

              at weblogic.deployment.AbstractPersistenceUnitRegistry.storeDescriptors(AbstractPersistenceUnitRegistry.java:349)

              at weblogic.deployment.AbstractPersistenceUnitRegistry.loadPersistenceDescriptors(AbstractPersistenceUnitRegistry.java:124)

              at weblogic.deployment.ModulePersistenceUnitRegistry.<init>(ModulePersistenceUnitRegistry.java:58)

              at weblogic.servlet.internal.WebAppModule.setupPersistenceUnitRegistry(WebAppModule.java:1827)

              at weblogic.servlet.internal.WebAppServletContext.initClassLoader(WebAppServletContext.java:3029)

              at weblogic.servlet.internal.WebAppServletContext.<init>(WebAppServletContext.java:448)

              at weblogic.servlet.internal.WebAppServletContext.<init>(WebAppServletContext.java:494)

              at weblogic.servlet.internal.HttpServer.loadWebApp(HttpServer.java:418)

              at weblogic.servlet.internal.WebAppModule.registerWebApp(WebAppModule.java:976)

              at weblogic.servlet.internal.WebAppModule.prepare(WebAppModule.java:384)

       

      Can any one please give the solution to resolve the issue...