Jeffrey-

Hmm ... that's an odd one. Do you have more than one field marked as the primary key (@Id)? If so, do you have an identity class defined for the entity?

Maybe if you can just paste the code for the entity into an e-mail, something might jump out at us.



On Aug 1, 2007, at 7:56 PM, Jeffrey Blattman wrote:

hi marc,

yes setting the query compilation flag to false made that error go away. however, now i get the trace below, which looks even scarier.

any ideas? i can make my project available if anyone wants to try it locally.

0.9.7-incubating nonfatal general error> org.apache.openjpa.persistence.PersistenceException: 1 at org.apache.openjpa.kernel.BrokerImpl.newObjectId (BrokerImpl.java:1115) at org.apache.openjpa.kernel.DelegatingBroker.newObjectId (DelegatingBroker.java:257) at org.apache.openjpa.persistence.EntityManagerImpl.find (EntityManagerImpl.java:348) at com.sun.portal.pom.PersistTest.removeEntity (PersistTest.java:156)
       at com.sun.portal.pom.PersistTest.cleanup(PersistTest.java:211)
at com.sun.portal.pom.PersistTest.testPersist (PersistTest.java:220)
       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:154)
       at junit.framework.TestCase.runBare(TestCase.java:127)
       at junit.framework.TestResult$1.protect(TestResult.java:106)
       at junit.framework.TestResult.runProtected(TestResult.java:124)
       at junit.framework.TestResult.run(TestResult.java:109)
       at junit.framework.TestCase.run(TestCase.java:118)
       at junit.framework.TestSuite.runTest(TestSuite.java:208)
       at junit.framework.TestSuite.run(TestSuite.java:203)
       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.maven.surefire.junit.JUnitTestSet.execute (JUnitTestSet.java:213) at org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.executeTest Set(AbstractDirectoryTestSuite.java:138) at org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.execute (AbstractDirectoryTestSuite.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.java:25)
       at java.lang.reflect.Method.invoke(Method.java:585)
at org.apache.maven.surefire.booter.SurefireBooter.runSuitesInProcess (SurefireBooter.java:290) at org.apache.maven.surefire.booter.SurefireBooter.main (SurefireBooter.java:818)
Caused by: java.lang.ArrayIndexOutOfBoundsException: 1
at org.apache.openjpa.util.ApplicationIds $PrimaryKeyFieldManager.retrieve(ApplicationIds.java:544) at org.apache.openjpa.util.ApplicationIds $PrimaryKeyFieldManager.fetchStringField(ApplicationIds.java:532) at com.sun.portal.pom.Entity.pcCopyKeyFieldsToObjectId (Entity.java) at org.apache.openjpa.enhance.PCRegistry.copyKeyFieldsToObjectId (PCRegistry.java:160) at org.apache.openjpa.util.ApplicationIds.fromPKValues (ApplicationIds.java:180) at org.apache.openjpa.kernel.BrokerImpl.newObjectId (BrokerImpl.java:1105)

Marc Prud'hommeaux wrote:
Jeffrey-

That does look like a bug (although not one I've ever seen when having a dependency on openjpa).

If you set the property "openjpa.QueryCompilationCache" to "false", do you still see the error?



On Aug 1, 2007, at 6:52 PM, Jeffrey Blattman wrote:

hi,

this is on 0.9.7-incubating. i am trying to use openjpa in a unit test from a maven2 project. i am depending on "openjpa-all" as a "compile" type dependency. when my unit test runs, i see the stack trace below.

CacheMap is in the openjpa-all-0.9.7-incubating.jar file in .m2/ repository ...

i see issue 256:
https://issues.apache.org/jira/browse/OPENJPA-256? page=com.atlassian.jira.plugin.system.issuetabpanels:comment- tabpanel#action_12503158

which looks similar. is there any workaround for this?

125 pomtest INFO [main] openjpa.Runtime - Starting OpenJPA 0.9.7-incubating 615 pomtest INFO [main] openjpa.jdbc.JDBC - Using dictionary class "org.apache.openjpa.jdbc.sql.DerbyDictionary". <0.9.7-incubating nonfatal general error> org.apache.openjpa.persistence.PersistenceException: There were errors initializing your configuration: org.apache.openjpa.lib.util.ParseException: Instantiation of plugin "QueryCompilationCache" with value "true" caused an error "java.lang.IllegalArgumentException: java.lang.ClassNotFoundException: org.apache.openjpa.util.CacheMap". The alias or class name may have been misspelled (as it closely matches the valid plugin alias "true"), or the class may not be available in the class path. Valid aliases for this plugin are: [all, false, true] at org.apache.openjpa.lib.conf.Configurations.getCreateException (Configurations.java:341) at org.apache.openjpa.lib.conf.Configurations.newInstance (Configurations.java:198) at org.apache.openjpa.lib.conf.ObjectValue.newInstance (ObjectValue.java:103) at org.apache.openjpa.conf.QueryCompilationCacheValue.newInstance (QueryCompilationCacheValue.java:57) at org.apache.openjpa.lib.conf.PluginValue.instantiate (PluginValue.java:101) at org.apache.openjpa.lib.conf.ObjectValue.instantiate (ObjectValue.java:79) at org.apache.openjpa.conf.OpenJPAConfigurationImpl.getQueryCompilation CacheInstance(OpenJPAConfigurationImpl.java:1402) 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.lib.conf.ConfigurationImpl.instantiateAll (ConfigurationImpl.java:282) at org.apache.openjpa.conf.OpenJPAConfigurationImpl.instantiateAll (OpenJPAConfigurationImpl.java:1411) at org.apache.openjpa.kernel.AbstractBrokerFactory.makeReadOnly (AbstractBrokerFactory.java:547) at org.apache.openjpa.kernel.AbstractBrokerFactory.newBroker (AbstractBrokerFactory.java:157) at org.apache.openjpa.kernel.DelegatingBrokerFactory.newBroker (DelegatingBrokerFactory.java:142) at org.apache.openjpa.persistence.EntityManagerFactoryImpl.createEntity Manager(EntityManagerFactoryImpl.java:190) at org.apache.openjpa.persistence.EntityManagerFactoryImpl.createEntity Manager(EntityManagerFactoryImpl.java:143) at org.apache.openjpa.persistence.EntityManagerFactoryImpl.createEntity Manager(EntityManagerFactoryImpl.java:55) at com.sun.portal.pom.PersistTest.removeEntity (PersistTest.java:151) at com.sun.portal.pom.PersistTest.cleanup(PersistTest.java: 211) at com.sun.portal.pom.PersistTest.testPersist (PersistTest.java:220) 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:154)
       at junit.framework.TestCase.runBare(TestCase.java:127)
       at junit.framework.TestResult$1.protect(TestResult.java:106)
at junit.framework.TestResult.runProtected(TestResult.java: 124)
       at junit.framework.TestResult.run(TestResult.java:109)
       at junit.framework.TestCase.run(TestCase.java:118)
       at junit.framework.TestSuite.runTest(TestSuite.java:208)
       at junit.framework.TestSuite.run(TestSuite.java:203)
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.maven.surefire.junit.JUnitTestSet.execute (JUnitTestSet.java:213) at org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.executeTe stSet(AbstractDirectoryTestSuite.java:138) at org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.execute (AbstractDirectoryTestSuite.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.java:25)
       at java.lang.reflect.Method.invoke(Method.java:585)
at org.apache.maven.surefire.booter.SurefireBooter.runSuitesInProcess (SurefireBooter.java:290) at org.apache.maven.surefire.booter.SurefireBooter.main (SurefireBooter.java:818) Caused by: java.lang.IllegalArgumentException: java.lang.ClassNotFoundException: org.apache.openjpa.util.CacheMap
       at serp.util.Strings.toClass(Strings.java:211)
       at serp.util.Strings.toClass(Strings.java:140)
at org.apache.openjpa.lib.conf.Configurations.newInstance (Configurations.java:194)
       ... 46 more
at org.apache.openjpa.kernel.AbstractBrokerFactory.newBroker (AbstractBrokerFactory.java:193) at org.apache.openjpa.kernel.DelegatingBrokerFactory.newBroker (DelegatingBrokerFactory.java:142) at org.apache.openjpa.persistence.EntityManagerFactoryImpl.createEntity Manager(EntityManagerFactoryImpl.java:190) at org.apache.openjpa.persistence.EntityManagerFactoryImpl.createEntity Manager(EntityManagerFactoryImpl.java:143) at org.apache.openjpa.persistence.EntityManagerFactoryImpl.createEntity Manager(EntityManagerFactoryImpl.java:55) at com.sun.portal.pom.PersistTest.removeEntity (PersistTest.java:151) at com.sun.portal.pom.PersistTest.cleanup(PersistTest.java: 211) at com.sun.portal.pom.PersistTest.testPersist (PersistTest.java:220) 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:154)
       at junit.framework.TestCase.runBare(TestCase.java:127)
       at junit.framework.TestResult$1.protect(TestResult.java:106)
at junit.framework.TestResult.runProtected(TestResult.java: 124)
       at junit.framework.TestResult.run(TestResult.java:109)
       at junit.framework.TestCase.run(TestCase.java:118)
       at junit.framework.TestSuite.runTest(TestSuite.java:208)
       at junit.framework.TestSuite.run(TestSuite.java:203)
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.maven.surefire.junit.JUnitTestSet.execute (JUnitTestSet.java:213) at org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.executeTe stSet(AbstractDirectoryTestSuite.java:138) at org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.execute (AbstractDirectoryTestSuite.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.java:25)
       at java.lang.reflect.Method.invoke(Method.java:585)
at org.apache.maven.surefire.booter.SurefireBooter.runSuitesInProcess (SurefireBooter.java:290) at org.apache.maven.surefire.booter.SurefireBooter.main (SurefireBooter.java:818) Caused by: java.lang.RuntimeException: There were errors initializing your configuration: org.apache.openjpa.lib.util.ParseException: Instantiation of plugin "QueryCompilationCache" with value "true" caused an error "java.lang.IllegalArgumentException: java.lang.ClassNotFoundException: org.apache.openjpa.util.CacheMap". The alias or class name may have been misspelled (as it closely matches the valid plugin alias "true"), or the class may not be available in the class path. Valid aliases for this plugin are: [all, false, true] at org.apache.openjpa.lib.conf.Configurations.getCreateException (Configurations.java:341) at org.apache.openjpa.lib.conf.Configurations.newInstance (Configurations.java:198) at org.apache.openjpa.lib.conf.ObjectValue.newInstance (ObjectValue.java:103) at org.apache.openjpa.conf.QueryCompilationCacheValue.newInstance (QueryCompilationCacheValue.java:57) at org.apache.openjpa.lib.conf.PluginValue.instantiate (PluginValue.java:101) at org.apache.openjpa.lib.conf.ObjectValue.instantiate (ObjectValue.java:79) at org.apache.openjpa.conf.OpenJPAConfigurationImpl.getQueryCompilation CacheInstance(OpenJPAConfigurationImpl.java:1402) 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.lib.conf.ConfigurationImpl.instantiateAll (ConfigurationImpl.java:282) at org.apache.openjpa.conf.OpenJPAConfigurationImpl.instantiateAll (OpenJPAConfigurationImpl.java:1411) at org.apache.openjpa.kernel.AbstractBrokerFactory.makeReadOnly (AbstractBrokerFactory.java:547) at org.apache.openjpa.kernel.AbstractBrokerFactory.newBroker (AbstractBrokerFactory.java:157) at org.apache.openjpa.kernel.DelegatingBrokerFactory.newBroker (DelegatingBrokerFactory.java:142) at org.apache.openjpa.persistence.EntityManagerFactoryImpl.createEntity Manager(EntityManagerFactoryImpl.java:190) at org.apache.openjpa.persistence.EntityManagerFactoryImpl.createEntity Manager(EntityManagerFactoryImpl.java:143) at org.apache.openjpa.persistence.EntityManagerFactoryImpl.createEntity Manager(EntityManagerFactoryImpl.java:55) at com.sun.portal.pom.PersistTest.removeEntity (PersistTest.java:151) at com.sun.portal.pom.PersistTest.cleanup(PersistTest.java: 211) at com.sun.portal.pom.PersistTest.testPersist (PersistTest.java:220) 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:154)
       at junit.framework.TestCase.runBare(TestCase.java:127)
       at junit.framework.TestResult$1.protect(TestResult.java:106)
at junit.framework.TestResult.runProtected(TestResult.java: 124)
       at junit.framework.TestResult.run(TestResult.java:109)
       at junit.framework.TestCase.run(TestCase.java:118)
       at junit.framework.TestSuite.runTest(TestSuite.java:208)
       at junit.framework.TestSuite.run(TestSuite.java:203)
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.maven.surefire.junit.JUnitTestSet.execute (JUnitTestSet.java:213) at org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.executeTe stSet(AbstractDirectoryTestSuite.java:138) at org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.execute (AbstractDirectoryTestSuite.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.java:25)
       at java.lang.reflect.Method.invoke(Method.java:585)
at org.apache.maven.surefire.booter.SurefireBooter.runSuitesInProcess (SurefireBooter.java:290) at org.apache.maven.surefire.booter.SurefireBooter.main (SurefireBooter.java:818) Caused by: java.lang.IllegalArgumentException: java.lang.ClassNotFoundException: org.apache.openjpa.util.CacheMap
       at serp.util.Strings.toClass(Strings.java:211)
       at serp.util.Strings.toClass(Strings.java:140)
at org.apache.openjpa.lib.conf.Configurations.newInstance (Configurations.java:194)
       ... 46 more
at org.apache.openjpa.lib.conf.ConfigurationImpl.instantiateAll (ConfigurationImpl.java:296) at org.apache.openjpa.conf.OpenJPAConfigurationImpl.instantiateAll (OpenJPAConfigurationImpl.java:1411) at org.apache.openjpa.kernel.AbstractBrokerFactory.makeReadOnly (AbstractBrokerFactory.java:547) at org.apache.openjpa.kernel.AbstractBrokerFactory.newBroker (AbstractBrokerFactory.java:157)
       ... 33 more



Reply via email to