1 Reply Latest reply on Jul 15, 2003 5:50 AM by r_clegg1

    NullPointer exception in ejbselect

    r_clegg1

      Hello,
      I am trying to get a simple ejbselect to work, but no matter what I try I get a nullpointer exception.
      My ejb-ql in ejb-jar.xml is :


      <ejb-ql>select distinct object(t) from SchemaNameisTransaction as t</ejb-ql>

      The record being selected as a primary key consisting of two fields in case that has any bearing on the matter.



      2003-07-14 14:34:57,340 DEBUG [org.jboss.ejb.plugins.cmp.jdbc.JDBCEJBQLQuery.Year.ejbSelectTransactions] Executing SQL: SELECT DISTINCT t0_t.year, t0_t.id FROM Transaction t0_t
      2003-07-14 14:34:57,450 ERROR [org.jboss.ejb.plugins.LogInterceptor] TransactionRolledbackLocalException, causedBy:
      java.lang.NullPointerException
      at org.jboss.ejb.plugins.cmp.jdbc.JDBCAbstractQueryCommand.execute(JDBCAbstractQueryCommand.java:224)
      at org.jboss.ejb.plugins.cmp.jdbc.JDBCAbstractQueryCommand.execute(JDBCAbstractQueryCommand.java:91)
      at

      Any ideas?

      Thanks

        • 1. Re: NullPointer exception in ejbselect
          r_clegg1

          Found the answer in case its useful:-
          The return type was set to local:


          <ejb-ql>select distinct object(t) from Transaction as t where t.year = ?1 </ejb-ql>

          <result-type-mapping>Local</result-type-mapping>

          However, even though I had created local and localhome interface classes, I had forgotten to set them up in the ejb-jar.xml for the
          transaction ejb, ie -

          <local-home>com.pcl.TransactionLocalHome</local-home>
          com.pcl.TransactionLocal

          so obvoiusly the local interfaces were not bound, causing the nullpointer problem during selection!