Thanks a lot Igor! Adding:
* @ejb:transaction type="Required" to the MDB class comment solved the problem! xdoclet then replaced my hand-edited code in the ejb-jar.xml - file: <container-transaction> <method> <ejb-name>test/TestMessage</ejb-name> <method-name>onMessage</method-name> <method-params> <method-param>javax.jms.Message</method-param> </method-params> </method> <trans-attribute>Required</trans-attribute> </container-transaction> with: <container-transaction > <method > <ejb-name>test/TestMessage</ejb-name> <method-name>*</method-name> </method> <trans-attribute>Required</trans-attribute> </container-transaction> and the problem was gone!!! I hope that you eventually get time to fix the real problem but this works for me for the time being! Regards, Magnus. -----Original Message----- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]On Behalf Of Igor Fedorenko Sent: Wednesday, February 19, 2003 14:30 To: [EMAIL PROTECTED] Subject: RE: [JBoss-user] Problem with MDB and CMT in JBoss3.2RC2 (SSB and CMT works fine) Apparently, JBoss cannot match transaction=Required metadata specified for onMessage method. As a quick fix move "@ejb:transaction type=Required" to MDB class comments. I don't have time to work more on this. > -----Original Message----- > From: Magnus Larsson [mailto:[EMAIL PROTECTED]] > Sent: Wednesday, February 19, 2003 6:05 AM > To: [EMAIL PROTECTED] > Subject: [JBoss-user] Problem with MDB and CMT in JBoss3.2RC2 (SSB and > CMT works fine) > > > Hello! > > I have run into problems with getting CMT-transactions to > work under Message > Driven Beans on JBoss3.2, including the latest 3.2-RC2. > It works fine under JBoss 3.0.4 so I guess something has been > changed in > JBoss3.2 that I have missed. > > I have attached a small example that can be used to reproduce > the problem. > > The example is based on one JDBC- and one JMS-test method > that both are > called from a Steless Session Bean and from a Message Driven Bean. > > When called from the Steless Session Bean there is no problem > with calling > the JDBC and JMS tests methods under CMT. > > When called from the Message Drive Bean with CMT I get the > following two > errors below. > > You can find the the example code in the attached zip-file: > - src/main/ejb/test/util/Helper.java - > contain the JDBC > and JMS test methods > - src/main/ejb/test/session/TestSessionBean.java - > contain the Steless > Session Bean > - src/main/ejb/test/message/TestMessageDrivenBean.java - > contain the Steless > Session Bean > - build/META-INF/ejb-jar.xml - the > deployment > descriptor for the two EJB's > > Anyone that has a clue on what is going wrong? > > Regards, > Magnus. > > > 09:22:27,277 ERROR [STDERR] java.sql.SQLException: Not in a > transaction > 09:22:27,277 ERROR [STDERR] at > oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:168) > 09:22:27,277 ERROR [STDERR] at > oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:210) > 09:22:27,277 ERROR [STDERR] at > oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:273) > 09:22:27,287 ERROR [STDERR] at > oracle.jdbc.driver.OracleConnection.needLine(OracleConnection. > java:1621) > 09:22:27,287 ERROR [STDERR] at > oracle.jdbc.driver.OracleStatement.<init>(OracleStatement.java:412) > 09:22:27,287 ERROR [STDERR] at > oracle.jdbc.driver.OracleStatement.<init>(OracleStatement.java:432) > 09:22:27,287 ERROR [STDERR] at > oracle.jdbc.driver.OraclePreparedStatement.<init>(OraclePrepar > edStatement.ja > va:182) > 09:22:27,287 ERROR [STDERR] at > oracle.jdbc.driver.OraclePreparedStatement.<init>(OraclePrepar > edStatement.ja > va:165) > 09:22:27,287 ERROR [STDERR] at > oracle.jdbc.driver.OracleConnection.privatePrepareStatement(Or > acleConnection > .java:608) > 09:22:27,287 ERROR [STDERR] at > oracle.jdbc.driver.OracleConnection.prepareStatement(OracleCon > nection.java:4 > 89) > 09:22:27,287 ERROR [STDERR] at > org.jboss.resource.adapter.jdbc.WrappedConnection.prepareState > ment(WrappedCo > nnection.java:191) > 09:22:27,287 ERROR [STDERR] at > test.util.Helper.mlJdbcTest(Helper.java:34) > 09:22:27,297 ERROR [STDERR] at > test.message.TestMessageDrivenBean.onMessage(TestMessageDriven > Bean.java:66) > 09:22:27,297 ERROR [STDERR] at > java.lang.reflect.Method.invoke(Native > Method) > 09:22:27,297 ERROR [STDERR] at > org.jboss.ejb.MessageDrivenContainer$ContainerInterceptor.invo > ke(MessageDriv > enContainer.java:434) > 09:22:27,297 ERROR [STDERR] at > org.jboss.resource.connectionmanager.CachedConnectionIntercept > or.invoke(Cach > edConnectionInterceptor.java: > 186) > 09:22:27,577 ERROR [STDERR] at > org.jboss.ejb.plugins.MessageDrivenInstanceInterceptor.invoke( > MessageDrivenI > nstanceInterceptor.java:88) > 09:22:27,577 ERROR [STDERR] at > org.jboss.ejb.plugins.AbstractTxInterceptor.invokeNext(Abstrac > tTxInterceptor > .java:108) > 09:22:27,577 ERROR [STDERR] at > org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions(TxI > nterceptorCMT. > java:216) > 09:22:27,577 ERROR [STDERR] at > org.jboss.ejb.plugins.TxInterceptorCMT.invoke(TxInterceptorCMT > .java:104) > 09:22:27,577 ERROR [STDERR] at > org.jboss.ejb.plugins.RunAsSecurityInterceptor.invoke(RunAsSec > urityIntercept > or.java:100) > 09:22:27,577 ERROR [STDERR] at > org.jboss.ejb.plugins.LogInterceptor.invoke(LogInterceptor.java:208) > 09:22:27,577 ERROR [STDERR] at > org.jboss.ejb.plugins.ProxyFactoryFinderInterceptor.invoke(Pro > xyFactoryFinde > rInterceptor.java:154) > 09:22:27,577 ERROR [STDERR] at > org.jboss.ejb.MessageDrivenContainer.internalInvoke(MessageDri > venContainer.j > ava:348) > 09:22:27,587 ERROR [STDERR] at > org.jboss.ejb.Container.invoke(Container.java:652) > 09:22:27,587 ERROR [STDERR] at > org.jboss.ejb.plugins.jms.JMSContainerInvoker.invoke(JMSContai > nerInvoker.jav > a:697) > 09:22:27,587 ERROR [STDERR] at > org.jboss.ejb.plugins.jms.JMSContainerInvoker$MessageListenerI > mpl.onMessage( > JMSContainerInvoker.java:985) > > 09:22:27,587 ERROR [STDERR] at > org.jboss.jms.asf.StdServerSession.onMessage(StdServerSession. > java:241) > 09:22:27,587 ERROR [STDERR] at > org.jboss.mq.SpyMessageConsumer.sessionConsumerProcessMessage( > SpyMessageCons > umer.java:601) > 09:22:27,587 ERROR [STDERR] at > org.jboss.mq.SpyMessageConsumer.addMessage(SpyMessageConsumer. > java:415) > 09:22:27,587 ERROR [STDERR] at > org.jboss.mq.SpySession.run(SpySession.java:293) > 09:22:27,587 ERROR [STDERR] at > org.jboss.jms.asf.StdServerSession.run(StdServerSession.java:177) > 09:22:27,597 ERROR [STDERR] at > EDU.oswego.cs.dl.util.concurrent.PooledExecutor$Worker.run(Poo > ledExecutor.ja > va:642) > 09:22:27,597 ERROR [STDERR] at > java.lang.Thread.run(Thread.java:479) > > > > 09:22:27,597 ERROR [STDERR] javax.jms.JMSException: Invalid > transaction id. > 09:22:27,597 ERROR [STDERR] at > org.jboss.mq.SpyXAResourceManager.addMessage(SpyXAResourceMana > ger.java:95) > 09:22:27,607 ERROR [STDERR] at > org.jboss.mq.SpySession.sendMessage(SpySession.java:654) > 09:22:27,607 ERROR [STDERR] at > org.jboss.mq.SpyQueueSender.internalSend(SpyQueueSender.java:118) > 09:22:27,607 ERROR [STDERR] at > org.jboss.mq.SpyQueueSender.send(SpyQueueSender.java:68) > 09:22:27,607 ERROR [STDERR] at > test.util.Helper.mlJmsTest(Helper.java:76) > 09:22:27,607 ERROR [STDERR] at > test.message.TestMessageDrivenBean.onMessage(TestMessageDriven > Bean.java:67) > 09:22:27,607 ERROR [STDERR] at > java.lang.reflect.Method.invoke(Native > Method) > 09:22:27,607 ERROR [STDERR] at > org.jboss.ejb.MessageDrivenContainer$ContainerInterceptor.invo > ke(MessageDriv > enContainer.java:434) > 09:22:27,617 ERROR [STDERR] at > org.jboss.resource.connectionmanager.CachedConnectionIntercept > or.invoke(Cach > edConnectionInterceptor.java: > 186) > 09:22:27,617 ERROR [STDERR] at > org.jboss.ejb.plugins.MessageDrivenInstanceInterceptor.invoke( > MessageDrivenI > nstanceInterceptor.java:88) > 09:22:27,617 ERROR [STDERR] at > org.jboss.ejb.plugins.AbstractTxInterceptor.invokeNext(Abstrac > tTxInterceptor > .java:108) > 09:22:27,617 ERROR [STDERR] at > org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions(TxI > nterceptorCMT. > java:216) > 09:22:27,617 ERROR [STDERR] at > org.jboss.ejb.plugins.TxInterceptorCMT.invoke(TxInterceptorCMT > .java:104) > 09:22:27,617 ERROR [STDERR] at > org.jboss.ejb.plugins.RunAsSecurityInterceptor.invoke(RunAsSec > urityIntercept > or.java:100) > 09:22:27,617 ERROR [STDERR] at > org.jboss.ejb.plugins.LogInterceptor.invoke(LogInterceptor.java:208) > 09:22:27,617 ERROR [STDERR] at > org.jboss.ejb.plugins.ProxyFactoryFinderInterceptor.invoke(Pro > xyFactoryFinde > rInterceptor.java:154) > 09:22:27,627 ERROR [STDERR] at > org.jboss.ejb.MessageDrivenContainer.internalInvoke(MessageDri > venContainer.j > ava:348) > 09:22:27,627 ERROR [STDERR] at > org.jboss.ejb.Container.invoke(Container.java:652) > 09:22:27,627 ERROR [STDERR] at > org.jboss.ejb.plugins.jms.JMSContainerInvoker.invoke(JMSContai > nerInvoker.jav > a:697) > 09:22:27,627 ERROR [STDERR] at > org.jboss.ejb.plugins.jms.JMSContainerInvoker$MessageListenerI > mpl.onMessage( > JMSContainerInvoker.java:985) > > 09:22:27,627 ERROR [STDERR] at > org.jboss.jms.asf.StdServerSession.onMessage(StdServerSession. > java:241) > 09:22:27,627 ERROR [STDERR] at > org.jboss.mq.SpyMessageConsumer.sessionConsumerProcessMessage( > SpyMessageCons > umer.java:601) > 09:22:27,627 ERROR [STDERR] at > org.jboss.mq.SpyMessageConsumer.addMessage(SpyMessageConsumer. > java:415) > 09:22:27,627 ERROR [STDERR] at > org.jboss.mq.SpySession.run(SpySession.java:293) > 09:22:27,637 ERROR [STDERR] at > org.jboss.jms.asf.StdServerSession.run(StdServerSession.java:177) > 09:22:27,637 ERROR [STDERR] at > EDU.oswego.cs.dl.util.concurrent.PooledExecutor$Worker.run(Poo > ledExecutor.ja > va:642) > 09:22:27,637 ERROR [STDERR] at > java.lang.Thread.run(Thread.java:479) > ------------------------------------------------------- This SF.net email is sponsored by: SlickEdit Inc. Develop an edge. The most comprehensive and flexible code editor you can use. Code faster. C/C++, C#, Java, HTML, XML, many more. FREE 30-Day Trial. www.slickedit.com/sourceforge _______________________________________________ JBoss-user mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/jboss-user
<<attachment: winmail.dat>>