2 Replies Latest reply on Mar 13, 2004 7:40 AM by aloubyansky

    Upgrade from 3.0.6 to 3.2.3 breaks trivial ejbSelect

    rstinejr

      Upgrading from 3.0.6 to 3.2.3 results in a null pointer exception in the generated code of the following trivial ejbSelect method:


      <query-method>
      <method-name>ejbSelectFoo</method-name>
      <method-params>
      <method-param>java.lang.Integer</method-param>
      </method-params>
      </query-method>
      <ejb-ql><![CDATA[SELECT OBJECT(f)
      FROM Foo f
      WHERE f.fooId =?1]]></ejb-ql>


      I verify that I'm not passing a null argument before trying to call ejbSelectFoo.

      Any ideas, other than the obvious one of reverting to 3.0.6?

        • 1. Re: Upgrade from 3.0.6 to 3.2.3 breaks trivial ejbSelect
          rstinejr

          More info: the NPE is getting thrown by org.jboss.ejb.plugins.cmp.jdbc.JDBCAbstractQueryCommand; the pertinent part of the stack trace is:

          java.lang.NullPointerException
          at org.jboss.ejb.plugins.cmp.jdbc.JDBCAbstractQueryCommand.execute(JDBCAbstractQueryCommand.java:273)
          at org.jboss.ejb.plugins.cmp.jdbc.JDBCAbstractQueryCommand.execute(JDBCAbstractQueryCommand.java:111)
          at org.jboss.ejb.plugins.cmp.jdbc.bridge.JDBCSelectorBridge.execute(JDBCSelectorBridge.java:64)
          at org.jboss.ejb.plugins.cmp.bridge.EntityBridgeInvocationHandler.invoke(EntityBridgeInvocationHandler.java:91)
          at org.jboss.proxy.compiler.Runtime.invoke(Runtime.java:59)
          at mil.tis.enterprise.plan.UnitDeploymentItemHazardBean$Proxy.ejbSelectHazardousUnitEquipmentItem()



          Line 273 of method JDBCAbstractQueryCommand.java, with a little context, is:

           // This is an ejbSelect, so we need to convert the pks to real ejbs.
           EntityContainer selectContainer = selectManager.getContainer();
           if (queryMetaData.isResultTypeMappingLocal())
           {
           LocalProxyFactory localFactory = selectContainer.getLocalProxyFactory();
           return localFactory.getEntityLocalCollection(results);
           }
           else
           {
           EJBProxyFactory factory = selectContainer.getProxyFactory();
           return factory.getEntityCollection(results);
           }
          
           // This is an ejbSelect, so we need to convert the pks to real ejbs.
           EntityContainer selectContainer = selectManager.getContainer();
           if (queryMetaData.isResultTypeMappingLocal())
           {
           LocalProxyFactory localFactory = selectContainer.getLocalProxyFactory();
           return localFactory.getEntityLocalCollection(results);
           }
           else
           {
           EJBProxyFactory factory = selectContainer.getProxyFactory();
           return factory.getEntityCollection(results); // <<<<< line 273
           }
          


          Desk checking this (I haven't run JBoss itself thru the debugger), it appears that selectContainer.getProxyFactory() is returning a null.


          • 2. Re: Upgrade from 3.0.6 to 3.2.3 breaks trivial ejbSelect
            aloubyansky

            There is nothing neither wrong nor special in this query. It should work. How can I reproduce it? Do you have a testcase?