1 Reply Latest reply on May 13, 2011 1:24 AM by jaikiran pai

    Problem using: 6 Final JBoss, EJB3 (MDB), CMT, EclipseLink, PostgreSQL

    Yumer Lopez Newbie

      Hi, I'm new using Jboss.

      I have a JEE application using MDB to consume messages from a queue. When the message arrives, it activates a routine to keep a record in the database. The databasemanager I'm using is PostgreSQL 8.4. I use to deploy the application the IDE Eclipse, this is what I get when I deploy the application:

       

      server.log

      ========================================================================================================

      17:26:37,566 INFO  [org.jboss.jpa.mcint.beans.metadata.plugins.PersistenceUnitValueMetaData] iDependOn persistence.unit:unitName=jboss-ejb3-timerservice-mk2.jar#timerdb

      17:26:37,575 INFO  [org.jboss.jpa.deployment.PersistenceUnitDeployment] Starting persistence unit persistence.unit:unitName=jboss-ejb3-timerservice-mk2.jar#timerdb

      17:26:37,880 INFO  [org.hibernate.annotations.common.Version] Hibernate Commons Annotations 3.2.0.Final

      17:26:37,896 INFO  [org.hibernate.cfg.Environment] Hibernate 3.6.0.Final

      17:26:37,901 INFO  [org.hibernate.cfg.Environment] hibernate.properties not found

      17:26:37,907 INFO  [org.hibernate.cfg.Environment] Bytecode provider name : javassist

      17:26:37,913 INFO  [org.hibernate.cfg.Environment] using JDK 1.4 java.sql.Timestamp handling

      17:26:38,043 INFO  [org.hibernate.ejb.Version] Hibernate EntityManager 3.6.0.Final

      17:26:38,075 INFO  [org.hibernate.ejb.Ejb3Configuration] Processing PersistenceUnitInfo [

                name: timerdb

                ...]

      17:26:38,090 WARN  [org.hibernate.ejb.Ejb3Configuration] Persistence provider caller does not implement the EJB3 spec correctly.PersistenceUnitInfo.getNewTempClassLoader() is null.

      17:26:38,192 INFO  [org.hibernate.cfg.AnnotationBinder] Binding entity from annotated class: org.jboss.ejb3.timerservice.mk2.persistence.TimerEntity

      17:26:38,237 INFO  [org.hibernate.cfg.annotations.EntityBinder] Bind entity org.jboss.ejb3.timerservice.mk2.persistence.TimerEntity on table timer

      17:26:38,291 INFO  [org.hibernate.cfg.AnnotationBinder] Binding entity from annotated class: org.jboss.ejb3.timerservice.mk2.persistence.TimeoutMethod

      17:26:38,294 INFO  [org.hibernate.cfg.annotations.EntityBinder] Bind entity org.jboss.ejb3.timerservice.mk2.persistence.TimeoutMethod on table timeout_method

      17:26:38,326 INFO  [org.hibernate.cfg.AnnotationBinder] Binding entity from annotated class: org.jboss.ejb3.timerservice.mk2.persistence.CalendarTimerEntity

      17:26:38,328 INFO  [org.hibernate.cfg.annotations.EntityBinder] Bind entity org.jboss.ejb3.timerservice.mk2.persistence.CalendarTimerEntity on table calendar_timer

      17:26:38,367 INFO  [org.hibernate.validator.Version] Hibernate Validator 3.1.0.GA

      17:26:38,417 INFO  [org.hibernate.validator.util.Version] Hibernate Validator 4.1.0.Final

      17:26:38,430 INFO  [org.hibernate.validator.engine.resolver.DefaultTraversableResolver] Instantiated an instance of org.hibernate.validator.engine.resolver.JPATraversableResolver.

      17:26:38,598 INFO  [org.hibernate.validator.engine.resolver.DefaultTraversableResolver] Instantiated an instance of org.hibernate.validator.engine.resolver.JPATraversableResolver.

      17:26:38,603 INFO  [org.hibernate.validator.engine.resolver.DefaultTraversableResolver] Instantiated an instance of org.hibernate.validator.engine.resolver.JPATraversableResolver.

      17:26:38,610 INFO  [org.hibernate.cfg.search.HibernateSearchEventListenerRegister] Unable to find org.hibernate.search.event.FullTextIndexEventListener on the classpath. Hibernate Search is not enabled.

      17:26:38,627 INFO  [org.hibernate.connection.ConnectionProviderFactory] Initializing connection provider: org.hibernate.ejb.connection.InjectedDataSourceConnectionProvider

      17:26:38,634 INFO  [org.hibernate.ejb.connection.InjectedDataSourceConnectionProvider] Using provided datasource

      17:26:38,640 INFO  [org.hibernate.cfg.SettingsFactory] Database ->

             name : HSQL Database Engine

          version : 1.8.0

            major : 1

            minor : 8

      17:26:38,640 INFO  [org.hibernate.cfg.SettingsFactory] Driver ->

             name : HSQL Database Engine Driver

          version : 1.8.0

            major : 1

            minor : 8

      17:26:38,709 INFO  [org.hibernate.dialect.Dialect] Using dialect: org.hibernate.dialect.HSQLDialect

      17:26:38,742 INFO  [org.hibernate.engine.jdbc.JdbcSupportLoader] Disabling contextual LOB creation as JDBC driver reported JDBC version [3] less than 4

      17:26:38,744 INFO  [org.hibernate.transaction.TransactionFactoryFactory] Transaction strategy: org.hibernate.ejb.transaction.JoinableCMTTransactionFactory

      17:26:38,748 INFO  [org.hibernate.transaction.TransactionManagerLookupFactory] instantiating TransactionManagerLookup: org.hibernate.transaction.JBossTransactionManagerLookup

      17:26:38,751 INFO  [org.hibernate.transaction.TransactionManagerLookupFactory] instantiated TransactionManagerLookup

      17:26:38,751 INFO  [org.hibernate.cfg.SettingsFactory] Automatic flush during beforeCompletion(): disabled

      17:26:38,752 INFO  [org.hibernate.cfg.SettingsFactory] Automatic session close at end of transaction: disabled

      17:26:38,752 INFO  [org.hibernate.cfg.SettingsFactory] JDBC batch size: 15

      17:26:38,752 INFO  [org.hibernate.cfg.SettingsFactory] JDBC batch updates for versioned data: disabled

      17:26:38,753 INFO  [org.hibernate.cfg.SettingsFactory] Scrollable result sets: enabled

      17:26:38,754 INFO  [org.hibernate.cfg.SettingsFactory] JDBC3 getGeneratedKeys(): disabled

      17:26:38,754 INFO  [org.hibernate.cfg.SettingsFactory] Connection release mode: auto

      17:26:38,756 INFO  [org.hibernate.cfg.SettingsFactory] Default batch fetch size: 1

      17:26:38,756 INFO  [org.hibernate.cfg.SettingsFactory] Generate SQL with comments: disabled

      17:26:38,756 INFO  [org.hibernate.cfg.SettingsFactory] Order SQL updates by primary key: disabled

      17:26:38,756 INFO  [org.hibernate.cfg.SettingsFactory] Order SQL inserts for batching: disabled

      17:26:38,756 INFO  [org.hibernate.cfg.SettingsFactory] Query translator: org.hibernate.hql.ast.ASTQueryTranslatorFactory

      17:26:38,762 INFO  [org.hibernate.hql.ast.ASTQueryTranslatorFactory] Using ASTQueryTranslatorFactory

      17:26:38,762 INFO  [org.hibernate.cfg.SettingsFactory] Query language substitutions: {}

      17:26:38,762 INFO  [org.hibernate.cfg.SettingsFactory] JPA-QL strict compliance: enabled

      17:26:38,762 INFO  [org.hibernate.cfg.SettingsFactory] Second-level cache: enabled

      17:26:38,762 INFO  [org.hibernate.cfg.SettingsFactory] Query cache: disabled

      17:26:38,764 INFO  [org.hibernate.cfg.SettingsFactory] Cache region factory : org.hibernate.cache.impl.bridge.RegionFactoryCacheProviderBridge

      17:26:38,772 INFO  [org.hibernate.cache.impl.bridge.RegionFactoryCacheProviderBridge] Cache provider: org.hibernate.cache.HashtableCacheProvider

      17:26:38,775 INFO  [org.hibernate.cfg.SettingsFactory] Optimize cache for minimal puts: disabled

      17:26:38,775 INFO  [org.hibernate.cfg.SettingsFactory] Cache region prefix: persistence.unit:unitName=jboss-ejb3-timerservice-mk2.jar#timerdb

      17:26:38,775 INFO  [org.hibernate.cfg.SettingsFactory] Structured second-level cache entries: disabled

      17:26:38,784 INFO  [org.hibernate.cfg.SettingsFactory] Statistics: disabled

      17:26:38,784 INFO  [org.hibernate.cfg.SettingsFactory] Deleted entity synthetic identifier rollback: disabled

      17:26:38,784 INFO  [org.hibernate.cfg.SettingsFactory] Default entity-mode: pojo

      17:26:38,784 INFO  [org.hibernate.cfg.SettingsFactory] Named query checking : enabled

      17:26:38,784 INFO  [org.hibernate.cfg.SettingsFactory] Check Nullability in Core (should be disabled when Bean Validation is on): disabled

      17:26:38,815 INFO  [org.hibernate.impl.SessionFactoryImpl] building session factory

      17:26:39,055 INFO  [org.hibernate.impl.SessionFactoryObjectFactory] Factory name: persistence.unit:unitName=jboss-ejb3-timerservice-mk2.jar#timerdb

      17:26:39,057 INFO  [org.hibernate.util.NamingHelper] JNDI InitialContext properties:{java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory, java.naming.factory.url.pkgs=org.jboss.naming:org.jnp.interfaces}

      17:26:39,060 INFO  [org.hibernate.impl.SessionFactoryObjectFactory] Bound factory to JNDI name: persistence.unit:unitName=jboss-ejb3-timerservice-mk2.jar#timerdb

      17:26:39,060 WARN  [org.hibernate.impl.SessionFactoryObjectFactory] InitialContext did not implement EventContext

      17:26:39,068 INFO  [org.hibernate.tool.hbm2ddl.SchemaUpdate] Running hbm2ddl schema update

      17:26:39,069 INFO  [org.hibernate.tool.hbm2ddl.SchemaUpdate] fetching database metadata

      17:26:39,070 INFO  [org.hibernate.tool.hbm2ddl.SchemaUpdate] updating schema

      17:26:39,072 INFO  [org.hibernate.validator.engine.resolver.DefaultTraversableResolver] Instantiated an instance of org.hibernate.validator.engine.resolver.JPATraversableResolver.

      17:26:39,096 INFO  [org.hibernate.tool.hbm2ddl.TableMetadata] table found: PUBLIC.TIMEOUTMETHOD_METHODPARAMS

      17:26:39,097 INFO  [org.hibernate.tool.hbm2ddl.TableMetadata] columns: [methodparams, timeoutmethod_id]

      17:26:39,097 INFO  [org.hibernate.tool.hbm2ddl.TableMetadata] foreign keys: [fkf294c964b7de2d8a]

      17:26:39,097 INFO  [org.hibernate.tool.hbm2ddl.TableMetadata] indexes: [sys_idx_55]

      17:26:39,110 INFO  [org.hibernate.tool.hbm2ddl.TableMetadata] table found: PUBLIC.CALENDAR_TIMER

      17:26:39,111 INFO  [org.hibernate.tool.hbm2ddl.TableMetadata] columns: [scheduleexprtimezone, scheduleexprsecond, autotimer, scheduleexprstartdate, scheduleexprminute, scheduleexprhour, timeoutmethod_id, id, scheduleexprdayofmonth, scheduleexprenddate, scheduleexprmonth, scheduleexprdayofweek, scheduleexpryear]

      17:26:39,111 INFO  [org.hibernate.tool.hbm2ddl.TableMetadata] foreign keys: [fk2b697f04b7de2d8a, fk2b697f04e6e6ef93]

      17:26:39,111 INFO  [org.hibernate.tool.hbm2ddl.TableMetadata] indexes: [sys_idx_57, sys_idx_49, sys_idx_59]

      17:26:39,122 INFO  [org.hibernate.tool.hbm2ddl.TableMetadata] table found: PUBLIC.TIMEOUT_METHOD

      17:26:39,122 INFO  [org.hibernate.tool.hbm2ddl.TableMetadata] columns: [id, methodname, declaringclass]

      17:26:39,122 INFO  [org.hibernate.tool.hbm2ddl.TableMetadata] foreign keys: []

      17:26:39,122 INFO  [org.hibernate.tool.hbm2ddl.TableMetadata] indexes: [sys_idx_51]

      17:26:39,136 INFO  [org.hibernate.tool.hbm2ddl.TableMetadata] table found: PUBLIC.TIMER

      17:26:39,136 INFO  [org.hibernate.tool.hbm2ddl.TableMetadata] columns: [id, previousrun, initialdate, repeatinterval, timedobjectid, timerstate, nextdate, info]

      17:26:39,136 INFO  [org.hibernate.tool.hbm2ddl.TableMetadata] foreign keys: []

      17:26:39,136 INFO  [org.hibernate.tool.hbm2ddl.TableMetadata] indexes: [sys_idx_53]

      17:26:39,138 INFO  [org.hibernate.tool.hbm2ddl.SchemaUpdate] schema update complete

      17:26:39,142 INFO  [org.hibernate.util.NamingHelper] JNDI InitialContext properties:{java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory, java.naming.factory.url.pkgs=org.jboss.naming:org.jnp.interfaces}

      17:26:39,206 INFO  [org.jboss.ejb3.deployers.Ejb3DependenciesDeployer] Encountered deployment AbstractVFSDeploymentContext@1890779401{vfs:///home/yumer/EclipseProjects/.metadata/.plugins/org.jboss.ide.eclipse.as.core/JBoss_6.0_Runtime_Server1305132052402/deploy/JBoss-EJB%20MDB%20Tutorial.jar}

      17:26:39,207 INFO  [org.jboss.ejb3.deployers.Ejb3DependenciesDeployer] Encountered deployment AbstractVFSDeploymentContext@1890779401{vfs:///home/yumer/EclipseProjects/.metadata/.plugins/org.jboss.ide.eclipse.as.core/JBoss_6.0_Runtime_Server1305132052402/deploy/JBoss-EJB%20MDB%20Tutorial.jar}

      17:26:39,226 INFO  [org.jboss.ejb3.instantiator.deployer.BeanInstantiatorDeployerBase] Installed org.jboss.ejb3.instantiator.impl.Ejb31SpecBeanInstantiator@ec3b565 into MC at org.jboss.ejb.bean.instantiator/JBoss-EJB MDB Tutorial/JBoss-EJB MDB Tutorial/MyMDB

      17:26:39,233 WARN  [org.jboss.ejb3.interceptor.InterceptorInfoRepository] EJBTHREE-1852: InterceptorInfoRepository is deprecated

      17:26:39,674 INFO  [org.jboss.ejb3.deployers.JBossASKernel] Created KernelDeployment for: JBoss-EJB MDB Tutorial.jar

      17:26:39,676 INFO  [org.jboss.ejb3.deployers.JBossASKernel] installing bean: jboss.j2ee:jar=JBoss-EJB MDB Tutorial.jar,name=MyMDB,service=EJB3

      17:26:39,676 INFO  [org.jboss.ejb3.deployers.JBossASKernel]   with dependencies:

      17:26:39,676 INFO  [org.jboss.ejb3.deployers.JBossASKernel]   and demands:

      17:26:39,676 INFO  [org.jboss.ejb3.deployers.JBossASKernel]           jboss.ejb:service=EJBTimerService; Required: Described

      17:26:39,677 INFO  [org.jboss.ejb3.deployers.JBossASKernel]           persistence.unit:unitName=JBoss-EJB MDB Tutorial.jar#JPA-prueba; Required: Described

      17:26:39,677 INFO  [org.jboss.ejb3.deployers.JBossASKernel]           jboss-injector:topLevelUnit=JBoss-EJB MDB Tutorial.jar,unit=JBoss-EJB MDB Tutorial.jar,bean=MyMDB; Required: Described

      17:26:39,677 INFO  [org.jboss.ejb3.deployers.JBossASKernel]           jboss-switchboard:appName=JBoss-EJB MDB Tutorial,module=JBoss-EJB MDB Tutorial,name=MyMDB; Required: Create

      17:26:39,677 INFO  [org.jboss.ejb3.deployers.JBossASKernel]   and supplies:

      17:26:39,677 INFO  [org.jboss.ejb3.deployers.JBossASKernel]           jndi:null

      17:26:39,677 INFO  [org.jboss.ejb3.deployers.JBossASKernel]           Class:javax.jms.MessageListener

      17:26:39,678 INFO  [org.jboss.ejb3.deployers.JBossASKernel] Added bean(jboss.j2ee:jar=JBoss-EJB MDB Tutorial.jar,name=MyMDB,service=EJB3) to KernelDeployment of: JBoss-EJB MDB Tutorial.jar

      17:26:39,722 INFO  [org.jboss.jpa.deployment.PersistenceUnitDeployment] Starting persistence unit persistence.unit:unitName=JBoss-EJB MDB Tutorial.jar#JPA-prueba

      17:26:39,764 INFO  [org.jboss.ejb3.EJBContainer] STARTED EJB: com.my.jms.tutorial.MyMDB ejbName: MyMDB

      17:26:39,799 WARN  [org.jboss.ejb3.TimerServiceContainer] EJBTHREE-2193: using deprecated TimerServiceFactory for restoring timers

       

      ========================================================================================================

       

      I want to use CMT, but I get the following error:

       

      Stacktrace:

       

      ========================================================================================================

      17:32:22,188 INFO  [STDOUT] ----------------

      17:32:22,188 INFO  [STDOUT] Received message :

      17:32:22,188 INFO  [STDOUT] Hello World

      17:32:22,189 INFO  [STDOUT] ------D----------

      17:32:22,189 ERROR [org.jboss.ejb3.tx2.impl.CMTTxInterceptor] javax.ejb.EJBTransactionRolledbackException:

      Exception Description: No transaction is currently active

      17:32:22,189 ERROR [org.hornetq.ra.inflow.HornetQMessageHandler] Failed to deliver message: javax.ejb.EJBTransactionRolledbackException:

      Exception Description: No transaction is currently active

                at org.jboss.ejb3.tx2.impl.CMTTxInterceptor.handleInCallerTx(CMTTxInterceptor.java:148) [:0.0.1]

                at org.jboss.ejb3.tx2.impl.CMTTxInterceptor.invokeInCallerTx(CMTTxInterceptor.java:227) [:0.0.1]

                at org.jboss.ejb3.tx2.impl.CMTTxInterceptor.required(CMTTxInterceptor.java:353) [:0.0.1]

                at org.jboss.ejb3.tx2.impl.CMTTxInterceptor.invoke(CMTTxInterceptor.java:209) [:0.0.1]

                at org.jboss.ejb3.tx2.aop.CMTTxInterceptorWrapper.invoke(CMTTxInterceptorWrapper.java:52) [:0.0.1]

                at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102) [jboss-aop.jar:2.2.1.GA]

                at org.jboss.ejb3.tx.NullInterceptor.invoke(NullInterceptor.java:42) [:1.0.3]

                at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102) [jboss-aop.jar:2.2.1.GA]

                at org.jboss.ejb3.security.Ejb3AuthenticationInterceptorv2.invoke(Ejb3AuthenticationInterceptorv2.java:79) [:1.7.17]

                at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102) [jboss-aop.jar:2.2.1.GA]

                at org.jboss.ejb3.BlockContainerShutdownInterceptor.invoke(BlockContainerShutdownInterceptor.java:67) [:1.7.17]

                at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102) [jboss-aop.jar:2.2.1.GA]

                at org.jboss.ejb3.core.context.CurrentInvocationContextInterceptor.invoke(CurrentInvocationContextInterceptor.java:47) [:1.7.17]

                at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102) [jboss-aop.jar:2.2.1.GA]

                at org.jboss.aspects.currentinvocation.CurrentInvocationInterceptor.invoke(CurrentInvocationInterceptor.java:67) [:1.0.1]

                at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102) [jboss-aop.jar:2.2.1.GA]

                at org.jboss.ejb3.interceptor.EJB3TCCLInterceptor.invoke(EJB3TCCLInterceptor.java:86) [:1.7.17]

                at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102) [jboss-aop.jar:2.2.1.GA]

                at org.jboss.ejb3.mdb.MessagingContainer.localInvoke(MessagingContainer.java:306) [:1.7.17]

                at org.jboss.ejb3.mdb.inflow.MessageInflowLocalProxy.delivery(MessageInflowLocalProxy.java:299) [:1.7.17]

                at org.jboss.ejb3.mdb.inflow.MessageInflowLocalProxy.invoke(MessageInflowLocalProxy.java:152) [:1.7.17]

                at $Proxy191.onMessage(Unknown Source)          at org.hornetq.ra.inflow.HornetQMessageHandler.onMessage(HornetQMessageHandler.java:256) [:6.0.0.Final]

                at org.hornetq.core.client.impl.ClientConsumerImpl.callOnMessage(ClientConsumerImpl.java:822) [:6.0.0.Final]

                at org.hornetq.core.client.impl.ClientConsumerImpl.access$100(ClientConsumerImpl.java:46) [:6.0.0.Final]

                at org.hornetq.core.client.impl.ClientConsumerImpl$Runner.run(ClientConsumerImpl.java:940) [:6.0.0.Final]

                at org.hornetq.utils.OrderedExecutorFactory$OrderedExecutor$1.run(OrderedExecutorFactory.java:100) [:6.0.0.Final]

                at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110) [:1.6.0_18]

                at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603) [:1.6.0_18]

                at java.lang.Thread.run(Thread.java:636) [:1.6.0_18]

      Caused by: javax.persistence.TransactionRequiredException:

      Exception Description: No transaction is currently active

                at org.eclipse.persistence.internal.jpa.transaction.EntityTransactionWrapper.throwCheckTransactionFailedException(EntityTransactionWrapper.java:113) [:2.2.0.v20110202-r8913]

                at org.eclipse.persistence.internal.jpa.transaction.EntityTransactionWrapper.checkForTransaction(EntityTransactionWrapper.java:50) [:2.2.0.v20110202-r8913]

                at org.eclipse.persistence.internal.jpa.EntityManagerImpl.checkForTransaction(EntityManagerImpl.java:1666) [:2.2.0.v20110202-r8913]

                at org.eclipse.persistence.internal.jpa.EntityManagerImpl.joinTransaction(EntityManagerImpl.java:1698) [:2.2.0.v20110202-r8913]

                at org.jboss.jpa.deployment.ManagedEntityManagerFactory.getTransactionScopedEntityManager(ManagedEntityManagerFactory.java:190) [:1.0.2-alpha-3]

                at org.jboss.jpa.deployment.PersistenceUnitDeployment.getTransactionScopedEntityManager(PersistenceUnitDeployment.java:178) [:1.0.2-alpha-3]

                at org.jboss.jpa.impl.tx.TransactionScopedEntityManager.getEntityManager(TransactionScopedEntityManager.java:262) [:2.0.0]

                at org.jboss.jpa.impl.tx.TransactionScopedEntityManager.persist(TransactionScopedEntityManager.java:206) [:2.0.0]

                at com.my.jms.tutorial.MyMDB.onMessage(MyMDB.java:54) [:]

                at sun.reflect.GeneratedMethodAccessor291.invoke(Unknown Source) [:1.6.0_18]

                at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) [:1.6.0_18]

                at java.lang.reflect.Method.invoke(Method.java:616) [:1.6.0_18]

                at org.jboss.aop.joinpoint.MethodInvocation.invokeTarget(MethodInvocation.java:122) [jboss-aop.jar:2.2.1.GA]

                at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:111) [jboss-aop.jar:2.2.1.GA]

                at org.jboss.ejb3.interceptors.container.ContainerMethodInvocationWrapper.invokeNext(ContainerMethodInvocationWrapper.java:72) [:1.1.3]

                at org.jboss.ejb3.interceptors.aop.InterceptorSequencer.invoke(InterceptorSequencer.java:76) [:1.1.3]

                at org.jboss.ejb3.interceptors.aop.InterceptorSequencer.aroundInvoke(InterceptorSequencer.java:62) [:1.1.3]

                at sun.reflect.GeneratedMethodAccessor290.invoke(Unknown Source) [:1.6.0_18]

                at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) [:1.6.0_18]

                at java.lang.reflect.Method.invoke(Method.java:616) [:1.6.0_18]

                at org.jboss.aop.advice.PerJoinpointAdvice.invoke(PerJoinpointAdvice.java:174) [jboss-aop.jar:2.2.1.GA]

                at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102) [jboss-aop.jar:2.2.1.GA]

                at org.jboss.ejb3.interceptors.aop.InvocationContextInterceptor.fillMethod(InvocationContextInterceptor.java:74) [:1.1.3]

                at org.jboss.aop.advice.org.jboss.ejb3.interceptors.aop.InvocationContextInterceptor_z_fillMethod_6395852.invoke(InvocationContextInterceptor_z_fillMethod_6395852.java) [:]

                at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102) [jboss-aop.jar:2.2.1.GA]

                at org.jboss.ejb3.interceptors.aop.InvocationContextInterceptor.setup(InvocationContextInterceptor.java:90) [:1.1.3]

                at org.jboss.aop.advice.org.jboss.ejb3.interceptors.aop.InvocationContextInterceptor_z_setup_6395852.invoke(InvocationContextInterceptor_z_setup_6395852.java) [:]

                at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102) [jboss-aop.jar:2.2.1.GA]

                at org.jboss.ejb3.async.impl.interceptor.AsynchronousServerInterceptor.invoke(AsynchronousServerInterceptor.java:110) [:1.7.17]

                at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102) [jboss-aop.jar:2.2.1.GA]

                at org.jboss.ejb3.connectionmanager.CachedConnectionInterceptor.invoke(CachedConnectionInterceptor.java:62) [:1.7.17]

                at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102) [jboss-aop.jar:2.2.1.GA]

                at org.jboss.ejb3.entity.TransactionScopedEntityManagerInterceptor.invoke(TransactionScopedEntityManagerInterceptor.java:56) [:1.7.17]

                at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102) [jboss-aop.jar:2.2.1.GA]

                at org.jboss.ejb3.AllowedOperationsInterceptor.invoke(AllowedOperationsInterceptor.java:47) [:1.7.17]

                at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102) [jboss-aop.jar:2.2.1.GA]

                at org.jboss.ejb3.tx.NullInterceptor.invoke(NullInterceptor.java:42) [:1.0.3]

                at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102) [jboss-aop.jar:2.2.1.GA]

                at org.jboss.ejb3.stateless.StatelessInstanceInterceptor.invoke(StatelessInstanceInterceptor.java:68) [:1.7.17]

                at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102) [jboss-aop.jar:2.2.1.GA]

                at org.jboss.ejb3.core.context.InvocationContextAdapter.proceed(InvocationContextAdapter.java:70) [:1.7.17]

                at org.jboss.ejb3.tx2.impl.CMTTxInterceptor.invokeInCallerTx(CMTTxInterceptor.java:223) [:0.0.1]

                ... 28 more

       

      ========================================================================================================


      This is my MBD:

      ========================================================================================================

      package com.my.jms.tutorial;

       

      import com.my.jpa.*;

      import javax.ejb.ActivationConfigProperty;

      import javax.ejb.MessageDriven;

      import javax.ejb.TransactionAttribute;

      import javax.ejb.TransactionAttributeType;

      import javax.ejb.TransactionManagement;

      import javax.ejb.TransactionManagementType;

      import javax.jms.JMSException;

      import javax.jms.Message;

      import javax.jms.MessageListener;

      import javax.jms.TextMessage;

      import javax.persistence.PersistenceContext;

      import javax.persistence.EntityManager;

       

       

      @MessageDriven(

              activationConfig =

                  {     @ActivationConfigProperty(propertyName = "destinationType", propertyValue = "javax.jms.Queue"),

                      @ActivationConfigProperty(propertyName="destination", propertyValue="queue/MyQueue"),

                      @ActivationConfigProperty(propertyName = "user", propertyValue = "guest")

                  }

                 )

      public class MyMDB implements MessageListener {

       

                @PersistenceContext(unitName = "JPA-prueba") EntityManager em;

       

          public MyMDB() {

          }

          @TransactionAttribute(TransactionAttributeType.REQUIRED)

          public void onMessage(Message message) {

                    try {

                                    if (!message.getJMSRedelivered()){

                                              System.out.println("----------------");

                                  System.out.println("Received message : ");

                                  if (message instanceof TextMessage) {

                                            try {

                                                                  System.out.println(((TextMessage) message).getText());

                                                        } catch (JMSException e) {

                                                                  // TODO Auto-generated catch block

                                                                  e.printStackTrace();

                                                        }

                                  }

                                  System.out.println("------D----------");

                                  TemporalSm temporal = new TemporalSm();

                                  temporal.setAni((long) 2414);

                                  temporal.setDnis(3);

                                  temporal.setContent("contenido");

                                  temporal.setContext("contexto");

                                              em.persist(temporal);

                                              System.out.println("Here");

                                    }

                          } catch (JMSException e) {

                                    // TODO Auto-generated catch block

                                    e.printStackTrace();

                          }

          }

      }

       

      ========================================================================================================

       

      Jbos it's telling me: "No transaction is currently active" but I'm marking that the transactions are handled by the container (the default). This is logical? Am I doing something wrong?