http://www.gg3721.com/
Home
» users.openjpa »
h2 database with openjpa
David Hofmann
2008-05-20
Replies:
h2 database with openjpa --
David Hofmann
2008-05-20
h2 database with openjpa
--
Adam Hardy
2008-06-03
h2 database with openjpa
--
Kevin Sutter
2008-06-03
Find Java Web Hosting
Author Login
Post Reply
I was trying to configure openejb (openjpa as the JPA provider) with
H2 Database. I get the exception shown here.
H2 Version = 1.0.72
OpenJPA/EJB Version = 3.0
persistence.xml configuration
<persistence-unit name="crmPU" transaction-type="RESOURCE_LOCAL">
<properties>
<property name="openjpa.jdbc.SynchronizeMappings"
value="buildSchema(ForeignKeys=true)"/>
<property name="openjpa.jdbc.DBDictionary"
value="
org.apache.openjpa.jdbc.sql.H2Dictionary
"/>
<property name="openjpa.ConnectionURL" value=" jdbc:h2:file:c:
\dev\db\acercatepy"/>
<property name="openjpa.ConnectionDriverName"
value="
org.h2.Driver
"/>
<property name="openjpa.ConnectionUserName" value="sa"/>
<property name="openjpa.ConnectionPassword" value=""/>
<property name="openjpa.Log" value="DefaultLevel=TRACE,
Tool=TRACE"/>
</properties>
</persistence-unit>
I have done a lot of search but I couldn't find the solution.
I will appreciate a lot if somebody's help to show me whre I am doing
wrong. Probably I am not understanding how the configuration part of
openejb is working.
Thank you very much in advance
Greetings,
P.D.: Sorry about my English, I am still learning it
Exception in thread "main"
javax.ejb.EJBException
: The bean
encountered a non-application exception.; nested exception is:
<openjpa-1.0.1-r420667:592145 nonfatal general error>
org.apache.openjpa.persistence.PersistenceException
: There were errors
initializing your configuration: <openjpa-1.0.1-r420667:592145 fatal
store error>
org.apache.openjpa.util.StoreException
: Not supported by
BasicDataSource
at
org.apache.openjpa.jdbc.schema.DataSourceFactory.installDBDictionary
(DataSo
urceFactory.java:
234)
at
org.apache.openjpa.jdbc.conf.JDBCConfigurationImpl
.getConnectionFactory (
JDBCConfigurationImpl.java
:
709)
at
sun.reflect.NativeMethodAccessorImpl.invoke0
(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke
(Unknown Source)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke
(Unknown Source)
at
java.lang.reflect.Method.invoke
(Unknown Source)
at
org.apache.openjpa.lib.conf.ConfigurationImpl
.instantiateAll (
ConfigurationImpl.java
:
289)
at
org.apache.openjpa.conf.OpenJPAConfigurationImpl
.instantiateAll (
OpenJPAConfigurationImpl.java
:
1463)
at
org.apache.openjpa.kernel.AbstractBrokerFactory
.makeReadOnly (
AbstractBrokerFactory.java
:
638)
at
org.apache.openjpa.kernel.AbstractBrokerFactory
.newBroker (
AbstractBrokerFactory.java
:
169)
at
org.apache.openjpa.kernel.DelegatingBrokerFactory
.newBroker (
DelegatingBrokerFactory.java
:
142)
at
org.apache.openjpa.persistence.EntityManagerFactoryImpl
.createEntityManager (
EntityManagerFactoryImpl.java
:
192)
at
org.apache.openjpa.persistence.EntityManagerFactoryImpl
.createEntityManager (
EntityManagerFactoryImpl.java
:
56)
at
org.apache.openejb.persistence.JtaEntityManagerRegistry
.getEntityManager (
JtaEntityManagerRegistry.java
:
105)
at
org.apache.openejb.persistence.JtaEntityManager
.getEntityManager (
JtaEntityManager.java
:
61)
at
org.apache.openejb.persistence.JtaEntityManager
.persist (
JtaEntityManager.java
:
97)
at
com.acercatepy.personalsbe.ejb.EJBServerImpl.giveMeResults(EJBServerImpl.java:
23)
at
sun.reflect.NativeMethodAccessorImpl.invoke0
(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke
(Unknown Source)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke
(Unknown Source)
at
java.lang.reflect.Method.invoke
(Unknown Source)
at
org.apache.openejb.core.interceptor.ReflectionInvocationContext
$Invocation.invoke(ReflectionInvocationContext.java:158)
at
org.apache.openejb.core.interceptor.ReflectionInvocationContext
.proceed (
ReflectionInvocationContext.java
:
141)
at
org.apache.openejb.core.interceptor.InterceptorStack
.invoke (
InterceptorStack.java
:
67)
at
org.apache.openejb.core.stateless.StatelessContainer
._invoke (
StatelessContainer.java
:
210)
at
org.apache.openejb.core.stateless.StatelessContainer
._invoke (
StatelessContainer.java
:
188)
at
org.apache.openejb.core.stateless.StatelessContainer
.invoke (
StatelessContainer.java
:
165)
at
org.apache.openejb.core.ivm.EjbObjectProxyHandler
.businessMethod (
EjbObjectProxyHandler.java
:
217)
at
org.apache.openejb.core.ivm.EjbObjectProxyHandler
._invoke (
EjbObjectProxyHandler.java
:
77)
at
org.apache.openejb.core.ivm.BaseEjbProxyHandler
.invoke (
BaseEjbProxyHandler.java
:
321)
at
org.apache.openejb.util.proxy.Jdk13InvocationHandler
.invoke (
Jdk13InvocationHandler.java
:
49)
at $Proxy19.giveMeResults(Unknown Source)
at com.acercatepy.personalsbe.test.TestAll.main(TestAll.java:29)
Caused by:
java.lang.UnsupportedOperationException
: Not supported by
BasicDataSource
at
org.apache.commons.dbcp.BasicDataSource
.getConnection (
BasicDataSource.java
:
902)
at
org.apache.openjpa.lib.jdbc.DelegatingDataSource
.getConnection (
DelegatingDataSource.java
:
113)
at
org.apache.openjpa.lib.jdbc.DecoratingDataSource
.getConnection (
DecoratingDataSource.java
:
93)
at
org.apache.openjpa.jdbc.schema.DataSourceFactory
.installDBDictionary (
DataSourceFactory.java
:
226)
... 32 more
--
David Hofmann
WPG S.R.L. - Software Development
Mobile: +595 (982) 424984
Home: +595 (21) 205616
©2008 gg3721.com - Jax Systems, LLC, U.S.A.