I am working my way thru the examples included in the GMO 2.0 docs
converting them to work with a postgres database. So far, so good and it
has been an excellent learning experience. I am working with the Bank
example which is my first cut at using postgres as the persistence db
for the EJB's in the app. I have it to the point that it will install
and start correctly but I get an error when using the webpage to access
a Customer's account. The following from the gmo log indicates an error
when openejb attempt to determine the DBDictionary property for the
database:
13:59:37,785 INFO [JDBC] OpenJPA will now connect to the database to
attempt to determine what type of database dictionary to use. To
prevent this connection in the future, set your
openjpa.jdbc.DBDictionary configuration property to the appropriate
value for your database (see the documentation for available values).
13:59:37,786 ERROR [OpenEJB] The bean instances business method
encountered a system exception: null
<openjpa-1.0.0-r420667:568756 nonfatal general error>
org.apache.openjpa.persistence.PersistenceException: null
at
org.apache.openjpa.kernel.AbstractBrokerFactory.newBroker(AbstractBrokerFactory.java:205)
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:145)
at
org.apache.openjpa.persistence.EntityManagerFactoryImpl.createEntityManager(EntityManagerFactoryImpl.java:56)
at
org.apache.geronimo.samples.bank.ejb.BankManagerFacadeBean.getAccountInformation(BankManagerFacadeBean.java:46)
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.openejb.core.interceptor.ReflectionInvocationContext$Invocation.invoke
The OpenEJB docs indicate that a property can be specified in the
openejb-jar.xml file as follows:
<property name="openjpa.jdbc.DBDictionary" value="postgres"/>
and here is how I incorporated it into the file:
<openejb-jar xmlns="http://www.openejb.org/xml/ns/openejb-jar-2.1">
<dep:environment
xmlns:dep="http://geronimo.apache.org/xml/ns/deployment-1.2">
<dep:moduleId>
<dep:groupId>org.apache.geronimo.samples</dep:groupId>
<dep:artifactId>BankEJB</dep:artifactId>
<dep:version>1.2</dep:version>
<dep:type>car</dep:type>
</dep:moduleId>
<dep:dependencies>
<dep:dependency>
<dep:groupId>org.apache.geronimo.configs</dep:groupId>
<dep:artifactId>openjpa</dep:artifactId>
<dep:type>car</dep:type>
</dep:dependency>
</dep:dependencies>
<dep:hidden-classes/>
<dep:non-overridable-classes/>
<dep:properties>
<property name="openjpa.jdbc.DBDictionary" value="postgres"/>
</dep:properties>
</dep:environment>
</openejb-jar>
Unfortunately, this causes GMO to choke with the following when I try to
install the app:
org.apache.geronimo.common.DeploymentException: Failed parsing descriptors for
module:
/usr/dev/geronimo-tomcat6-jee5-2.0.2/var/temp/geronimo-deploymentUtil29913.jar
org.apache.geronimo.common.DeploymentException:
org.apache.geronimo.common.DeploymentException: Failed parsing descriptors for
module:
/usr/dev/geronimo-tomcat6-jee5-2.0.2/var/temp/geronimo-deploymentUtil29913.jar
at org.apache.geronimo.deployment.Deployer.deploy(Deployer.java:385)
at org.apache.geronimo.deployment.Deployer.deploy(Deployer.java:126)
at
org.apache.geronimo.deployment.Deployer$$FastClassByCGLIB$$734a235d.invoke(<generated>)
at net.sf.cglib.reflect.FastMethod.invoke(FastMethod.java:53)
at
org.apache.geronimo.gbean.runtime.FastMethodInvoker.invoke(FastMethodInvoker.java:38)
at
org.apache.geronimo.gbean.runtime.GBeanOperation.invoke(GBeanOperation.java:124)
at
org.apache.geronimo.gbean.runtime.GBeanInstance.invoke(GBeanInstance.java:865)
at
org.apache.geronimo.kernel.basic.BasicKernel.invoke(BasicKernel.java:239)
at
org.apache.geronimo.deployment.plugin.local.AbstractDeployCommand.doDeploy(AbstractDeployCommand.java:116)
at
org.apache.geronimo.deployment.plugin.local.DistributeCommand.run(DistributeCommand.java:61)
at java.lang.Thread.run(Thread.java:595)
Caused by: org.apache.geronimo.common.DeploymentException: Failed parsing
descriptors for module:
/usr/dev/geronimo-tomcat6-jee5-2.0.2/var/temp/geronimo-deploymentUtil29913.jar
at
org.apache.geronimo.openejb.deployment.EjbModuleBuilder.createModule(EjbModuleBuilder.java:277)
at
org.apache.geronimo.openejb.deployment.EjbModuleBuilder.createModule(EjbModuleBuilder.java:199)
at
org.apache.geronimo.openejb.deployment.EjbModuleBuilder$$FastClassByCGLIB$$cd80af20.invoke(<generated>)
at net.sf.cglib.reflect.FastMethod.invoke(FastMethod.java:53)
at
org.apache.geronimo.gbean.runtime.FastMethodInvoker.invoke(FastMethodInvoker.java:38)
at
org.apache.geronimo.gbean.runtime.GBeanOperation.invoke(GBeanOperation.java:124)
What am I doing wrong?
Thx,
Garth