3 Replies Latest reply on Mar 3, 2006 9:51 AM by Roberto Colmegna

    EntityManagerFactory problem

    Roberto Colmegna Newbie

      JBOSS 4.0.4RC1

      Stateless code:

      public class AlfaSessionBean implements AlfaSession {
      EntityManager m_oEM = null;

      public AlfaSessionBean() {
      System.out.println("PreFindPersMgrFactory");
      EntityManagerFactory oEMF = Persistence.
      createEntityManagerFactory("TestPersistenceManager");
      System.out.println("PreFindPersMgr");
      m_oEM = oEMF.getEntityManager();
      System.out.println("EPM=" + m_oEM);
      }
      ....
      }



      META-INF/persistence.xml:
      [persistence]
      [persistence-unit name="TestPersistenceManager"
      transaction-type="JTA"]
      [provider]org.hibernate.ejb.HibernatePersistence[/provider]
      [jta-data-source]java:/TestDS[/jta-data-source>]
      [properties /]
      [/persistence-unit]
      [/persistence>


      Exception:

      2006-03-03 14:32:03,516 DEBUG [org.jboss.mx.loading.RepositoryClassLoader] setRe
      pository, repository=org.jboss.mx.loading.HeirarchicalLoaderRepository3@1066caf,
      cl=org.jboss.mx.loading.UnifiedClassLoader3@a06d25{ url=null ,addedOrder=0}
      2006-03-03 14:32:03,524 FATAL [org.hibernate.ejb.packaging.PersistenceXmlLoader]
      TestPersistenceManager JTA
      2006-03-03 14:32:03,527 ERROR [org.apache.catalina.core.ContainerBase.[jboss.web
      ].[localhost].[/test].[jsp]] Servlet.service() for servlet jsp threw exception
      java.lang.RuntimeException: java.lang.reflect.InvocationTargetException
      at org.jboss.ejb3.EJBContainer.construct(EJBContainer.java:482)
      at org.jboss.ejb3.AbstractPool.create(AbstractPool.java:62)
      at org.jboss.ejb3.ThreadlocalPool.get(ThreadlocalPool.java:48)
      at org.jboss.ejb3.stateless.StatelessInstanceInterceptor.invoke(Stateles
      sInstanceInterceptor.java:51)


      TIA
      Roberto Colmegna