From dev-return-15883-apmail-openjpa-dev-archive=openjpa.apache.org@openjpa.apache.org Tue Mar 23 15:51:53 2010 Return-Path: Delivered-To: apmail-openjpa-dev-archive@www.apache.org Received: (qmail 72216 invoked from network); 23 Mar 2010 15:51:53 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 23 Mar 2010 15:51:53 -0000 Received: (qmail 22621 invoked by uid 500); 23 Mar 2010 15:51:53 -0000 Delivered-To: apmail-openjpa-dev-archive@openjpa.apache.org Received: (qmail 22122 invoked by uid 500); 23 Mar 2010 15:51:52 -0000 Mailing-List: contact dev-help@openjpa.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@openjpa.apache.org Delivered-To: mailing list dev@openjpa.apache.org Received: (qmail 22114 invoked by uid 99); 23 Mar 2010 15:51:52 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 23 Mar 2010 15:51:52 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.140] (HELO brutus.apache.org) (140.211.11.140) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 23 Mar 2010 15:51:48 +0000 Received: from brutus.apache.org (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id 92B13234C4C7 for ; Tue, 23 Mar 2010 15:51:27 +0000 (UTC) Message-ID: <1133368620.436361269359487600.JavaMail.jira@brutus.apache.org> Date: Tue, 23 Mar 2010 15:51:27 +0000 (UTC) From: "Seth Jackson (JIRA)" To: dev@openjpa.apache.org Subject: [jira] Commented: (OPENJPA-1410) Class linkage exception when creating an EMF with OpenJPA M3 In-Reply-To: <451636935.1259777660748.JavaMail.jira@brutus> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 X-Virus-Checked: Checked by ClamAV on apache.org [ https://issues.apache.org/jira/browse/OPENJPA-1410?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12848766#action_12848766 ] Seth Jackson commented on OPENJPA-1410: --------------------------------------- Using the latest available OpenJPA 2.0.0 Beta 2, Tomcat 6, Java 1.5, and Windows XP: Persistence.XML: Using ANT to run PCEnhancerTask at build time: Upon building, I receiving the message: "No targets given. Running on all classes in your persistence classes list..." Confirmed all entities are in the persistence XML. Deploy WAR to Tomcat. Started Tomcat and navigated to web page. Clicked button that attempted to retrieve an entity from the database and the following exception occurred: c:\tomcat\temp\org.apache.openjpa.enhance.InstrumentationFactory3419745326061675422.jar was created and it may not get cleaned up properly. java.lang.ClassNotFoundException: org.apache.openjpa.enhance.InstrumentationFactory at java.net .URLClassLoader$1.run(URLClassLoader.java:200) at java.security.AccessController.doPrivileged(Natuve Method) at java.net.URLClassLoader.findClass(URLClassLoader.java:188) at java.lang.ClassLoader.loadClass(ClassLoader.java:303) at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301) ...*SNIP* at sun.instrument.InstrumentationImpl.loadClassAndCallAgentmain(InstrumentationImpl.java:348) After this, all OpenJPA queries immediately throw QueryTimeoutException, even though I have javax.persistence.query.timeout set to 0 in the persistence.XML. Still unable to use OpenJPA 2.0 on Tomcat. I apologize ahead of time, I had to hand type this out as the error in on a separate PC. > Class linkage exception when creating an EMF with OpenJPA M3 > ------------------------------------------------------------ > > Key: OPENJPA-1410 > URL: https://issues.apache.org/jira/browse/OPENJPA-1410 > Project: OpenJPA > Issue Type: Bug > Components: validation > Affects Versions: 2.0.0-M3, 2.0.0-beta, 2.0.0-beta2 > Environment: Tomcat and Glassfish, OpenJPA M3 > Reporter: Jeremy Bauer > Assignee: Jeremy Bauer > Priority: Critical > Fix For: 2.0.0 > > > Posted by Seth Jackson on the user forum[1]. > It appears something was modified in OpenJPA 2.0 M3 from M2 that causes a > LinkageError. > In my current environment, I've tested both Glassfish and Tomcat using M2 > and M3. M2 runs without problems, but M3 throws a linkage error as follows: > Caused by: java.lang.LinkageError: loader constraint violation: loader > (instance of sun/misc/Launcher$AppClassLoader) previously initiated loading > for a different type with name > "org/apache/openjpa/conf/OpenJPAConfiguration" > at java.lang.ClassLoader.defineClass1(Native Method) > at java.lang.ClassLoader.defineClass(ClassLoader.java:621) > at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:124) > at java.net.URLClassLoader.defineClass(URLClassLoader.java:260) > at java.net.URLClassLoader.access$000(URLClassLoader.java:56) > at java.net.URLClassLoader$1.run(URLClassLoader.java:195) > at java.security.AccessController.doPrivileged(Native Method) > at java.net.URLClassLoader.findClass(URLClassLoader.java:188) > at java.lang.ClassLoader.loadClass(ClassLoader.java:307) > at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301) > at java.lang.ClassLoader.loadClass(ClassLoader.java:252) > at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:320) > at > org.apache.openjpa.persistence.validation.ValidationUtils.setupValidation(ValidationUtils.java:53) > at > org.apache.openjpa.persistence.PersistenceProviderImpl.loadValidator(PersistenceProviderImpl.java:290) > at > org.apache.openjpa.persistence.PersistenceProviderImpl.createEntityManagerFactory(PersistenceProviderImpl.java:97) > at > org.apache.openjpa.persistence.OpenJPAPersistence.createEntityManagerFactory(OpenJPAPersistence.java:128) > at > org.apache.openjpa.persistence.OpenJPAPersistence.createEntityManagerFactory(OpenJPAPersistence.java:111) > at test_test.user.UserAction.execute(UserAction.java:39) > I've already confirmed that the OpenJPA classes in question do NOT exist in > any other JARs in the path. > ValidationUtils.setupValidation(ValidationUtils.java:53) calls the > OpenJPAConfiguration.getConfigurationLog(). The object being referenced is > JDBCConfigurationImpl, which in other classes retrieves the log reference > perfectly fine, before it gets to the offending line. > Seth's follow up[2]: > After further review, using Glassfish 2.1.1 I received this error message in > the server log: > Caused by: java.lang.LinkageError: loader constraint violation: when > resolving method > "org.apache.openjpa.persistence.validation.ValidationUtils.setupValidation(Lorg/apache/openjpa/conf/OpenJPAConfiguration;)Z" > the class loader (instance of org/apache/catalina/loader/WebappClassLoader) > of the current class, > org/apache/openjpa/persistence/PersistenceProviderImpl, and the class loader > (instance of sun/misc/Launcher$AppClassLoader) for resolved class, > org/apache/openjpa/persistence/validation/ValidationUtils, have different > Class objects for the type org/apache/openjpa/conf/OpenJPAConfiguration used > in the signature > So it appears to be the WebappClassLoader and the AppClassLoader are both > loading the OpenJPAConfiguration from the same JAR file, causing the error > when the class is trying to be resolved in this particular method. > [1] http://n2.nabble.com/Struts-2x-OpenJPA-2-0-M3-Tomcat-or-Glassfish-tp4087312p4087312.html > [2] http://n2.nabble.com/Struts-2x-OpenJPA-2-0-M3-Tomcat-or-Glassfish-tp4087312p4093228.html -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.