7 Replies Latest reply on Oct 8, 2002 4:34 AM by Petr MRAZ

    finders

    Petr MRAZ Newbie

      Hi,

      Does someone know why i'm getting this error message while deploying:
      ---------------------------------------------------------------
      org.jboss.deployment.DeploymentException: Could not deploy file:/C:/_GIS/jboss/server/default/deploy/test.jar; - nested throwable: (org.jbos
      s.deployment.DeploymentException: Error compiling ejbql; - nested throwable: (org.jboss.ejb.plugins.cmp.ejbql.ParseException: Encountered "ebcounter" at line 1, column 23.
      Was expecting one of:
      "IN" ...
      <ABSTRACT_SCHEMA> ...
      ))
      ---------------------------------------------------------------

      The finder which cause this error is as follows: (genereted by XDoclet)

      * @ejb:finder signature="Collection findByName java.lang.String text)"
      * unchecked="true"
      * query="SELECT OBJECT(o) FROM ebcounter o"

      Can someone write some simple example query, this is my first finder. Thanks.

        • 1. Re: finders
          Petr MRAZ Newbie

          I forgot, it's Entity beans, CMP

          • 2. Re: finders
            Juha Lindfors Master

            I don't know anything bout XDoclet but is this really how you declare the signature:

            * @ejb:finder signature="Collection findByName java.lang.String text)"

            (the unmatched parenthesis)?

            • 3. Re: finders
              Clarke Wood Newbie

              I'm not sure why you're getting that error, but I was getting the same one when I tried setting up similar finder queries using the same tags you're using. To work around this error, I switched to using the following tags (using your finder signature as an example):

              @ejb.finder signature="java.util.Collection findByName(java.lang.String text)"
              @jboss.finder-query name="findByName"
              query="SELECT OBJECT(o) FROM ebcounter o WHERE o.name = ?1"

              For some reason, I got the error only when I tried to define the query in the @ejb.finder tag but not in the @jboss.finder-query tag. I haven't had enough free time yet to investigate the issue further.

              I hope that helps!

              • 4. Re: finders
                Petr MRAZ Newbie

                yes, it helps, BUT a new trouble arised. The deployment is now okay, but when i try to call that finder (localy from session bean) i get this exception:

                javax.ejb.FinderException: Unknown query: public abstract java.util.Collection test.EBCounterLocalHome.findByName(java.lang.String) throws javax.ejb.FinderException


                The code fot that finder is:
                ---------------------------------------------------------
                @ejb:finder
                * signature="java.util.Collection findByName(java.lang.String text)"
                *
                * @jboss:finder-query name="findByName"
                * query="SELECT OBJECT(o) FROM ebcounter o WHERE o.data = ?1"
                ---------------------------------------------------------
                Any idea why? And btw, is chance to get container generated SQL query to check? (No query is sent to DB server when this exception arise)



                • 5. Re: finders
                  Petr MRAZ Newbie

                  yes, it helps, BUT a new trouble arised. The deployment is now okay, but when i try to call that finder (localy from session bean) i get this exception:

                  javax.ejb.FinderException: Unknown query: public abstract java.util.Collection test.EBCounterLocalHome.findByName(java.lang.String) throws javax.ejb.FinderException


                  The code fot that finder is:
                  ---------------------------------------------------------
                  @ejb:finder
                  * signature="java.util.Collection findByName(java.lang.String text)"
                  *
                  * @jboss:finder-query name="findByName"
                  * query="SELECT OBJECT(o) FROM ebcounter o WHERE o.data = ?1"
                  ---------------------------------------------------------
                  Any idea why? And btw, is chance to get container generated SQL query to check? (No query is sent to DB server when this exception arise)



                  • 6. Re: finders
                    Petr MRAZ Newbie

                    yes, it helps, BUT a new trouble arised. The deployment is now okay, but when i try to call that finder (localy from session bean) i get this exception:

                    javax.ejb.FinderException: Unknown query: public abstract java.util.Collection test.EBCounterLocalHome.findByName(java.lang.String) throws javax.ejb.FinderException


                    The code fot that finder is:
                    ---------------------------------------------------------
                    @ejb:finder
                    * signature="java.util.Collection findByName(java.lang.String text)"
                    *
                    * @jboss:finder-query name="findByName"
                    * query="SELECT OBJECT(o) FROM ebcounter o WHERE o.data = ?1"
                    ---------------------------------------------------------
                    Any idea why? And btw, is chance to get container generated SQL query to check? (No query is sent to DB server when this exception arise)



                    • 7. Re: finders
                      Petr MRAZ Newbie

                      yes, it helps, BUT a new trouble arised. The deployment is now okay, but when i try to call that finder (localy from session bean) i get this exception:

                      javax.ejb.FinderException: Unknown query: public abstract java.util.Collection test.EBCounterLocalHome.findByName(java.lang.String) throws javax.ejb.FinderException


                      The code fot that finder is:
                      ---------------------------------------------------------
                      @ejb:finder
                      * signature="java.util.Collection findByName(java.lang.String text)"
                      *
                      * @jboss:finder-query name="findByName"
                      * query="SELECT OBJECT(o) FROM ebcounter o WHERE o.data = ?1"
                      ---------------------------------------------------------
                      Any idea why? And btw, is chance to get container generated SQL query to check? (No query is sent to DB server when this exception arise)