3 Replies Latest reply on Jul 1, 2002 4:52 AM by Sylvain Munaut

    Problems with ejb-ql

    Sylvain Munaut Newbie


      I'm having troubles while getting ejb-ql to work.

      I try to implement a query and I can't get any results.
      The query is "findDesc(String description)" (defined in the Home interface and ejb-jar.xml).
      I know I can use the findByXX but it is just a test to see if it works....
      There are no exceptions, just any empty resul set.
      The findAll() method is working, and the DB s working fine as well...
      I tried to implement the method with and without params...

      Tried some other thing but I out of imagination ....

      So may be I am missing some points....

      If anyone has any idea, it would be very help full

      In ejb-jar.xml:


      Models a Stock IN or OUT operation

      <![CDATA[SELECT OBJECT(a) FROM StockOp AS a WHERE a.description = ?1]]>


        • 1. Re: Problems with ejb-ql
          Sylvain Munaut Newbie

          Ok I've found one of the problems, it was in the DOCTYPE definition in ejb-jar.xml, I left an EJB 1.1 definition instead of 2.0.

          But for now I'm running into a new problem .... :

          [java] javax.ejb.FinderException: Unknown query: public abstract java.util.Collection test1.interfaces.StockOpHome.findTest() throws javax.ejb.FinderException,java.rmi.RemoteException

          The StockOpHome.java has:

          public Collection findTest() throws FinderException, RemoteException;

          The ejb-jar.xml has:

          <![CDATA[SELECT OBJECT(a) FROM StockOp AS a WHERE a.ref IS NOT NULL]]>

          • 2. Re: Problems with ejb-ql
            Dain Sundstrom Master

            That is weird. You are calling a finder and the persistence manager can not find the query specification. Try a clean build of your application.

            If that doesn't work, increase the log level of the org.jboss.ejb.plugins.cmp to DEBUG in the log4j.xml file. Then run your application and search the server log for anything related to findTest.

            • 3. Re: Problems with ejb-ql
              Sylvain Munaut Newbie

              It's ok it works !

              In the xml file ejb-jar, I misplaced an tag and the query were out the entity ...