users@glassfish.java.net

Open JPA2 with GlasFish v2.1 deployment error in getValidationMode()

From: <glassfish_at_javadesktop.org>
Date: Wed, 21 Jul 2010 07:13:38 PDT

I am planning to use open JPA 2.0 with glassfish v2.1 when I try to deploy the project I am getting the error .
Please fix your application and redeploy. WARNING: com.sun.enterprise.deployment.backend.IASDeploymentException: com.sun.enterprise.server.PersistenceUnitInfoImpl.getValidationMode()Ljavax/persistence/ValidationMode; com.sun.enterprise.deployment.backend.IASDeploymentException: com.sun.enterprise.server.PersistenceUnitInfoImpl.getValidationMode()Ljavax/persistence/ValidationMode;

I can find following jira issue opened
https://issues.apache.org/jira/browse/OPENJPA-1452

I followed the following steps that are given as a solution in the above jira issue and still I am facing the same problem.
To run OpenJPA 2.0 (or possibly other JPA 2.0 compliant JPA provider, my observations/experiments are based on OpenJPA only), please try the following

  1. Grab a JPA 2.0 Specification JAR from somewhere. JPA 2.0 specifcation jar is not only a set of interface classes but also has concrete implementation classes.
      The errors reported in this issue can be traced to the fact that
          a) Glassfish V2.x includes EclipseLink library which in turn includes JPA spec classes
          b) those spec classes are JPA 1.0

  2. Place that jar (say jpa-spec-2.0.jar) into <root>/domains/domain1/lib/ext
      where <root> is glassfish v2.x install point
                 domain1 is the name of the domain

      That lib/ext directory is also a good place for common libraries such as JDBC driver

  3. Place openjpa 2.x libraries into <root>/domains/domain1/applibs.

  4. Deploy your application with --libraries option. The options should specify openjpa 2.x library name(s). You can do the same from the web-based admin console on the page
(Web Applications -> Deploy) and fill-in 'Libraries' field.



I know why the problem is occuring glassfish is always taking JPA1 spec over JPA2.
To change the classloader precedence I have modified domain.xml also nothing is working for me.

Can any body guide me how to configure openJPA2 with glassfishv2.1
[Message sent by forum member 'sksrinu123']

http://forums.java.net/jive/thread.jspa?messageID=478174