openjpa-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Phill Moran" <pjmo...@rogers.com>
Subject RE: OPEN-JPA and Toplink 2.0.XX
Date Sun, 25 Mar 2007 22:24:23 GMT
This is interesting thanks for the information. Firstly I thought that one
needed both toplink and JPA to make use of JPA in an application. I think I
found this on the Glassfish site, can't remember now. This is why I posted this
here.

So there is no reliance on toplink for JPA if OpenJPA is used? I use only JPA
annotations in the code

Phill

-----Original Message-----
From: Marc Prud'hommeaux [mailto:mprudhomapache@gmail.com] On Behalf Of Marc
Prud'hommeaux
Sent: March 25, 2007 3:00 PM
To: open-jpa-dev@incubator.apache.org
Subject: Re: OPEN-JPA and Toplink 2.0.XX

Phill-

The error you get seems to indicate that TopLink doesn't support table per class
inheritance (which is an optional feature of the JPA spec). Note that this is a
forum for OpenJPA, which, like TopLink, is a JPA implementation, but people here
aren't TopLink experts so we might not be the best people to help.

Note, though, that OpenJPA does support table per class inheritance, so if you
were to switch from TopLink to OpenJPA, you probably wouldn't get this error
anymore :)




On Mar 25, 2007, at 10:45 AM, Phill Moran wrote:

> It is a reported as a toplink exception and since the toplink jar is 
> all I changed to resolve it this is my top candidate. Here is the 
> trace from one of the tests but since I use table per class throughout 
> my application all persisting test cases fail
>
> Here is the trace
>
> <code>
> org.springframework.beans.factory.BeanCreationException: Error 
> creating bean with name 'categoryFactory' defined in file 
> [/BidSpec/applications/emall/target/test-classes/
> applicationContext.xml]: Cannot
> resolve reference to bean 'bidSpecEntityManagerFactory' while setting 
> bean property 'entityManagerFactory'; nested exception is
> org.springframework.beans.factory.BeanCreationException: Error 
> creating bean with name 'bidSpecEntityManagerFactory' defined in file 
> [/BidSpec/applications/emall/target/test-classes/
> applicationContext.xml]:
> Invocation of init method failed; nested exception is
> javax.persistence.PersistenceException: Exception [TOPLINK-28018] 
> (Oracle TopLink Essentials - 2.0 (Build 40 (03/21/2007))):
> oracle.toplink.essentials.exceptions.EntityManagerSetupException
> Exception Description: predeploy for PersistenceUnit 
> [BidSpecPersistenceUnit] failed.
> Internal Exception: Exception [TOPLINK-7152] (Oracle TopLink 
> Essentials - 2.0 (Build 40 (03/21/2007))):
> oracle.toplink.essentials.exceptions.ValidationException
> Exception Description: Table per class inheritance is not supported. 
> Entity class [class ca.BidSpec.emall.categories.AttributeType].
> Caused by: org.springframework.beans.factory.BeanCreationException:  
> Error
> creating bean with name 'bidSpecEntityManagerFactory' defined in file 
> [/BidSpec/applications/emall/target/test-classes/
> applicationContext.xml]:
> Invocation of init method failed; nested exception is
> javax.persistence.PersistenceException: Exception [TOPLINK-28018] 
> (Oracle TopLink Essentials - 2.0 (Build 40 (03/21/2007))):
> oracle.toplink.essentials.exceptions.EntityManagerSetupException
> Exception Description: predeploy for PersistenceUnit 
> [BidSpecPersistenceUnit] failed.
> Internal Exception: Exception [TOPLINK-7152] (Oracle TopLink 
> Essentials - 2.0 (Build 40 (03/21/2007))):
> oracle.toplink.essentials.exceptions.ValidationException
> Exception Description: Table per class inheritance is not supported. 
> Entity class [class ca.BidSpec.emall.categories.AttributeType].
> Caused by: javax.persistence.PersistenceException: Exception 
> [TOPLINK-28018] (Oracle TopLink Essentials - 2.0 (Build 40 
> (03/21/2007))):
> oracle.toplink.essentials.exceptions.EntityManagerSetupException
> Exception Description: predeploy for PersistenceUnit 
> [BidSpecPersistenceUnit] failed.
> Internal Exception: Exception [TOPLINK-7152] (Oracle TopLink 
> Essentials - 2.0 (Build 40 (03/21/2007))):
> oracle.toplink.essentials.exceptions.ValidationException
> Exception Description: Table per class inheritance is not supported. 
> Entity class [class ca.BidSpec.emall.categories.AttributeType].
> at
> oracle.toplink.essentials.internal.ejb.cmp3.EntityManagerSetupImpl.pre
> deploy(Ent
> ityManagerSetupImpl.java:615)
> at
> oracle.toplink.essentials.ejb.cmp3.EntityManagerFactoryProvider.create
> ContainerE
> ntityManagerFactory(EntityManagerFactoryProvider.java:178)
> at
> org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean.cre
> ateNativeE
> ntityManagerFactory(LocalContainerEntityManagerFactoryBean.java:214)
> at
> org.springframework.orm.jpa.AbstractEntityManagerFactoryBean.afterProp
> ertiesSet(
> AbstractEntityManagerFactoryBean.java:251)
> at
> org.springframework.beans.factory.support.AbstractAutowireCapableBeanF
> actory.inv
> okeInitMethods(AbstractAutowireCapableBeanFactory.java:1143)
> at
> org.springframework.beans.factory.support.AbstractAutowireCapableBeanF
> actory.ini
> tializeBean(AbstractAutowireCapableBeanFactory.java:1110)
> at
> org.springframework.beans.factory.support.AbstractAutowireCapableBeanF
> actory.cre
> ateBean(AbstractAutowireCapableBeanFactory.java:431)
> at
> org.springframework.beans.factory.support.AbstractBeanFactory
> $1.getObject(Abstra
> ctBeanFactory.java:254)
> at
> org.springframework.beans.factory.support.DefaultSingletonBeanRegistry
> .getSingle
> ton(DefaultSingletonBeanRegistry.java:144)
> at
> org.springframework.beans.factory.support.AbstractBeanFactory.getBean(
> AbstractBe
> anFactory.java:251)
> at
> org.springframework.beans.factory.support.AbstractBeanFactory.getBean(
> AbstractBe
> anFactory.java:163)
> at
> org.springframework.beans.factory.support.BeanDefinitionValueResolver. 
> resolveRef
> erence(BeanDefinitionValueResolver.java:271)
> at
> org.springframework.beans.factory.support.BeanDefinitionValueResolver. 
> resolveVal
> ueIfNecessary(BeanDefinitionValueResolver.java:128)
> at
> org.springframework.beans.factory.support.AbstractAutowireCapableBeanF
> actory.app
> lyPropertyValues(AbstractAutowireCapableBeanFactory.java:1047)
> at
> org.springframework.beans.factory.support.AbstractAutowireCapableBeanF
> actory.pop
> ulateBean(AbstractAutowireCapableBeanFactory.java:843)
> at
> org.springframework.beans.factory.support.AbstractAutowireCapableBeanF
> actory.cre
> ateBean(AbstractAutowireCapableBeanFactory.java:427)
> at
> org.springframework.beans.factory.support.AbstractBeanFactory
> $1.getObject(Abstra
> ctBeanFactory.java:254)
> at
> org.springframework.beans.factory.support.DefaultSingletonBeanRegistry
> .getSingle
> ton(DefaultSingletonBeanRegistry.java:144)
> at
> org.springframework.beans.factory.support.AbstractBeanFactory.getBean(
> AbstractBe
> anFactory.java:251)
> at
> org.springframework.beans.factory.support.AbstractBeanFactory.getBean(
> AbstractBe
> anFactory.java:163)
> at
> org.springframework.beans.factory.support.AbstractAutowireCapableBeanF
> actory.aut
> owireByName(AbstractAutowireCapableBeanFactory.java:862)
> at
> org.springframework.beans.factory.support.AbstractAutowireCapableBeanF
> actory.pop
> ulateBean(AbstractAutowireCapableBeanFactory.java:810)
> at
> org.springframework.beans.factory.support.AbstractAutowireCapableBeanF
> actory.aut
> owireBeanProperties(AbstractAutowireCapableBeanFactory.java:273)
> at
> org.springframework.test.AbstractDependencyInjectionSpringContextTests
> .injectDep
> endencies(AbstractDependencyInjectionSpringContextTests.java:179)
> at
> org.springframework.test.AbstractDependencyInjectionSpringContextTests
> .prepareTe
> stInstance(AbstractDependencyInjectionSpringContextTests.java:158)
> at
> org.springframework.test.AbstractSingleSpringContextTests.setUp
> (AbstractSingleSp
> ringContextTests.java:88)
> at junit.framework.TestCase.runBare(TestCase.java:132)
> at
> org.springframework.test.ConditionalTestCase.runBare
> (ConditionalTestCase.java:69
> )
> at
> org.springframework.test.annotation.AbstractAnnotationAwareTransaction
> alTests.ac
> cess$001(AbstractAnnotationAwareTransactionalTests.java:47)
> at
> org.springframework.test.annotation.AbstractAnnotationAwareTransaction
> alTests$1.
> run(AbstractAnnotationAwareTransactionalTests.java:115)
> at
> org.springframework.test.annotation.AbstractAnnotationAwareTransaction
> alTests.ru
> nTest(AbstractAnnotationAwareTransactionalTests.java:180)
> at
> org.springframework.test.annotation.AbstractAnnotationAwareTransaction
> alTests.ru
> nTestTimed(AbstractAnnotationAwareTransactionalTests.java:153)
> at
> org.springframework.test.annotation.AbstractAnnotationAwareTransaction
> alTests.ru
> nBare(AbstractAnnotationAwareTransactionalTests.java:111)
> at
> org.springframework.test.jpa.AbstractJpaTests.runBare
> (AbstractJpaTests.java:159)
> at
> org.springframework.test.jpa.AbstractJpaTests.runBare
> (AbstractJpaTests.java:239)
> 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:35)
> at org.apache.maven.surefire.junit4.JUnit4TestSet.execute
> (JUnit4TestSet.java:62)
> at
> org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.executeTest
> Set(Abstra
> ctDirectoryTestSuite.java:138)
> at
> org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.execute
> (AbstractDirec
> toryTestSuite.java:125)
> at org.apache.maven.surefire.Surefire.run(Surefire.java:132)
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at 
> sun.reflect.NativeMethodAccessorImpl.invoke
> (NativeMethodAccessorImpl.java:39)
> at
> sun.reflect.DelegatingMethodAccessorImpl.invoke
> (DelegatingMethodAccessorImpl.jav
> a:25)
> at java.lang.reflect.Method.invoke(Method.java:585)
> at
> org.apache.maven.surefire.booter.SurefireBooter.runSuitesInProcess
> (SurefireBoote
> r.java:290)
> at org.apache.maven.surefire.booter.SurefireBooter.main
> (SurefireBooter.java:818)
> Caused by: Exception [TOPLINK-28018] (Oracle TopLink Essentials - 2.0 
> (Build 40
> (03/21/2007))):  
> oracle.toplink.essentials.exceptions.EntityManagerSetupException
> Exception Description: predeploy for PersistenceUnit 
> [BidSpecPersistenceUnit] failed.
> Internal Exception: Exception [TOPLINK-7152] (Oracle TopLink 
> Essentials - 2.0 (Build 40 (03/21/2007))):
> oracle.toplink.essentials.exceptions.ValidationException
> Exception Description: Table per class inheritance is not supported. 
> Entity class [class ca.BidSpec.emall.categories.AttributeType].
> at
> oracle.toplink.essentials.exceptions.EntityManagerSetupException.prede
> ployFailed
> (EntityManagerSetupException.java:212)
> ... 52 more
> Caused by: Exception [TOPLINK-7152] (Oracle TopLink Essentials - 2.0 
> (Build 40
> (03/21/2007))):  
> oracle.toplink.essentials.exceptions.ValidationException
> Exception Description: Table per class inheritance is not supported. 
> Entity class [class ca.BidSpec.emall.categories.AttributeType].
> at
> oracle.toplink.essentials.exceptions.ValidationException.tablePerClass
> Inheritanc
> eNotSupported(ValidationException.java:1422)
> at
> oracle.toplink.essentials.internal.ejb.cmp3.metadata.MetadataValidator
> .throwTabl
> ePerClassInheritanceNotSupported(MetadataValidator.java:372)
> at
> oracle.toplink.essentials.internal.ejb.cmp3.metadata.MetadataDescripto
> r.setInher
> itanceStrategy(MetadataDescriptor.java:901)
> at
> oracle.toplink.essentials.internal.ejb.cmp3.metadata.accessors.ClassAc
> cessor.pro
> cessInheritance(ClassAccessor.java:952)
> at
> oracle.toplink.essentials.internal.ejb.cmp3.metadata.accessors.ClassAc
> cessor.pro
> cessTableAndInheritance(ClassAccessor.java:1412)
> at
> oracle.toplink.essentials.internal.ejb.cmp3.metadata.accessors.ClassAc
> cessor.pro
> cess(ClassAccessor.java:464)
> at
> oracle.toplink.essentials.internal.ejb.cmp3.metadata.MetadataProcessor
> .processAn
> notations(MetadataProcessor.java:225)
> at
> oracle.toplink.essentials.ejb.cmp3.persistence.PersistenceUnitProcesso
> r.processO
> RMetadata(PersistenceUnitProcessor.java:354)
> at
> oracle.toplink.essentials.internal.ejb.cmp3.EntityManagerSetupImpl.pre
> deploy(Ent
> ityManagerSetupImpl.java:584)
> ... 51 more
> </code>
>
>
>
> -----Original Message-----
> From: Marc Prud'hommeaux [mailto:mprudhomapache@gmail.com] On Behalf 
> Of Marc Prud'hommeaux
> Sent: March 25, 2007 1:18 PM
> To: open-jpa-dev@incubator.apache.org
> Subject: Re: OPEN-JPA and Toplink 2.0.XX
>
> Phill-
>
> I'm a little confused. Is this an error from OpenJPA or TopLink?  
> Can you post
> the entire stack trace of the error you are seeing?
>
>
>
> On Mar 25, 2007, at 10:03 AM, Phill Moran wrote:
>
>> I have been struggling with an exception when running my JUnit 4.2 
>> tests. It complains about not supporting table per class inheritance 
>> not supported when running under Maven. I was not getting the same 
>> error when I ran all the same code and and tests under eclipse. The 
>> only difference was I was using the older
>> 9.1 versions of toplink/toplink agent jars. When I switched my 
>> dependency to the
>> 9.1 in Maven the problem went away.
>>
>> I am assuming this is a bug in the new 2.0.X.X toplink jars. I am not 
>> sure if this has been flagged although I know it is not in Jira for 
>> 0.96.
>>
>> Phill
>


Mime
View raw message