0 Replies Latest reply on Oct 6, 2005 10:16 AM by Pavel Kaplin

    NPE on EJB QL execution

    Pavel Kaplin Newbie

      It seems it is a bug...

      Environment: JBoss 3.2.7, JDK 1.5.0_04

      Query text:

      SELECT OBJECT(s) FROM story s WHERE s.category = ?1


      Relationship between category and story is one-to-many. When trying to execute something like this:
      storyHome.findByCategory(null)


      the following NPE occurs:
      java.lang.NullPointerException
      at org.jboss.ejb.plugins.cmp.jdbc.QueryParameter.set(QueryParameter.java:288)
      at org.jboss.ejb.plugins.cmp.jdbc.JDBCAbstractQueryCommand.execute(JDBCAbstractQueryCommand.java:222)
      at org.jboss.ejb.plugins.cmp.jdbc.JDBCAbstractQueryCommand.execute(JDBCAbstractQueryCommand.java:128)
      at org.jboss.ejb.plugins.cmp.jdbc.JDBCFindEntityCommand.execute(JDBCFindEntityCommand.java:47)
      at org.jboss.ejb.plugins.cmp.jdbc.JDBCStoreManager.findEntity(JDBCStoreManager.java:589)
      at org.jboss.ejb.plugins.CMPPersistenceManager.findEntity(CMPPersistenceManager.java:271)
      at org.jboss.resource.connectionmanager.CachedConnectionInterceptor.findEntity(CachedConnectionInterceptor.java:302)
      at org.jboss.ejb.EntityContainer.findSingleObject(EntityContainer.java:1039)
      at org.jboss.ejb.EntityContainer.findLocal(EntityContainer.java:623)


      Does anyone knows how to eliminate this? Thank you.

      PS. According to the EJB 2.0 Spec (section 11.2.9), null value as a query parameter value must be interpreteted as "is null" clause.