openjpa-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Christopher Schmidt <fakod...@googlemail.com>
Subject Re: identity class IllegalArgumentException
Date Wed, 09 Jun 2010 18:07:19 GMT
Pinaki, here we go (last caused by):

java.lang.IllegalArgumentException: Error while setting value
org.pf4mip.persistence.popo.Organisation@3429cf1 of class
org.pf4mip.persistence.popo.Organisation on field private
java.math.BigInteger
org.pf4mip.persistence.popo.OrganisationStructureId.orgStructRootOrg
of instance org.pf4mip.persistence.popo.OrganisationStructureId@0 by
reflection.
	at org.apache.openjpa.enhance.Reflection.wrapReflectionException(Reflection.java:334)
	at org.apache.openjpa.enhance.Reflection.set(Reflection.java:540)
	at org.apache.openjpa.enhance.org$pf4mip$persistence$popo$OrganisationStructure$pcsubclass.pcCopyKeyFieldsToObjectId(Unknown
Source)
	at org.apache.openjpa.enhance.PCRegistry.copyKeyFieldsToObjectId(PCRegistry.java:166)
	at org.apache.openjpa.util.ApplicationIds.fromPKValues(ApplicationIds.java:218)
	at org.apache.openjpa.enhance.ReflectingPersistenceCapable.pcNewObjectIdInstance(ReflectingPersistenceCapable.java:277)
	at org.apache.openjpa.util.ApplicationIds.create(ApplicationIds.java:421)
	at org.apache.openjpa.kernel.BrokerImpl.persist(BrokerImpl.java:2576)
	at org.apache.openjpa.kernel.BrokerImpl.persist(BrokerImpl.java:2423)
	at org.apache.openjpa.kernel.DelegatingBroker.persist(DelegatingBroker.java:1069)
	at org.apache.openjpa.persistence.EntityManagerImpl.persist(EntityManagerImpl.java:705)
	at org.jpaextension.manager.EntityManagerWrapper$class.persistAndFlush(EntityManagerWrapper.scala:114)
	at org.jpaextension.test.OrgStructTest.persistAndFlush(OrgStructTest.scala:16)
	at org.jpaextension.test.OrgStructTest$$anonfun$1$$anonfun$apply$2$$anonfun$apply$mcV$sp$2$$anonfun$apply$mcV$sp$3.apply(OrgStructTest.scala:54)
	at org.jpaextension.test.OrgStructTest$$anonfun$1$$anonfun$apply$2$$anonfun$apply$mcV$sp$2$$anonfun$apply$mcV$sp$3.apply(OrgStructTest.scala:49)
	at scala.collection.Iterator$class.foreach(Iterator.scala:631)
	at scala.collection.JavaConversions$JIteratorWrapper.foreach(JavaConversions.scala:474)
	at scala.collection.IterableLike$class.foreach(IterableLike.scala:79)
	at scala.collection.JavaConversions$JListWrapper.foreach(JavaConversions.scala:521)
	at org.jpaextension.test.OrgStructTest$$anonfun$1$$anonfun$apply$2$$anonfun$apply$mcV$sp$2.apply$mcV$sp(OrgStructTest.scala:48)
	at org.jpaextension.test.OrgStructTest$$anonfun$1$$anonfun$apply$2$$anonfun$apply$mcV$sp$2.apply(OrgStructTest.scala:48)
	at org.jpaextension.test.OrgStructTest$$anonfun$1$$anonfun$apply$2$$anonfun$apply$mcV$sp$2.apply(OrgStructTest.scala:48)
	at org.jpaextension.manager.UsesEntityManager$class.withTrxAndCommit(UsesEntityManager.scala:39)
	at org.jpaextension.test.OrgStructTest.withTrxAndCommit(OrgStructTest.scala:16)
	at org.jpaextension.test.OrgStructTest$$anonfun$1$$anonfun$apply$2.apply$mcV$sp(OrgStructTest.scala:47)
	at org.jpaextension.test.OrgStructTest$$anonfun$1$$anonfun$apply$2.apply(OrgStructTest.scala:45)
	at org.jpaextension.test.OrgStructTest$$anonfun$1$$anonfun$apply$2.apply(OrgStructTest.scala:45)
	at org.specs.specification.LifeCycle$class.withCurrent(ExampleLifeCycle.scala:60)
	at org.specs.specification.Examples.withCurrent(Examples.scala:52)
	at org.specs.specification.Examples$$anonfun$specifyExample$1.apply(Examples.scala:108)
	at org.specs.specification.Examples$$anonfun$specifyExample$1.apply(Examples.scala:108)
	at org.specs.specification.ExampleExecution$$anonfun$3$$anonfun$apply$5.apply(ExampleLifeCycle.scala:214)
	at scala.Option.getOrElse(Option.scala:59)
	at org.specs.specification.LifeCycle$class.executeExpectations(ExampleLifeCycle.scala:82)
	at org.specs.specification.BaseSpecification.executeExpectations(BaseSpecification.scala:58)
	at org.specs.specification.ExampleContext$$anonfun$executeExpectations$2$$anonfun$apply$3$$anonfun$apply$4.apply(ExampleContext.scala:73)
	at org.specs.specification.ExampleContext$$anonfun$executeExpectations$2$$anonfun$apply$3$$anonfun$apply$4.apply(ExampleContext.scala:73)
	at scala.Option.map(Option.scala:74)
	at org.specs.specification.ExampleContext$$anonfun$executeExpectations$2$$anonfun$apply$3.apply(ExampleContext.scala:73)
	at org.specs.specification.ExampleContext$$anonfun$executeExpectations$2$$anonfun$apply$3.apply(ExampleContext.scala:73)
	at org.specs.specification.ExampleContext$class.id$1(ExampleContext.scala:32)
	at org.specs.specification.ExampleContext$$anonfun$1.apply(ExampleContext.scala:33)
	at org.specs.specification.ExampleContext$$anonfun$1.apply(ExampleContext.scala:33)
	at org.specs.specification.ExampleContext$$anonfun$executeExpectations$2.apply(ExampleContext.scala:73)
	at org.specs.specification.ExampleContext$$anonfun$executeExpectations$2.apply(ExampleContext.scala:72)
	at scala.Option.map(Option.scala:74)
	at org.specs.specification.ExampleContext$class.executeExpectations(ExampleContext.scala:72)
	at org.specs.specification.Examples.executeExpectations(Examples.scala:52)
	at org.specs.specification.ExampleContext$$anonfun$executeExpectations$2$$anonfun$apply$3$$anonfun$apply$4.apply(ExampleContext.scala:73)
	at org.specs.specification.ExampleContext$$anonfun$executeExpectations$2$$anonfun$apply$3$$anonfun$apply$4.apply(ExampleContext.scala:73)
	at scala.Option.map(Option.scala:74)
	at org.specs.specification.ExampleContext$$anonfun$executeExpectations$2$$anonfun$apply$3.apply(ExampleContext.scala:73)
	at org.specs.specification.ExampleContext$$anonfun$executeExpectations$2$$anonfun$apply$3.apply(ExampleContext.scala:73)
	at org.specs.specification.ExampleContext$class.id$1(ExampleContext.scala:32)
	at org.specs.specification.ExampleContext$$anonfun$1.apply(ExampleContext.scala:33)
	at org.specs.specification.ExampleContext$$anonfun$1.apply(ExampleContext.scala:33)
	at org.specs.specification.ExampleContext$$anonfun$executeExpectations$2.apply(ExampleContext.scala:73)
	at org.specs.specification.ExampleContext$$anonfun$executeExpectations$2.apply(ExampleContext.scala:72)
	at scala.Option.map(Option.scala:74)
	at org.specs.specification.ExampleContext$class.executeExpectations(ExampleContext.scala:72)
	at org.specs.specification.Examples.executeExpectations(Examples.scala:52)
	at org.specs.specification.ExampleExecution$$anonfun$3.apply(ExampleLifeCycle.scala:214)
	at org.specs.specification.ExampleExecution$$anonfun$3.apply(ExampleLifeCycle.scala:193)
	at org.specs.specification.ExampleExecution$$anonfun$2.apply(ExampleLifeCycle.scala:176)
	at org.specs.specification.ExampleExecution.execute(ExampleLifeCycle.scala:247)
	at org.specs.specification.Examples$$anonfun$executeThis$1.apply(Examples.scala:71)
	at org.specs.specification.Examples$$anonfun$executeThis$1.apply(Examples.scala:71)
	at scala.Option.map(Option.scala:74)
	at org.specs.specification.Examples.executeThis(Examples.scala:71)
	at org.specs.specification.ExampleLifeCycle$class.executeExample(ExampleLifeCycle.scala:118)
	at org.specs.specification.Examples.executeExample(Examples.scala:52)
	at org.specs.specification.Examples.executeExample(Examples.scala:52)
	at org.specs.specification.Examples$$anonfun$executeExamples$1.apply(Examples.scala:80)
	at org.specs.specification.Examples$$anonfun$executeExamples$1.apply(Examples.scala:80)
	at scala.Option.map(Option.scala:74)
	at org.specs.specification.Examples.executeExamples(Examples.scala:80)
	at org.specs.specification.ExampleStructure$class.ownSkipped(ExampleStructure.scala:60)
	at org.specs.specification.Examples.ownSkipped(Examples.scala:52)
	at org.specs.runner.ExampleTestCase.run(JUnit.scala:197)
	at junit.framework.TestSuite.runTest(TestSuite.java:232)
	at junit.framework.TestSuite.run(TestSuite.java:227)
	at org.specs.runner.JUnitSuite$class.run(JUnit.scala:62)
	at org.specs.runner.ExamplesTestSuite.run(JUnit.scala:164)
	at junit.framework.TestSuite.runTest(TestSuite.java:232)
	at junit.framework.TestSuite.run(TestSuite.java:227)
	at org.specs.runner.JUnitSuite$class.run(JUnit.scala:62)
	at org.specs.SpecificationWithJUnit.run(SpecificationWithJUnit.scala:29)
	at org.specs.runner.JUnitSuiteRunner.run(JUnitSuiteRunner.scala:45)
	at org.apache.maven.surefire.junit4.JUnit4TestSet.execute(JUnit4TestSet.java:62)
	at org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.executeTestSet(AbstractDirectoryTestSuite.java:140)
	at org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.execute(AbstractDirectoryTestSuite.java:127)
	at org.apache.maven.surefire.Surefire.run(Surefire.java:177)
	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:597)
	at org.apache.maven.surefire.booter.SurefireBooter.runSuitesInProcess(SurefireBooter.java:345)
	at org.apache.maven.surefire.booter.SurefireBooter.main(SurefireBooter.java:1009)


JPAExtension is my code and test class (Scala) is here:
http://github.com/FaKod/JPA-for-Scala/blob/UsingScalaDAOs/src/test/scala/org/jpaextension/test/OrgStructTest.scala


Thx for help.
Christopher

On Wed, Jun 9, 2010 at 7:24 PM, Pinaki Poddar <ppoddar@apache.org> wrote:
>
>> org.pf4mip.persistence.popo.OrganisationStructureId.orgStructRootOrg
>> of instance org.pf4mip.persistence.popo.OrganisationStructureId@0 by
>> reflection.
>>        at
>> org.apache.openjpa.enhance.Reflection.wrapReflectionException(Reflection.java:334)
>>        at org.apache.openjpa.enhance.Reflection.set(Reflection.java:540)
>>        ... 96 more
>
>> I think OpenJPA tries to put an Organisation into the BigInt field. Any
>> advice?
>
> Can I see few more (10-20 lines) of that 96 lines stack traces?
>
> -----
> Pinaki
> --
> View this message in context: http://openjpa.208410.n2.nabble.com/identity-class-IllegalArgumentException-tp5159262p5159535.html
> Sent from the OpenJPA Users mailing list archive at Nabble.com.
>

Mime
View raw message