openjpa-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Rick Curtis (JIRA)" <>
Subject [jira] [Commented] (OPENJPA-2003) java.lang.NoClassDefFoundError: (initialization failure) raised when @MappedSuperClass is present in a jar
Date Tue, 31 May 2011 14:41:47 GMT


Rick Curtis commented on OPENJPA-2003:

A little clarification.... Is the solution to this error moving the BaseEntity into the maven
project, or including it in the <class> list in your p.xml?


> java.lang.NoClassDefFoundError: (initialization failure) raised when @MappedSuperClass
is present in a jar
> ----------------------------------------------------------------------------------------------------------
>                 Key: OPENJPA-2003
>                 URL:
>             Project: OpenJPA
>          Issue Type: Bug
>          Components: jpa
>    Affects Versions: 1.2.2
>         Environment: Spring 3.0x, JUnit 4.4
>            Reporter: reverttoconsole
> I have a @MappedSuperclass BaseEntity (empty) that's include in a common-utils.jar. In
another maven project, I have JPA 1.0 entities which extend BaseEntity. On running a unit
test, I get the following error:
> Caused by: java.lang.NoClassDefFoundError: xxx.entity.ProfileLoadError (initialization
> 	at java.lang.J9VMInternals.initialize(
> 	at java.lang.Class.forNameImpl(Native Method)
> 	at java.lang.Class.forName(
> 	at org.apache.openjpa.meta.MetaDataRepository.classForName(
> 	at org.apache.openjpa.meta.MetaDataRepository.loadPersistentTypesInternal(
> 	at org.apache.openjpa.meta.MetaDataRepository.loadPersistentTypesLocking(
> 	at org.apache.openjpa.meta.MetaDataRepository.loadPersistentTypes(
> 	at org.apache.openjpa.kernel.AbstractBrokerFactory.loadPersistentTypes(
> 	at org.apache.openjpa.kernel.AbstractBrokerFactory.initializeBroker(
> 	at org.apache.openjpa.kernel.AbstractBrokerFactory.newBroker(
> 	at org.apache.openjpa.kernel.DelegatingBrokerFactory.newBroker(
> 	at org.apache.openjpa.persistence.EntityManagerFactoryImpl.createEntityManager(
> 	at org.apache.openjpa.persistence.EntityManagerFactoryImpl.createEntityManager(
> 	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> 	at sun.reflect.NativeMethodAccessorImpl.invoke(
> 	at sun.reflect.DelegatingMethodAccessorImpl.invoke(
> 	at java.lang.reflect.Method.invoke(
> 	at org.springframework.orm.jpa.AbstractEntityManagerFactoryBean.invokeProxyMethod(
> 	at org.springframework.orm.jpa.AbstractEntityManagerFactoryBean$ManagedEntityManagerFactoryInvocationHandler.invoke(
> 	at $Proxy21.createEntityManager(Unknown Source)
> 	at org.springframework.orm.jpa.SharedEntityManagerCreator$SharedEntityManagerInvocationHandler.invoke(
> 	at $Proxy22.persist(Unknown Source)
> 	at org.frb.bos.tcms.profile.SeedData.afterPropertiesSet(
> 	at
> 	at
> 	... 37 more
> If I move the BaseEntity into the maven project, I don't get this error.
> Turns out that the error is gone when I include BaseEntity in persistence.xml. But it
seems to me that this has to be documented clearly or atleast the error message should be
clearer because NoClassDefFoundError is misleading. Maybe openjpa's classloader doesn't automatically
scan the classpath for the missing entities?
> I don't get this error in hibernate.

This message is automatically generated by JIRA.
For more information on JIRA, see:

View raw message