0 Replies Latest reply on Oct 26, 2017 2:31 PM by Zenas da Silva dos Reis

    Only session and message-driven beans ... are allowed to access UserTransaction

    Zenas da Silva dos Reis Newbie

      Hello,

       

      I am migrating a web application eap 5.1 to 7.0

       

      The application uses jms, ejb 3, datasource XA and jboss seam.

       

      When I producer a jms message, I get following error:

       

      16:26:56,640 WARN  [org.jboss.seam.contexts.Contexts] (Thread-2 (ActiveMQ-client-global-threads-1133066060)) Exception destroying context : java.lang.IllegalStateException: WFLYEJB0137: Only session and message-driven beans with bean-managed transaction demarcation are allowed to access UserTransaction

      at org.jboss.as.ejb3.component.allowedmethods.AllowedMethodsInformation.realCheckPermission(AllowedMethodsInformation.java:138)

      at org.jboss.as.ejb3.component.allowedmethods.AllowedMethodsInformation.checkAllowed(AllowedMethodsInformation.java:112)

      at org.jboss.as.ejb3.context.EJBContextImpl.getUserTransaction(EJBContextImpl.java:104)

      at org.jboss.seam.transaction.CMTTransaction.begin(CMTTransaction.java:40)

      at org.jboss.seam.util.Work.workInTransaction(Work.java:58)

       

      My datasource configuration

      <xa-datasource jndi-name="java:jboss/datasources/XXXXDatasourceXA" pool-name="XXXXDatasourceXA" enabled="true" use-java-context="true">

                          <xa-datasource-property name="URL">

                              jdbc:oracle:thin:@(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=xx.xxx.xx.xx)(PORT=1530))(CONNECT_DATA=(SERVER=DEDICATED)(SID=xxxJBOOS)))

                          </xa-datasource-property>

                          <driver>oracle</driver>

                          <xa-pool>

                              <max-pool-size>6</max-pool-size>

                              <is-same-rm-override>false</is-same-rm-override>

                              <no-tx-separate-pools>true</no-tx-separate-pools>

                          </xa-pool>

                          <security>

                              <user-name>xxxadm</user-name>

                              <password>xxxjboos</password>

                          </security>

                          <validation>

                              <valid-connection-checker class-name="org.jboss.jca.adapters.jdbc.extensions.oracle.OracleValidConnectionChecker"/>

                              <exception-sorter class-name="org.jboss.jca.adapters.jdbc.extensions.oracle.OracleExceptionSorter"/>

                          </validation>

                          <timeout>

                              <blocking-timeout-millis>30000</blocking-timeout-millis>

                              <idle-timeout-minutes>4</idle-timeout-minutes>

                          </timeout>

                      </xa-datasource>

       

      Thank for help me