Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [eclipselink-users] Problems with Eclipselink 2 (JPA 2.0) & WebLogic 10

Similar (but not same) error on WebLogic 10.3.3.0

 

Error processing persistence unit GporsPU of module apps/vipor: Error instantiating the Persistence Provider class org.eclipse.persistence.jpa.PersistenceProvider of the PersistenceUnit GporsPU: java.lang.ClassCastException: org.eclipse.persistence.jpa.PersistenceProvider cannot be cast to javax.persistence.spi.PersistenceProvider

 

It used to be (with WebLogic 10.0)

Error processing persitence unit GporsPU of module apps/vipor: Error instantiating the Persistence Provider

class org.eclipse.persistence.jpa.PersistenceProvider of the PersistenceUnit GporsPU: java.lang.ClassCastException: org.eclipse.persistence.jpa.PersistenceProvider

 

 

Sri

 

From: eclipselink-users-bounces@xxxxxxxxxxx [mailto:eclipselink-users-bounces@xxxxxxxxxxx] On Behalf Of Michael O'Brien
Sent: Tuesday, November 30, 2010 1:33 PM
To: EclipseLink User Discussions
Subject: Re: [eclipselink-users] Problems with Eclipselink 2 (JPA 2.0) & WebLogic 10

 

Sri,
    May be.  The instructions are written for 10.3.2.0 and 10.3.3.0 (I have worked with WLS back to 10.3.0 in 2007 but not an earlier 10.0 version using a JPA 1.0 application).
    If there is a way you could try on a later server version - ideally 10.3.3.0 this may help.

http://www.oracle.com/technetwork/middleware/weblogic/downloads/index.html

    All the steps (the manifest as well as the prefer-application-packages element) in alternative #3 must be done in order to override the modules jars with the ones in your EAR/APP-INF/lib

    thank you
    /michael

Sri Sankaran wrote:

Michael:

  Thanks for the response.  I have seen your previous posts on this topic and followed the instructions you have cited (for application managed JPA 2.0).

 

  Yet I am having this problem.  Could it have to do with the fact that I am on WebLogic server 10.0?  Are the instructions different for it?

 

Sri

 

From: eclipselink-users-bounces@xxxxxxxxxxx [mailto:eclipselink-users-bounces@xxxxxxxxxxx] On Behalf Of Michael O'Brien
Sent: Tuesday, November 30, 2010 12:35 PM
To: EclipseLink User Discussions
Subject: Re: [eclipselink-users] Problems with Eclipselink 2 (JPA 2.0) & WebLogic 10

 

Sri,
    I have this one.  Reproducing on 10.3.3.0 - done, reverifying CM and AM workarounds - in progress.
    I will get back to you shortly on this forum.

    In short for WLS 10.3.3.0 and WLS 10.3.2.0 only:
1) For an application managed JPA 2.0 persistence unit - follow the instructions to override everything on the server using your EAR (no server modifications)
http://wiki.eclipse.org/EclipseLink/Development/JPA_2.0/weblogic#DI_1.1:_Alternative_3:_Application_Level_Shared_Library_-_In_Use

2) For a container managed JPA 2.0 persistence unit - follow the section that essentially places the JPA 2.0 spec jar above the server-required JPA 1.0 jar (server modifications)

http://wiki.eclipse.org/EclipseLink/Development/JPA_2.0/weblogic#DI_1.1:_Alternative_2:_Reference_higher_in_the_server_classpath_via_commEnv.cmd

    I will advise when the following...
Caused By: weblogic.deployment.EnvironmentException: Error loading the persistence descriptor META-INF/persistence.xml from the module org.eclipse.persistence.example.jpa.dataparallel.serviceEJB.jar.  See the following stack trace for nested errors: weblogic.descriptor.DescriptorException: VALIDATION PROBLEMS WERE FOUND
  C:\wse\wls10330\org.eclipse.persistence.example.jpa.dataparallel.serviceEJB\build\classes\META-INF\persistence.xml:2:3:2:3: problem: cvc-attribute.4: The value '2.0' does not equal the fixed value '1.0' of attribute 'version':<C:\wse\wls10330\org.eclipse.persistence.example.jpa.dataparallel.serviceEJB\build\classes/META-INF/persistence.xml:2:3>

    Works with

<persistence version="2.0" xmlns="http://java.sun.com/xml/ns/persistence" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_2_0.xsd">


    thank you
    /michael

Sri Sankaran wrote:

I am having no luck deploying my application that uses JPA 2.0 API to a WebLogic 10 instance.

 

The application is deployed as an EAR as explained in the Eclipselink wiki.  The error I see at startup suggests that WebLogic is continuing to use its (internal) JPA 1.0.  The error is:

 

<Nov 30, 2010 10:46:03 AM EST> <Error> <J2EE> <BEA-160197> <Unable to load descriptor weblogic.utils.classloaders.ChangeAwareClassLoader@64bc1e finder

: weblogic.utils.classloaders.CodeGenClassFinder@ed053a annotation: viporear23@apps/vipor/WEB-INF/lib/_wl_cls_gen.jar!/META-INF/persistence.xml of module apps/vipor. The error is weblogic.descriptor.DescriptorException: VALIDATION PROBLEMS WERE FOUND

        at weblogic.descriptor.internal.MarshallerFactory$1.evaluateResults(MarshallerFactory.java:234)

        at weblogic.descriptor.internal.MarshallerFactory$1.evaluateResults(MarshallerFactory.java:221)

        at weblogic.descriptor.internal.MarshallerFactory$1.createDescriptor(MarshallerFactory.java:146)

 

It is almost as if WebLogic is ignoring JARs in the APP-INF/lib directory of the EAR. 

 

If I were to downgrade my persistence.xml to version 1.0, the above error is replaced by a ClassCastException

 

<Nov 30, 2010 10:57:30 AM EST> <Error> <Deployer> <BEA-149205> <Failed to initialize the application 'viporear23' due to error weblogic.application.ModuleException: .weblogic.application.ModuleException:

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

        at weblogic.application.internal.flow.ScopedModuleDriver.prepare(ScopedModuleDriver.java:176)

        at weblogic.application.internal.flow.ModuleListenerInvoker.prepare(ModuleListenerInvoker.java:93)

        at weblogic.application.internal.flow.DeploymentCallbackFlow$1.next(DeploymentCallbackFlow.java:360)

        at weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:26)

        Truncated. see log file for complete stacktrace

weblogic.deployment.EnvironmentException: Error processing persitence unit GporsPU of module apps/vipor: Error instantiating the Persistence Provider

class org.eclipse.persistence.jpa.PersistenceProvider of the PersistenceUnit GporsPU: java.lang.ClassCastException: org.eclipse.persistence.jpa.PersistenceProvider

        at weblogic.deployment.PersistenceUnitInfoImpl.createEntityManagerFactory(PersistenceUnitInfoImpl.java:258)

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

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

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

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

        Truncated. see log file for complete stacktrace

 

I realize that this is not an Eclipselink problem per se.  I am writing in the hope that al fellow subscriber to this list has encountered this problem and has a workaround.  I have posted this issue to Oracle’s WebLogic forum as well.

 

Sri

 

 

 
_______________________________________________
eclipselink-users mailing list
eclipselink-users@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/eclipselink-users
  

 

 

 
_______________________________________________
eclipselink-users mailing list
eclipselink-users@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/eclipselink-users
  

 


Back to the top