2 Replies Latest reply on Jul 3, 2007 7:42 AM by asaf sh

    NPE with component's entity-query

    asaf sh Expert


      With Seam ver 1.2 I used <framework:entity-query> a lot and it worked perfectly,

      After migrating to Seam v2, I get a NPE exception,

      I have a persistence managed context declared in components.xml as:

      <core:managed-persistence-context name="entityManager" auto-create="true" persistence-unit-jndi-name="java:comp/env/edm_acc_em"/>

      where in web.xml I have a 'persistence-unit-ref' reference,

      Please note that I am using Glassfish V2 as an Appserver.

      Following is a part of the NPE stuck trace:
      Caused by: java.lang.NullPointerException
       at org.jboss.seam.framework.EntityQuery.createQuery(EntityQuery.java:140)
       at org.jboss.seam.framework.EntityQuery.initResultList(EntityQuery.java:60)
       at org.jboss.seam.framework.EntityQuery.getResultList(EntityQuery.java:52)
       at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
       at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
       at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)