Hi,

again, your documentation is good, and your support as well. It's just me too dumb to read it. Sorry for bothering you, this I could've found out myself.

But now for something completely different (hopefully not again a not-read-documentation-issue;)

I get the stack trace below when constructing the EntityManagerFactory in an OSGi environment.

My entities have the following inheritance hierarchy:

class Entity {
  // get/set methods common to all entity-classes
  // like id and version. Methods are JP-annotated,
  // but not the class itself
}

// not JPA-annotated
interface IProject {
  // some get/set methods
}

@Entity
class Project implements IProject extends Entity {
  // implemented get/set methods of IProject
  // with JPA annotations
}

The class loaders of all these classes are passed to MultiClassLoader I regsistered in the openjpa.ClassResolver property. It seems that the custom openjpa.ClassResolver I specified is not asked when preparing the unenhanced classes. Could that be?

Not sure what further information to add, I could of course send the test- and implementation plug-in-projects. They run out-of-the-box, provided that an Eclipse >= 3.3 is installed.

-- Rüdiger


Stack trace
-----------
java.lang.NoClassDefFoundError: org/rhoeta/core/plan/entity/IProject
        at java.lang.ClassLoader.defineClass1(Native Method)
        at java.lang.ClassLoader.defineClass(ClassLoader.java:620)
        at java.lang.ClassLoader.defineClass(ClassLoader.java:465)
        at serp.bytecode.BCClassLoader.findClass(BCClassLoader.java:50)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
        at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319)
        at java.lang.ClassLoader.defineClass1(Native Method)
        at java.lang.ClassLoader.defineClass(ClassLoader.java:620)
        at java.lang.ClassLoader.defineClass(ClassLoader.java:465)
        at serp.bytecode.BCClassLoader.findClass(BCClassLoader.java:50)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
        at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319)
        at java.lang.Class.forName0(Native Method)
        at java.lang.Class.forName(Class.java:242)
at org.apache.openjpa.util.GeneratedClasses.loadBCClass(GeneratedClasses.java:67) at org.apache.openjpa.enhance.ManagedClassSubclasser.write(ManagedClassSubclasser.java:259) at org.apache.openjpa.enhance.ManagedClassSubclasser.access$000(ManagedClassSubclasser.java:53) at org.apache.openjpa.enhance.ManagedClassSubclasser$1.write(ManagedClassSubclasser.java:123)
        at org.apache.openjpa.enhance.PCEnhancer.record(PCEnhancer.java:526)
        at org.apache.openjpa.enhance.PCEnhancer.record(PCEnhancer.java:514)
at org.apache.openjpa.enhance.ManagedClassSubclasser.prepareUnenhancedClasses(ManagedClassSubclasser.java:145)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:585)
at org.apache.openjpa.kernel.AbstractBrokerFactory.loadPersistentTypes(AbstractBrokerFactory.java:297) at org.apache.openjpa.kernel.AbstractBrokerFactory.newBroker(AbstractBrokerFactory.java:199) at org.apache.openjpa.kernel.DelegatingBrokerFactory.newBroker(DelegatingBrokerFactory.java:142) at org.apache.openjpa.persistence.EntityManagerFactoryImpl.createEntityManager(EntityManagerFactoryImpl.java:192) at org.apache.openjpa.persistence.EntityManagerFactoryImpl.createEntityManager(EntityManagerFactoryImpl.java:145) at org.apache.openjpa.persistence.EntityManagerFactoryImpl.createEntityManager(EntityManagerFactoryImpl.java:56) at org.rhoeta.core.internal.model.JPAModelStore.executeSql(JPAModelStore.java:95) at org.rhoeta.core.internal.model.JPAModelStore.doCreate(JPAModelStore.java:26) at org.rhoeta.core.internal.model.AbstractModelStore.create(AbstractModelStore.java:36) at org.rhoeta.core.plan.internal.jpastore.JPAModelStore_Test.testCreate(JPAModelStore_Test.java:18)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:585)
        at junit.framework.TestCase.runTest(TestCase.java:168)
        at junit.framework.TestCase.runBare(TestCase.java:134)
        at junit.framework.TestResult$1.protect(TestResult.java:110)
        at junit.framework.TestResult.runProtected(TestResult.java:128)
        at junit.framework.TestResult.run(TestResult.java:113)
        at junit.framework.TestCase.run(TestCase.java:124)
        at junit.framework.TestSuite.runTest(TestSuite.java:232)
        at junit.framework.TestSuite.run(TestSuite.java:227)
at org.junit.internal.runners.OldTestClassRunner.run(OldTestClassRunner.java:76) at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:45) at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:460) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:673) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:386) at org.eclipse.pde.internal.junit.runtime.RemotePluginTestRunner.main(RemotePluginTestRunner.java:62) at org.eclipse.pde.internal.junit.runtime.CoreTestApplication.run(CoreTestApplication.java:23)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:585)
at org.eclipse.equinox.internal.app.EclipseAppContainer.callMethod(EclipseAppContainer.java:565) at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:195) at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:110) at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:79) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:362) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:175)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:585)
        at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:549)
        at org.eclipse.equinox.launcher.Main.basicRun(Main.java:504)
        at org.eclipse.equinox.launcher.Main.run(Main.java:1236)
        at org.eclipse.equinox.launcher.Main.main(Main.java:1212)



Pinaki Poddar wrote:
Hi,
  Configuring a ClassResolver[1] with MultiLoaderClassResolver[2] may be
your answer.

[1]
http://openjpa.apache.org/docs/latest/manual/manual.html#openjpa.ClassResolver
[2]
http://openjpa.apache.org/docs/latest/javadoc/org/apache/openjpa/util/MultiLoaderClassResolver.html


Reply via email to