1 Reply Latest reply on Mar 17, 2006 9:52 AM by Bill Burke

    Entitymanager JNDI call

    Udo Krass Newbie

      Hi,

      i have a problem with the JNDI-call of the EntityManager.
      When i call the JNDI-Name in my persistence.xml:

      EntityManagerFactory emf = Persistence.createEntityManagerFactory("testDatabase");
      EntityManager t_em = emf.createEntityManager();
      


      then i get following exception
      javax.persistence.PersistenceException: java.lang.NullPointerException
       at org.hibernate.ejb.Ejb3Configuration.createEntityManagerFactory(Ejb3Configuration.java:173)
       at org.hibernate.ejb.HibernatePersistence.createEntityManagerFactory(HibernatePersistence.java:103)
       at javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:37)
       at javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:27)
       at org.apache.catalina.session.StandardSession.expire(StandardSession.java:685)
       at org.apache.catalina.session.StandardSession.isValid(StandardSession.java:577)
       at org.apache.catalina.session.ManagerBase.processExpires(ManagerBase.java:678)
       at org.apache.catalina.session.ManagerBase.backgroundProcess(ManagerBase.java:663)
       at org.apache.catalina.core.ContainerBase.backgroundProcess(ContainerBase.java:1283)
       at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1568)
       at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1577)
       at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1577)
       at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.run(ContainerBase.java:1557)
       at java.lang.Thread.run(Thread.java:595)
      Caused by: java.lang.NullPointerException
       at org.hibernate.ejb.packaging.PersistenceXmlLoader.deploy(PersistenceXmlLoader.java:68)
       at org.hibernate.ejb.Ejb3Configuration.createEntityManagerFactory(Ejb3Configuration.java:139)
       ... 15 more


      I use the latest stable release of jboss with ejb3-support. (jboss-4.0.4RC1-installer.jar)
      Is it better to use the CVS-Version of JBossAS?

      A Entitymanager-call with Annotations is no problem!
      What's wrong with the call?

      Thanx!