title: Spring JTA transaction jboss
body: <p>I'm new with Spring and I'm trying to configure it by using the transaction manager of jboss. Indeed, i receive this exception:
  <i>
  Caused by: org.hibernate.resource.transaction.backend.jta.internal.JtaPlatformInaccessibleException: Unable to access TransactionManager or UserTransaction to make physical transaction delegate
  </i>
  This is my config.xml:</p>
  
  <pre><code>&lt;bean id="dataSource" class="org.springframework.jndi.JndiObjectFactoryBean"&gt;
      &lt;property name="jndiName" value="java:jboss/datasources/mydb"/&gt;
  &lt;/bean&gt;
  &lt;bean id="entityManagerFactory"
      class="org.springframework.orm.jpa.LocalEntityManagerFactoryBean"&gt;
      &lt;property name="persistenceUnitName" value="ufirst" /&gt;
  
  &lt;/bean&gt;
  &lt;bean id="txManager"
      class="org.springframework.transaction.jta.JtaTransactionManager"&gt;
      &lt;property name="transactionManagerName" value="java:jboss/TransactionManager" /&gt;
      &lt;property name="userTransactionName" value="java:jboss/UserTransaction" /&gt;
  &lt;/bean&gt;
  &lt;tx:annotation-driven transaction-manager="txManager" /&gt;
  &lt;tx:jta-transaction-manager /&gt;
  </code></pre>
  
  <p>And this is my repository, that return the error:</p>
  
  <pre><code>@Repository
  @Transactional(readOnly = true)
  </code></pre>
  
  <p>public class RoleRepositoryimpl implements RoleRepository {</p>
  
  <pre><code>private static final Logger logger = LoggerFactory.getLogger(RoleRepositoryJpa.class);
  
  @PersistenceContext(unitName="entityManagerFactory")
  private EntityManager em;
  
  @Transactional
  public Role find(String role){
      logger.info("in repository");
      return em.find(Role.class, role);
  }
  </code></pre>
  
  <p>Thanks in advance for your reply.</p>