geronimo-user mailing list archives

David Jencks wrote:
>
> On Dec 29, 2007, at 1:39 PM, Garth Keesler wrote:
>
>> Garth Keesler wrote:
>>> 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:
>>>
>> ...
>>>
>>> What am I doing wrong?
>>>
>>> Thx,
>>> Garth
>>>
>>> .
>>>
>> I moved the property definition to the persistence.xml file and the
>> app loaded and started correctly. However, I've not found an example
>> of using this property so I may be using it wrong and the app still
>> fails (differently) so I am still looking.
>
> Your persistence.xml file would be the right place. I lose track of
> which openjpa property values have nice short aliases and most likely
> if openjpa doesn't complain you have a good value but we seem to be
> using a full class name
> <property name="openjpa.jdbc.DBDictionary"
> value="org.apache.openjpa.jdbc.sql.DerbyDictionary"/>
>
> for derby.
>
> What error are you seeing now?
>
> thanks
> david jencks
>
>>
>> Feedback welcome...
>>
>> Thx,
>> Garth
>
>
> .
>
I continue to hack, trying to find what the prob is. Following is a bit
of gmo log and the persistence.xml.
A couple of interesting (to me at least:-) points. When I install the
EAR into gmo, I get a new DB called OESDS in the DB Pool. This matched
the DataSource I specified in the persistence.xml file pointing to the
"real" db in the pool called OES. The dbtester app fails against this
database so I think my prob (other than not knowing what I am doing) is
that I am specifying the DataSource wrong. When I tried using the real
db pool name, gmo complains and won't load the ear.
If you look about halfway down the log dump you'll notice an
"interesting error" marked with that comment. I think I'm not describing
things correctly in the persistence.xml file.
gmo.log
05:49:03,947 INFO [config] Configuring Service(id=Default Stateless
Container, type=Container, provider-id=Default Stateless Container)
05:49:03,947 INFO [config] Configuring Service(id=Default Stateful
Container, type=Container, provider-id=Default Stateful Container)
05:49:03,947 INFO [config] Configuring Service(id=Default BMP Container,
type=Container, provider-id=Default BMP Container)
05:49:03,948 INFO [config] Configuring Service(id=Default CMP Container,
type=Container, provider-id=Default CMP Container)
05:49:03,948 INFO [config] Configuring app:
org.apache.geronimo.samples/bank-ear/2.0-SNAPSHOT/ear
05:49:03,990 INFO [OpenEJB] Auto-deploying ejb BankManagerFacadeBean:
EjbDeployment(deployment-id=bank-ejb-2.0-SNAPSHOT.jar/BankManagerFacadeBean)
05:49:04,107 INFO [config] Loaded Module:
org.apache.geronimo.samples/bank-ear/2.0-SNAPSHOT/ear
05:49:05,082 INFO [Enhance] You have enabled runtime enhancement, but
have not specified the set of persistent classes. OpenJPA must look for
metadata for every loaded class, which might increase class load times
significantly.
05:49:05,742 INFO [startup] Assembling app:
/usr/dev/geronimo-tomcat6-jee5-2.0.2/var/temp/geronimo-deploymentUtil64627.jar
05:49:06,062 INFO [startup] Jndi(name=BankManagerFacadeBeanLocal) -->
Ejb(deployment-id=bank-ejb-2.0-SNAPSHOT.jar/BankManagerFacadeBean)
05:49:06,062 INFO [startup] Created
Ejb(deployment-id=bank-ejb-2.0-SNAPSHOT.jar/BankManagerFacadeBean,
ejb-name=BankManagerFacadeBean, container=Default Stateless Container)
05:49:06,062 INFO [startup] Deployed
Application(path=/usr/dev/geronimo-tomcat6-jee5-2.0.2/var/temp/geronimo-deploymentUtil64627.jar)
05:49:33,407 INFO [OpenEJB] invoking method create on
bank-ejb-2.0-SNAPSHOT.jar/BankManagerFacadeBean
05:49:33,430 INFO [OpenEJB] finished invoking method create
05:49:33,433 INFO [OpenEJB] invoking method getAccountInformation on
bank-ejb-2.0-SNAPSHOT.jar/BankManagerFacadeBean with identity null
05:49:33,459 INFO [OpenEJB] The following method doesn't have a
transaction policy assigned: public abstract java.util.List
org.apache.geronimo.samples.bank.ejb.BankManagerFacadeLocal.getAccountInformation(java.lang.String)
05:49:33,475 INFO [Transaction] TX Required: Started transaction
org.apache.geronimo.transaction.manager.TransactionImpl@264f65
05:49:33,480 INFO [Runtime] Starting OpenJPA 1.0.0
05:49:33,480 INFO [JDBC] Using dictionary class
"org.apache.openjpa.jdbc.sql.PostgresDictionary".
05:49:33,884 ERROR [OpenEJB] The bean instances business method
encountered a system exception: null
<openjpa-1.0.0-r420667:568756 nonfatal user error>
org.apache.openjpa.persistence.ArgumentException: null
at org.apache.openjpa.kernel.QueryImpl.execute(QueryImpl.java:808)
at org.apache.openjpa.kernel.QueryImpl.execute(QueryImpl.java:769)
at org.apache.openjpa.kernel.QueryImpl.execute(QueryImpl.java:765)
at
org.apache.openjpa.kernel.DelegatingQuery.execute(DelegatingQuery.java:517)
at org.apache.openjpa.persistence.QueryImpl.execute(QueryImpl.java:238)
at
org.apache.openjpa.persistence.QueryImpl.getResultList(QueryImpl.java:277)
at
org.apache.geronimo.samples.bank.ejb.BankManagerFacadeBean.getAccountInformation(BankManagerFacadeBean.java:48)
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(ReflectionInvocationContext.java:146)
at
org.apache.openejb.core.interceptor.ReflectionInvocationContext.proceed(ReflectionInvocationContext.java:129)
at
org.apache.openejb.core.interceptor.InterceptorStack.invoke(InterceptorStack.java:67)
at
org.apache.openejb.core.stateless.StatelessContainer._invoke(StatelessContainer.java:203)
at
org.apache.openejb.core.stateless.StatelessContainer.invoke(StatelessContainer.java:165)
at
org.apache.openejb.core.ivm.EjbObjectProxyHandler.businessMethod(EjbObjectProxyHandler.java:223)
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 $Proxy40.getAccountInformation(Unknown Source)
at
org.apache.geronimo.samples.bank.web.CustomerServiceServlet.viewCustomerInfo(CustomerServiceServlet.java:54)
at
org.apache.geronimo.samples.bank.web.CustomerServiceServlet.doGet(CustomerServiceServlet.java:42)
at
org.apache.geronimo.samples.bank.web.CustomerServiceServlet.doPost(CustomerServiceServlet.java:46)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:713)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:806)
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:230)
at
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
at
org.apache.geronimo.tomcat.valve.DefaultSubjectValve.invoke(DefaultSubjectValve.java:56)
at
org.apache.geronimo.tomcat.GeronimoStandardContext$SystemMethodValve.invoke(GeronimoStandardContext.java:353)
at
org.apache.geronimo.tomcat.valve.GeronimoBeforeAfterValve.invoke(GeronimoBeforeAfterValve.java:47)
at
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
at
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:104)
at
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at
org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:563)
at
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:261)
at
org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
at
org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:581)
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
at java.lang.Thread.run(Thread.java:595)
< interesting error follows...>
Caused by: java.lang.NullPointerException
at
org.tranql.connector.jdbc.JDBCDriverMCF.getPhysicalConnection(JDBCDriverMCF.java:79)
at
org.tranql.connector.jdbc.JDBCDriverMCF.createManagedConnection(JDBCDriverMCF.java:73)
at
org.apache.geronimo.connector.outbound.MCFConnectionInterceptor.getConnection(MCFConnectionInterceptor.java:48)
at
org.apache.geronimo.connector.outbound.LocalXAResourceInsertionInterceptor.getConnection(LocalXAResourceInsertionInterceptor.java:41)
at
org.apache.geronimo.connector.outbound.SinglePoolConnectionInterceptor.internalGetConnection(SinglePoolConnectionInterceptor.java:67)
at
org.apache.geronimo.connector.outbound.AbstractSinglePoolConnectionInterceptor.getConnection(AbstractSinglePoolConnectionInterceptor.java:78)
at
org.apache.geronimo.connector.outbound.TransactionEnlistingInterceptor.getConnection(TransactionEnlistingInterceptor.java:46)
at
org.apache.geronimo.connector.outbound.TransactionCachingInterceptor.getConnection(TransactionCachingInterceptor.java:88)
at
org.apache.geronimo.connector.outbound.ConnectionHandleInterceptor.getConnection(ConnectionHandleInterceptor.java:43)
at
org.apache.geronimo.connector.outbound.TCCLInterceptor.getConnection(TCCLInterceptor.java:39)
at
org.apache.geronimo.connector.outbound.ConnectionTrackingInterceptor.getConnection(ConnectionTrackingInterceptor.java:66)
at
org.apache.geronimo.connector.outbound.AbstractConnectionManager.allocateConnection(AbstractConnectionManager.java:87)
at org.tranql.connector.jdbc.DataSource.getConnection(DataSource.java:56)
at
org.apache.openjpa.lib.jdbc.DelegatingDataSource.getConnection(DelegatingDataSource.java:106)
at
org.apache.openjpa.lib.jdbc.DecoratingDataSource.getConnection(DecoratingDataSource.java:87)
at
org.apache.openjpa.jdbc.kernel.JDBCStoreManager.connectInternal(JDBCStoreManager.java:738)
at
org.apache.openjpa.jdbc.kernel.JDBCStoreManager.connect(JDBCStoreManager.java:723)
at
org.apache.openjpa.jdbc.kernel.JDBCStoreManager.getConnection(JDBCStoreManager.java:211)
at
org.apache.openjpa.jdbc.kernel.SQLStoreQuery$SQLExecutor.executeQuery(SQLStoreQuery.java:265)
at org.apache.openjpa.kernel.QueryImpl.execute(QueryImpl.java:988)
at org.apache.openjpa.kernel.QueryImpl.execute(QueryImpl.java:799)
... 41 more
05:49:33,886 INFO [Transaction] TX Required: setRollbackOnly() on
transaction org.apache.geronimo.transaction.manager.TransactionImpl@264f65
05:49:33,886 INFO [Transaction] TX Required: Rolling back transaction
org.apache.geronimo.transaction.manager.TransactionImpl@264f65
06:03:33,240 ERROR [[ListTablesServlet]] Servlet.service() for servlet
ListTablesServlet threw exception
java.lang.NullPointerException
at
org.tranql.connector.jdbc.JDBCDriverMCF.getPhysicalConnection(JDBCDriverMCF.java:79)
at
org.tranql.connector.jdbc.JDBCDriverMCF.createManagedConnection(JDBCDriverMCF.java:73)
at
org.apache.geronimo.connector.outbound.MCFConnectionInterceptor.getConnection(MCFConnectionInterceptor.java:48)
at
org.apache.geronimo.connector.outbound.LocalXAResourceInsertionInterceptor.getConnection(LocalXAResourceInsertionInterceptor.java:41)
at
org.apache.geronimo.connector.outbound.SinglePoolConnectionInterceptor.internalGetConnection(SinglePoolConnectionInterceptor.java:67)
at
org.apache.geronimo.connector.outbound.AbstractSinglePoolConnectionInterceptor.getConnection(AbstractSinglePoolConnectionInterceptor.java:78)
at
org.apache.geronimo.connector.outbound.TransactionEnlistingInterceptor.getConnection(TransactionEnlistingInterceptor.java:46)
at
org.apache.geronimo.connector.outbound.TransactionCachingInterceptor.getConnection(TransactionCachingInterceptor.java:96)
at
org.apache.geronimo.connector.outbound.ConnectionHandleInterceptor.getConnection(ConnectionHandleInterceptor.java:43)
at
org.apache.geronimo.connector.outbound.TCCLInterceptor.getConnection(TCCLInterceptor.java:39)
at
org.apache.geronimo.connector.outbound.ConnectionTrackingInterceptor.getConnection(ConnectionTrackingInterceptor.java:66)
at
org.apache.geronimo.connector.outbound.AbstractConnectionManager.allocateConnection(AbstractConnectionManager.java:87)
at org.tranql.connector.jdbc.DataSource.getConnection(DataSource.java:56)
at
org.apache.geronimo.samples.dbtester.beans.DBManagerBean.getTableList(DBManagerBean.java:76)
at
org.apache.geronimo.samples.dbtester.web.ListTablesServlet.listTables(ListTablesServlet.java:32)
at
org.apache.geronimo.samples.dbtester.web.ListTablesServlet.doGet(ListTablesServlet.java:17)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:693)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:806)
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:230)
at
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
at
org.apache.geronimo.tomcat.valve.DefaultSubjectValve.invoke(DefaultSubjectValve.java:56)
at
org.apache.geronimo.tomcat.GeronimoStandardContext$SystemMethodValve.invoke(GeronimoStandardContext.java:353)
at
org.apache.geronimo.tomcat.valve.GeronimoBeforeAfterValve.invoke(GeronimoBeforeAfterValve.java:47)
at
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
at
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:104)
at
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at
org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:563)
at
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:261)
at
org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
at
org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:581)
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
at java.lang.Thread.run(Thread.java:595)
persistence.xml
<?xml version="1.0" encoding="UTF-8"?>
<persistence xmlns="http://java.sun.com/xml/ns/persistence"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="1.0"
xsi:schemaLocation="http://java.sun.com/xml/ns/persistence
http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd">
<persistence-unit name="BankPU">
<description>Entity Beans for Bank</description>
<provider>org.apache.openjpa.persistence.PersistenceProviderImpl</provider>
<class>org.apache.geronimo.samples.bank.ejb.Account</class>
<class>org.apache.geronimo.samples.bank.ejb.Customer</class>
<class>org.apache.geronimo.samples.bank.ejb.ExchangeRate</class>
<properties>
<property name="openjpa.jdbc.SynchronizeMappings" value="false" />
<property name="openjpa.jdbc.DBDictionary" value="postgres"/>
</properties>
<jta-data-source>OESDS</jta-data-source>
</persistence-unit>
</persistence>
Thx,
Garth