cayenne-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Neil Rutherford (JIRA)" <>
Subject [jira] Created: (CAY-1192) NoClassDefFoundError while loading JPA entity classes on Windows
Date Thu, 12 Mar 2009 12:41:16 GMT
NoClassDefFoundError while loading JPA entity classes on Windows

                 Key: CAY-1192
             Project: Cayenne
          Issue Type: Bug
          Components: Cayenne JPA
    Affects Versions: 3.0M5
         Environment: MS Windows XP
Eclipse 3.4.1
JDK 1.5.08
            Reporter: Neil Rutherford
         Attachments: patch.diff

While running a test app with 1 entity from inside Eclipse I get the below exception:

2009/03/12 02:17:03 org.apache.cayenne.jpa.Provider createEntityManagerFactory
INFO: Extra PersistenceUnitInfo properties: {}
Exception in thread "main" java.lang.NoClassDefFoundError: test\entities\Transaction (wrong
name: test/entities/Transaction)
	at java.lang.ClassLoader.defineClass1(Native Method)
	at java.lang.ClassLoader.defineClass(
	at java.lang.ClassLoader.defineClass(
	at org.apache.cayenne.jpa.JpaUnitClassLoader.findClass(
	at org.apache.cayenne.jpa.JpaUnitClassLoader.loadClass(
	at java.lang.ClassLoader.loadClass(
	at java.lang.ClassLoader.loadClassInternal(
	at java.lang.Class.forName0(Native Method)
	at java.lang.Class.forName(
	at org.apache.cayenne.jpa.conf.EntityMapLoader.loadFromAnnotations(
	at org.apache.cayenne.jpa.conf.EntityMapLoader.loadEntityMap(
	at org.apache.cayenne.jpa.conf.EntityMapLoader.<init>(
	at org.apache.cayenne.jpa.Provider.createContainerEntityManagerFactory(
	at org.apache.cayenne.jpa.Provider.createEntityManagerFactory(
	at javax.persistence.Persistence.createFactory(
	at javax.persistence.Persistence.createEntityManagerFactory(
	at javax.persistence.Persistence.createEntityManagerFactory(
	at Main.main(

This seems to be caused by this line in org.apache.cayenne.jpa.conf.EntityMapLoader (inside

                                    absPath.length() - suffixLen).replace('/', '.'));

because on Windows the path separator is a '\\', replacing the '/' with File.separatorChar
fixes my problem.

This message is automatically generated by JIRA.
You can reply to this email to add a comment to the issue online.

View raw message