openjpa-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From David Jencks <david_jen...@yahoo.com>
Subject Sequence configuration problems
Date Wed, 25 Oct 2006 00:43:07 GMT
Working on the geronimo jpa support, I'm starting openjpa using

             entityManagerFactory =  
persistenceProvider.createContainerEntityManagerFactory 
(persistenceUnitInfo, properties);

and trying to configure the default sequence using a property in the  
persistenceUnitInfo corresponding to
<property name="openjpa.Sequence" value="table(Table=OPENJPASEQ,  
Increment=100)"/>

I get an exception:

Caused by: java.lang.IllegalArgumentException:  
java.lang.ClassNotFoundException: table in classloader  
org.apache.geronimo.configs/openjpa/1.2-SNAPSHOT/car
         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:139)
         ... 63 more

         at  
org.apache.openjpa.lib.conf.ConfigurationImpl.instantiateAll 
(ConfigurationImpl.java:278)
         at  
org.apache.openjpa.conf.OpenJPAConfigurationImpl.instantiateAll 
(OpenJPAConfigurationImpl.java:1405)
         at org.apache.openjpa.persistence.PersistenceProviderImpl 
$ClassTransformerImpl.<init>(PersistenceProviderImpl.java:134)
         at org.apache.openjpa.persistence.PersistenceProviderImpl 
$ClassTransformerImpl.<init>(PersistenceProviderImpl.java:110)
         at  
org.apache.openjpa.persistence.PersistenceProviderImpl.createContainerEn 
tityManagerFactory(PersistenceProviderImpl.java:96)
         at  
org.apache.geronimo.persistence.PersistenceUnitGBean.<init> 
(PersistenceUnitGBean.java:92)

If I change to

<property name="openjpa.Sequence"  
value="org.apache.openjpa.jdbc.kernel.TableJDBCSeq(Table=OPENJPASEQ,  
Increment=100)"/>

I get a different exception:

java.lang.RuntimeException: There were errors initializing your  
configuration: java.lang.ClassCastException:  
org.apache.openjpa.conf.OpenJPAConfigurationImpl
         at  
org.apache.openjpa.jdbc.kernel.TableJDBCSeq.setConfiguration 
(TableJDBCSeq.java:181)
         at  
org.apache.openjpa.lib.conf.Configurations.configureInstance 
(Configurations.java:327)
         at  
org.apache.openjpa.lib.conf.Configurations.configureInstance 
(Configurations.java:284)
         at org.apache.openjpa.lib.conf.PluginValue.instantiate 
(PluginValue.java:99)
         at org.apache.openjpa.lib.conf.ObjectValue.instantiate 
(ObjectValue.java:70)
         at  
org.apache.openjpa.conf.OpenJPAConfigurationImpl.getSequenceInstance 
(OpenJPAConfigurationImpl.java:1310)
         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:264)
         at  
org.apache.openjpa.conf.OpenJPAConfigurationImpl.instantiateAll 
(OpenJPAConfigurationImpl.java:1405)
         at org.apache.openjpa.persistence.PersistenceProviderImpl 
$ClassTransformerImpl.<init>(PersistenceProviderImpl.java:134)
         at org.apache.openjpa.persistence.PersistenceProviderImpl 
$ClassTransformerImpl.<init>(PersistenceProviderImpl.java:110)
         at  
org.apache.openjpa.persistence.PersistenceProviderImpl.createContainerEn 
tityManagerFactory(PersistenceProviderImpl.java:96)
         at  
org.apache.geronimo.persistence.PersistenceUnitGBean.<init> 
(PersistenceUnitGBean.java:92)

(TableJDBCSeq expects the configuration instance to be a  
JDBCConfigurationImpl and apparently it isn't)


Is this as it should be?  Is there some additional processing going  
on when openjpa reads a persistence.xml file that should not happen  
when an entityManagerFactory is created in a j2ee environment?

thanks
david jencks




Mime
View raw message