0 Replies Latest reply on Aug 13, 2015 4:33 PM by Sergio Stateri Jr

    Caused by: java.lang.IllegalArgumentException: Can not set javax.persistence.EntityManager field br.metodista.logos.interceptor.SessionBDInterceptorLogos.em to org.jboss.as.jpa.container.TransactionScopedEntityManager

    Sergio Stateri Jr Newbie

      Hi,

       

      I´m having problems when using JPA with JBoss EAP 6.4 (in standalone-full-ha mode) because my EntityManager can´t be set:

       

      Caused by: javax.ejb.EJBException: java.lang.IllegalArgumentException: Can not set javax.persistence.EntityManager field br.metodista.logos.interceptor.SessionBDInterceptorLogos.em to org.jboss.as.jpa.container.TransactionScopedEntityManager

       

      My class:

       

      import javax.persistence.EntityManager;

       

      public class SessionBDInterceptorLogosService {

       

        @javax.persistence.PersistenceContext

        public EntityManager em;

      .

      .

      .

       

      persistence.xml:

       

      <?xml version="1.0" encoding="UTF-8"?>

      <persistence xmlns="http://java.sun.com/xml/ns/persistence"

              xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"

              xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_2_0.xsd"

              version="2.0">

        <persistence-unit name="unitLogos">

        <provider>org.hibernate.ejb.HibernatePersistence</provider>

        <jta-data-source>java:jboss/datasources/LogosDS</jta-data-source>

        <properties>

        <property name="hibernate.show_sql" value="true"/>

        <property name="hibernate.format_sql" value="true"/>

      <!-- <property name="hibernate.dialect" value="org.hibernate.dialect.Oracle9Dialect" /> -->

        <property name="hibernate.dialect" value="org.hibernate.dialect.Oracle10gDialect" />

        <property name="jboss.entity.manager.jndi.name" value="java:/unitLogos"/>

        </properties>

        </persistence-unit>

      </persistence>

       

      And this´s a piece of my standalone-full-ha.xml

       

              <subsystem xmlns="urn:jboss:domain:jpa:1.1">

                  <jpa default-datasource="java:jboss/datasources/LogosDS" default-extended-persistence-inheritance="DEEP"/>

              </subsystem>

       

       

      If anyone can help me, I´ll apreciate.

       

       

      Thanks in advance,

       

      Sergio Stateri Jr

      sergio.stateri@globo.com