openjpa-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Rick Curtis <curti...@gmail.com>
Subject Re: ArgumentException/NPE when running code enhanced using eclipse tooling builder
Date Tue, 02 Nov 2010 20:48:58 GMT
>I am getting an exception when running my code (either as a JUnit test or
on tomcat) after using the OpenJPA eclipse tooling builder.
> I also should note that when using the maven enhancer plugin from console,
everything works fine.
I haven't used the eclipse builder, but those two comments lead me to
believe that the eclipse tooling is packaged with a downlevel of OpenJPA.
Maybe someone else on the list will have some more information?

> or the SQL statements where the params are set to ? as shown below
Try setting this property [1]
"openjpa.ConnectionFactoryProperties=PrintParameters=True" to see the SQL
parameter properties.

> INFO:The Entity "com.myproject.entities.MyEntry" was enhanced at level
"2", but the current level of enhancement is "961.774".
The "961.774" part of that message confuses me. It should be 961771. Could
you post your enhanced Entity so I can take a look at it?

Thanks,
Rick

[1]
http://openjpa.apache.org/builds/latest/docs/manual/manual.html#ref_guide_logging_channels

On Sun, Oct 31, 2010 at 1:36 PM, Marco Zapletal <marco.zapletal@gmail.com>wrote:

> Hello,
>
> I am getting an exception when running my code (either as a JUnit test or
> on
> tomcat) after using the OpenJPA eclipse tooling builder. Although,
> according
> to the logging in eclipse, the builder has successfully enhanced the
> respective class files either of the two exceptions
> http://pastebin.com/mzNuYsmm or http://pastebin.com/cXedqAm5 are thrown
> depending on the entity to be persisted (I also attach the exceptions
> below).
>
> Furthermore, log entries such as
>
> INFO:The Entity "com.myproject.entities.MyEntry" was enhanced at level "2",
> but the current level of enhancement is "961.774".
>
> or the SQL statements where the params are set to ? as shown below
>
> TRACE:<t 5615544, conn 1581923> executing prepstmnt 12279445 UPDATE
> OPENJPA_SEQUENCE_TABLE SET SEQUENCE_VALUE = ? WHERE ID = ? AND
> SEQUENCE_VALUE = ? [params=?, ?, ?]
>
> seem suspicious.
>
> I also should note that when using the maven enhancer plugin from console,
> everything works fine.
>
> Any help would be highly appreciated.
>
> Thanks,
> marco
>
>
> Exception 1:
>
> <openjpa-2.1.0-SNAPSHOT-r422266:1028880 fatal user error>
> org.apache.openjpa.persistence.ArgumentException: Errors encountered while
> resolving metadata.  See nested exceptions for details.
>    at
>
> org.apache.openjpa.meta.MetaDataRepository.resolve(MetaDataRepository.java:657)
>    at
>
> org.apache.openjpa.meta.MetaDataRepository.getMetaDataInternal(MetaDataRepository.java:400)
>    at
>
> org.apache.openjpa.meta.MetaDataRepository.getMetaData(MetaDataRepository.java:373)
>    at org.apache.openjpa.kernel.BrokerImpl.persist(BrokerImpl.java:2576)
>    at org.apache.openjpa.kernel.BrokerImpl.persist(BrokerImpl.java:2431)
>    at
>
> org.apache.openjpa.kernel.DelegatingBroker.persist(DelegatingBroker.java:1069)
>    at
>
> org.apache.openjpa.persistence.EntityManagerImpl.persist(EntityManagerImpl.java:706)
>    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.springframework.orm.jpa.SharedEntityManagerCreator$SharedEntityManagerInvocationHandler.invoke(SharedEntityManagerCreator.java:240)
>    at $Proxy30.persist(Unknown Source)
>    at com.myproject.persistence.MyService.persistEntry(MyService.java:60)
>    at
>
> com.myproject.persistence.MyService$$FastClassByCGLIB$$9e02e5e4.invoke(<generated>)
>    at net.sf.cglib.proxy.MethodProxy.invoke(MethodProxy.java:149)
>    at
>
> org.springframework.aop.framework.Cglib2AopProxy$CglibMethodInvocation.invokeJoinpoint(Cglib2AopProxy.java:688)
>    at
>
> org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:150)
>    at
>
> org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:110)
>    at
>
> org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
>    at
>
> org.springframework.aop.framework.Cglib2AopProxy$DynamicAdvisedInterceptor.intercept(Cglib2AopProxy.java:621)
>    at
>
> com.myproject.persistence.MyService$$EnhancerByCGLIB$$6533f58a.persistMessage(<generated>)
>    at
>
> com.myproject.testing.persistence.MyServiceTest.persistEmptyEntry(MyServiceTest.java:95)
>    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.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:44)
>    at
>
> org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15)
>    at
>
> org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:41)
>    at
>
> org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:20)
>    at
>
> org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:28)
>    at
>
> org.springframework.test.context.junit4.statements.RunBeforeTestMethodCallbacks.evaluate(RunBeforeTestMethodCallbacks.java:74)
>    at
>
> org.springframework.test.context.junit4.statements.RunAfterTestMethodCallbacks.evaluate(RunAfterTestMethodCallbacks.java:82)
>    at
>
> org.springframework.test.context.junit4.statements.SpringRepeat.evaluate(SpringRepeat.java:72)
>    at
>
> org.springframework.test.context.junit4.SpringJUnit4ClassRunner.runChild(SpringJUnit4ClassRunner.java:240)
>    at
>
> org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:50)
>    at org.junit.runners.ParentRunner$3.run(ParentRunner.java:193)
>    at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:52)
>    at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:191)
>    at org.junit.runners.ParentRunner.access$000(ParentRunner.java:42)
>    at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:184)
>    at
>
> org.springframework.test.context.junit4.statements.RunBeforeTestClassCallbacks.evaluate(RunBeforeTestClassCallbacks.java:61)
>    at
>
> org.springframework.test.context.junit4.statements.RunAfterTestClassCallbacks.evaluate(RunAfterTestClassCallbacks.java:70)
>    at org.junit.runners.ParentRunner.run(ParentRunner.java:236)
>    at
>
> org.springframework.test.context.junit4.SpringJUnit4ClassRunner.run(SpringJUnit4ClassRunner.java:180)
>    at
>
> org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:46)
>    at
>
> org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
>    at
>
> org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467)
>    at
>
> org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683)
>    at
>
> org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390)
>    at
>
> org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197)
> Caused by: java.lang.IllegalArgumentException
>    at com.myproject.entities.MyEntry.pcProvideField(MyEntry.java)
>    at
>
> org.apache.openjpa.meta.ProxySetupStateManager.setProxyData(ProxySetupStateManager.java:54)
>    at
> org.apache.openjpa.meta.ClassMetaData.resolveMeta(ClassMetaData.java:1915)
>    at
> org.apache.openjpa.meta.ClassMetaData.resolve(ClassMetaData.java:1796)
>    at
>
> org.apache.openjpa.meta.MetaDataRepository.processBuffer(MetaDataRepository.java:811)
>    at
>
> org.apache.openjpa.meta.MetaDataRepository.resolveMeta(MetaDataRepository.java:708)
>    at
>
> org.apache.openjpa.meta.MetaDataRepository.resolve(MetaDataRepository.java:632)
>    ... 51 more
>
>
>
> Exception 2:
>
>
>
> java.lang.NullPointerException: null keys not allowed
>    at
>
> org.apache.commons.collections.map.AbstractReferenceMap.put(AbstractReferenceMap.java:249)
>    at
>
> org.apache.openjpa.kernel.ManagedCache.assignObjectId(ManagedCache.java:189)
>    at
> org.apache.openjpa.kernel.BrokerImpl.assignObjectId(BrokerImpl.java:4969)
>    at
> org.apache.openjpa.kernel.BrokerImpl.setStateManager(BrokerImpl.java:4052)
>    at
>
> org.apache.openjpa.kernel.StateManagerImpl.assertObjectIdAssigned(StateManagerImpl.java:636)
>    at
>
> org.apache.openjpa.kernel.StateManagerImpl.assignObjectId(StateManagerImpl.java:607)
>    at
>
> org.apache.openjpa.kernel.StateManagerImpl.assignField(StateManagerImpl.java:696)
>    at
>
> org.apache.openjpa.kernel.StateManagerImpl.beforeAccessField(StateManagerImpl.java:1608)
>    at
>
> org.apache.openjpa.kernel.StateManagerImpl.accessingField(StateManagerImpl.java:1591)
>    at com.myproject.entities.Bla.pcGetdb_key(Bla.java)
>    at com.myproject.entities.Bla.getDb_key(Bla.java:22)
>    at
>
> com.myproject.testing.persistence.MyServiceTest.persistBla(MyServiceTest.java:84)
>    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.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:44)
>    at
>
> org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15)
>    at
>
> org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:41)
>    at
>
> org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:20)
>    at
>
> org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:28)
>    at
>
> org.springframework.test.context.junit4.statements.RunBeforeTestMethodCallbacks.evaluate(RunBeforeTestMethodCallbacks.java:74)
>    at
>
> org.springframework.test.context.junit4.statements.RunAfterTestMethodCallbacks.evaluate(RunAfterTestMethodCallbacks.java:82)
>    at
>
> org.springframework.test.context.junit4.statements.SpringRepeat.evaluate(SpringRepeat.java:72)
>    at
>
> org.springframework.test.context.junit4.SpringJUnit4ClassRunner.runChild(SpringJUnit4ClassRunner.java:240)
>    at
>
> org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:50)
>    at org.junit.runners.ParentRunner$3.run(ParentRunner.java:193)
>    at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:52)
>    at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:191)
>    at org.junit.runners.ParentRunner.access$000(ParentRunner.java:42)
>    at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:184)
>    at
>
> org.springframework.test.context.junit4.statements.RunBeforeTestClassCallbacks.evaluate(RunBeforeTestClassCallbacks.java:61)
>    at
>
> org.springframework.test.context.junit4.statements.RunAfterTestClassCallbacks.evaluate(RunAfterTestClassCallbacks.java:70)
>    at org.junit.runners.ParentRunner.run(ParentRunner.java:236)
>    at
>
> org.springframework.test.context.junit4.SpringJUnit4ClassRunner.run(SpringJUnit4ClassRunner.java:180)
>    at
>
> org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:46)
>    at
>
> org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
>    at
>
> org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467)
>    at
>
> org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683)
>    at
>
> org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390)
>    at
>
> org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197)
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message