0 Replies Latest reply on Feb 12, 2007 1:42 AM by guava

    NullPointerException with EntutyManager.createNamedQuery

    guava Newbie

      Hi,

      I'm getting a NullPointerException when calling the createNamedQury() under Jboss 4.0.5GA. Anyone one knows what the stack trace means?

      22:25:41,609 ERROR [STDERR] Exception in thread "pool-5-thread-1"
      22:25:41,609 ERROR [STDERR] java.lang.NullPointerException
      22:25:41,609 ERROR [STDERR] at org.jboss.ejb3.entity.ManagedEntityManagerFactory.getNonTxEntityManager(ManagedEntityManagerFactory.java:59)
      22:25:41,609 ERROR [STDERR] at org.jboss.ejb3.entity.ManagedEntityManagerFactory.getTransactionScopedEntityManager(ManagedEntityManagerFactory.java:164)
      22:25:41,609 ERROR [STDERR] at org.jboss.ejb3.entity.TransactionScopedEntityManager.createNamedQuery(TransactionScopedEntityManager.java:132)
      22:25:41,609 ERROR [STDERR] at coco.nms.router.RouterManager.getRouter(Route
      rManager.java:215)

      My POJO looks like the following:

      @Entity
      @Table(name = "ROUTER")
      @org.hibernate.annotations.Table(appliesTo="ROUTER", indexes = { @Index(name="router_mac_index", columnNames = { "MAC" } ) } )
      @NamedQuery(name = "nms.Router.by.mac", query = "from Router r where r.mac = :mac")
      public class Router {
      }