Re: MDB with JPA in JTA mode fails - looking for help
On 10/23/07, David Jencks <[EMAIL PROTECTED]> wrote: > At this point I think everything is working correctly except > transaction logging in the tm, so unless your server crashes during > the commit process you should be getting the effects you want. The server works fine despite the ERRORs about tx. If there're harmless, I can live with them. I'm going to describe the app on our wiki so others can tweak it even further (and hopefully use it as a reference application to get rid of the annoying ERRORs). > For reasons that escape me the openejb3 mdb support wasn't written to > work with our tms recovery methods so until someone adds support to > openejb3 we're going to keep seeing this message. Would you provide some hints as to where to look at to fix it? What part of openejb3 should unit tests cover to cause the issue surfaced? Thanks Dave for your help! Jacek -- Jacek Laskowski http://www.JacekLaskowski.pl
Re: MDB with JPA in JTA mode fails - looking for help
At this point I think everything is working correctly except transaction logging in the tm, so unless your server crashes during the commit process you should be getting the effects you want. For reasons that escape me the openejb3 mdb support wasn't written to work with our tms recovery methods so until someone adds support to openejb3 we're going to keep seeing this message. thanks david jencks On Oct 23, 2007, at 10:11 AM, Jacek Laskowski wrote: On 10/23/07, Jacek Laskowski <[EMAIL PROTECTED]> wrote: On 10/23/07, David Jencks <[EMAIL PROTECTED]> wrote: Hope this helps :-) Sure! If you'd pointed out what needed to be changed, it'd have been better, but hints are also of great help :P Okey, I got it running fine. Thanks Dave. If you think it's over it is not :P Here's another stack trace to investigate. What might cause it? What file should I correct to get rid of it? The application consists of mdb, entity and remote client. When a client sends a message to a queue, mdb wakes up and processes it. Within onMessage mdb uses the injected transactional em and persists an entity. The database is PostgreSQL 8.2.5. 19:04:48,671 ERROR [Transaction] Please correct the integration and supply a NamedXAResource java.lang.IllegalStateException: Cannot log transactions as [EMAIL PROTECTED] is not a NamedXAResource. at org.apache.geronimo.transaction.manager.TransactionImpl $TransactionBranch.getResourceName(TransactionImpl.java:697) at org.apache.geronimo.transaction.log.HOWLLog.prepare (HOWLLog.java:254) at org.apache.geronimo.transaction.log.HOWLLog$ $FastClassByCGLIB$$7315be2e.invoke() 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:830) at org.apache.geronimo.gbean.runtime.RawInvoker.invoke (RawInvoker.java:57) at org.apache.geronimo.kernel.basic.RawOperationInvoker.invoke (RawOperationInvoker.java:35) at org.apache.geronimo.kernel.basic.ProxyMethodInterceptor.intercept (ProxyMethodInterceptor.java:96) at org.apache.geronimo.gbean.GBeanLifecycle$$EnhancerByCGLIB $$b5a58fd8.prepare() at org.apache.geronimo.transaction.manager.TransactionImpl.internalPrepar e(TransactionImpl.java:444) at org.apache.geronimo.transaction.manager.TransactionImpl.commit (TransactionImpl.java:316) at org.apache.geronimo.transaction.manager.TransactionManagerImpl.commit( TransactionManagerImpl.java:245) at org.apache.openejb.core.transaction.TransactionPolicy.commitTransactio n(TransactionPolicy.java:140) at org.apache.openejb.core.transaction.TxRequired.afterInvoke (TxRequired.java:75) at org.apache.openejb.core.mdb.MdbContainer.afterDelivery (MdbContainer.java:376) at org.apache.openejb.core.mdb.EndpointHandler.afterDelivery (EndpointHandler.java:274) at org.apache.openejb.core.mdb.EndpointHandler.invoke (EndpointHandler.java:164) at $Proxy41.afterDelivery(Unknown Source) at org.apache.activemq.ra.MessageEndpointProxy $MessageEndpointAlive.afterDelivery(MessageEndpointProxy.java:126) at org.apache.activemq.ra.MessageEndpointProxy.afterDelivery (MessageEndpointProxy.java:65) at org.apache.activemq.ra.ServerSessionImpl.afterDelivery (ServerSessionImpl.java:216) at org.apache.activemq.ActiveMQSession.run (ActiveMQSession.java:751) at org.apache.activemq.ra.ServerSessionImpl.run (ServerSessionImpl.java:165) at org.apache.geronimo.connector.work.WorkerContext.run (WorkerContext.java:290) at org.apache.geronimo.connector.work.pool.NamedRunnable.run (NamedRunnable.java:32) at org.apache.geronimo.pool.ThreadPool$1.run (ThreadPool.java:214) at org.apache.geronimo.pool.ThreadPool $ContextClassLoaderRunnable.run(ThreadPool.java:344) at java.util.concurrent.ThreadPoolExecutor$Worker.runTask (ThreadPoolExecutor.java:650) at java.util.concurrent.ThreadPoolExecutor$Worker.run (ThreadPoolExecutor.java:675) at java.lang.Thread.run(Thread.java:595) Jacek -- Jacek Laskowski http://www.JacekLaskowski.pl
Re: MDB with JPA in JTA mode fails - looking for help
On 10/23/07, Jacek Laskowski <[EMAIL PROTECTED]> wrote: > On 10/23/07, David Jencks <[EMAIL PROTECTED]> wrote: > > Hope this helps :-) > > Sure! If you'd pointed out what needed to be changed, it'd have been > better, but hints are also of great help :P Okey, I got it running fine. Thanks Dave. If you think it's over it is not :P Here's another stack trace to investigate. What might cause it? What file should I correct to get rid of it? The application consists of mdb, entity and remote client. When a client sends a message to a queue, mdb wakes up and processes it. Within onMessage mdb uses the injected transactional em and persists an entity. The database is PostgreSQL 8.2.5. 19:04:48,671 ERROR [Transaction] Please correct the integration and supply a NamedXAResource java.lang.IllegalStateException: Cannot log transactions as [EMAIL PROTECTED] is not a NamedXAResource. at org.apache.geronimo.transaction.manager.TransactionImpl$TransactionBranch.getResourceName(TransactionImpl.java:697) at org.apache.geronimo.transaction.log.HOWLLog.prepare(HOWLLog.java:254) at org.apache.geronimo.transaction.log.HOWLLog$$FastClassByCGLIB$$7315be2e.invoke() 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:830) at org.apache.geronimo.gbean.runtime.RawInvoker.invoke(RawInvoker.java:57) at org.apache.geronimo.kernel.basic.RawOperationInvoker.invoke(RawOperationInvoker.java:35) at org.apache.geronimo.kernel.basic.ProxyMethodInterceptor.intercept(ProxyMethodInterceptor.java:96) at org.apache.geronimo.gbean.GBeanLifecycle$$EnhancerByCGLIB$$b5a58fd8.prepare() at org.apache.geronimo.transaction.manager.TransactionImpl.internalPrepare(TransactionImpl.java:444) at org.apache.geronimo.transaction.manager.TransactionImpl.commit(TransactionImpl.java:316) at org.apache.geronimo.transaction.manager.TransactionManagerImpl.commit(TransactionManagerImpl.java:245) at org.apache.openejb.core.transaction.TransactionPolicy.commitTransaction(TransactionPolicy.java:140) at org.apache.openejb.core.transaction.TxRequired.afterInvoke(TxRequired.java:75) at org.apache.openejb.core.mdb.MdbContainer.afterDelivery(MdbContainer.java:376) at org.apache.openejb.core.mdb.EndpointHandler.afterDelivery(EndpointHandler.java:274) at org.apache.openejb.core.mdb.EndpointHandler.invoke(EndpointHandler.java:164) at $Proxy41.afterDelivery(Unknown Source) at org.apache.activemq.ra.MessageEndpointProxy$MessageEndpointAlive.afterDelivery(MessageEndpointProxy.java:126) at org.apache.activemq.ra.MessageEndpointProxy.afterDelivery(MessageEndpointProxy.java:65) at org.apache.activemq.ra.ServerSessionImpl.afterDelivery(ServerSessionImpl.java:216) at org.apache.activemq.ActiveMQSession.run(ActiveMQSession.java:751) at org.apache.activemq.ra.ServerSessionImpl.run(ServerSessionImpl.java:165) at org.apache.geronimo.connector.work.WorkerContext.run(WorkerContext.java:290) at org.apache.geronimo.connector.work.pool.NamedRunnable.run(NamedRunnable.java:32) at org.apache.geronimo.pool.ThreadPool$1.run(ThreadPool.java:214) at org.apache.geronimo.pool.ThreadPool$ContextClassLoaderRunnable.run(ThreadPool.java:344) at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:650) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:675) at java.lang.Thread.run(Thread.java:595) Jacek -- Jacek Laskowski http://www.JacekLaskowski.pl
Re: MDB with JPA in JTA mode fails - looking for help
On 10/23/07, David Jencks <[EMAIL PROTECTED]> wrote: > I would guess that you haven't defined a non-jta-datasource Yes. > and specified it in the persistence.xml. No. > My experience, while only with derby, is that openjpa's sequences don't work > without a separate non-transactional datasource. I'd also thought that it might've been related to auto-generating sequences so I'll give it a try in RESOURCE_LOCAL outside the container before switching to JTA. > Hope this helps :-) Sure! If you'd pointed out what needed to be changed, it'd have been better, but hints are also of great help :P Jacek -- Jacek Laskowski http://www.JacekLaskowski.pl
Re: MDB with JPA in JTA mode fails - looking for help
I would guess that you haven't defined a non-jta-datasource and specified it in the persistence.xml. My experience, while only with derby, is that openjpa's sequences don't work without a separate non- transactional datasource. Hope this helps :-) david jencks On Oct 22, 2007, at 3:49 PM, Jacek Laskowski wrote: Hi, I can't get my simple transacted mdb to run with jpa in jta mode. I'm getting the following error message. Does it mean I'm struggling with an incorrect datasource definition? I thought I'd ask here before digging in more. The sample application to reproduce it is at [1]. I deploy a datasource with the following command: ./bin/deploy.sh -u system -p manager deploy TicketServiceCfg\src\geronimo-postgresql-datasource-plan.xml repository/org/tranql/tranql-connector-postgresql-xa/1.1/tranql- connector-postgresql-xa-1.1.rar and the application itself as follows: ./bin/deploy.sh -u system -p manager deploy TicketServiceEAR.ear I haven't tested out whether the connection has worked fine yet. The MDB is indeed run, but when the entity is persisted (once tx commits in CMTD) the exception's thrown. Any help greatly appreciated. 00:35:55,000 INFO [Transaction] TX Required: Committing transaction [EMAIL PROTECTED] 00:35:55,000 WARN [Transaction] Unexpected exception from beforeCompletion; transaction will roll back org.apache.openjpa.persistence.PersistenceException: null at org.apache.openjpa.jdbc.kernel.AbstractJDBCSeq.getConnection (AbstractJDBCSeq.java:162) at org.apache.openjpa.jdbc.kernel.TableJDBCSeq.allocateSequence (TableJDBCSeq.java:341) at org.apache.openjpa.jdbc.kernel.TableJDBCSeq.nextInternal (TableJDBCSeq.java:247) at org.apache.openjpa.jdbc.kernel.AbstractJDBCSeq.next (AbstractJDBCSeq.java:60) at org.apache.openjpa.util.ImplHelper.generateValue (ImplHelper.java:160) at org.apache.openjpa.util.ImplHelper.generateFieldValue (ImplHelper.java:144) at org.apache.openjpa.jdbc.kernel.JDBCStoreManager.assignField (JDBCStoreManager.java:557) at org.apache.openjpa.util.ApplicationIds.assign (ApplicationIds.java:450) at org.apache.openjpa.util.ApplicationIds.assign (ApplicationIds.java:426) at org.apache.openjpa.jdbc.kernel.JDBCStoreManager.assignObjectId (JDBCStoreManager.java:541) at org.apache.openjpa.kernel.DelegatingStoreManager.assignObjectId (DelegatingStoreManager.java:134) at org.apache.openjpa.kernel.StateManagerImpl.assignObjectId (StateManagerImpl.java:501) at org.apache.openjpa.kernel.StateManagerImpl.preFlush (StateManagerImpl.java:2770) at org.apache.openjpa.kernel.PNewState.beforeFlush (PNewState.java:39) at org.apache.openjpa.kernel.StateManagerImpl.beforeFlush (StateManagerImpl.java:940) at org.apache.openjpa.kernel.BrokerImpl.flush (BrokerImpl.java:1884) at org.apache.openjpa.kernel.BrokerImpl.flushSafe (BrokerImpl.java:1844) at org.apache.openjpa.kernel.BrokerImpl.beforeCompletion (BrokerImpl.java:1762) at org.apache.geronimo.transaction.manager.TransactionImpl.beforeCompleti on(TransactionImpl.java:514) at org.apache.geronimo.transaction.manager.TransactionImpl.beforeCompleti on(TransactionImpl.java:499) at org.apache.geronimo.transaction.manager.TransactionImpl.beforePrepare( TransactionImpl.java:400) at org.apache.geronimo.transaction.manager.TransactionImpl.commit (TransactionImpl.java:257) at org.apache.geronimo.transaction.manager.TransactionManagerImpl.commit( TransactionManagerImpl.java:245) at org.apache.openejb.core.transaction.TransactionPolicy.commitTransactio n(TransactionPolicy.java:140) at org.apache.openejb.core.transaction.TxRequired.afterInvoke (TxRequired.java:75) at org.apache.openejb.core.mdb.MdbContainer.afterDelivery (MdbContainer.java:376) at org.apache.openejb.core.mdb.EndpointHandler.afterDelivery (EndpointHandler.java:274) at org.apache.openejb.core.mdb.EndpointHandler.invoke (EndpointHandler.java:164) at $Proxy43.afterDelivery(Unknown Source) at org.apache.activemq.ra.MessageEndpointProxy $MessageEndpointAlive.afterDelivery(MessageEndpointProxy.java:126) at org.apache.activemq.ra.MessageEndpointProxy.afterDelivery (MessageEndpointProxy.java:65) at org.apache.activemq.ra.ServerSessionImpl.afterDelivery (ServerSessionImpl.java:216) at org.apache.activemq.ActiveMQSession.run (ActiveMQSession.java:751) at org.apache.activemq.ra.ServerSessionImpl.run (ServerSessionImpl.java:165) at org.apache.geronimo.connector.work.WorkerContext.run (WorkerContext.java:290) at org.apache.geronimo.connector.work.pool.NamedRunnable.run (NamedRunnable.java:32) at org.apache.geronimo.pool.ThreadPool$1.run (ThreadPool.java:214) at org.apache.geronimo.pool.ThreadPool $ContextClassLoaderRunnable.run(