2 Replies Latest reply on Oct 21, 2002 2:05 PM by alexb

    Problems with JBoss3.0.3 and EJB-QL

    pedro

      Hello,

      I'm trying to learn J2EE and I have decided to do a simple application which uses CMP Entity Beans. This application has a cmp entity bean called "Category" which is related to itself with a bidirectional one-to-many relationship. Until here all work correctly. The problem appears when I create the next find method using EJB-QL:

      "SELECT OBJECT(c) FROM Category WHERE c.padre=?1"

      It's too easy, isn't it?

      Well, when I try to deploy my application in JBoss 3.0.3 the next error appears:

      2002-10-21 14:23:32,188 INFO [org.jboss.ejb.plugins.cmp.jdbc.JDBCStartCommand.Category] Created table 'CATEGORY' successfully.
      2002-10-21 14:23:32,208 WARN [org.jboss.system.ServiceController] Problem starting service jboss.j2ee:jndiName=Category,service=EJB
      org.jboss.deployment.DeploymentException: Error compiling ejbql; - nested throwable: (org.jboss.ejb.plugins.cmp.ejbql.ParseException: Encountered "1" at line 1, column 53.
      Was expecting one of:
      <IDENTIFICATION_VARIABLE> ...
      <ENTITY_VALUED_PARAMETER> ...
      <ENTITY_VALUED_PATH> ...
      )
      at org.jboss.ejb.plugins.cmp.jdbc.JDBCEJBQLQuery.(JDBCEJBQLQuery.java:46)
      at org.jboss.ejb.plugins.cmp.jdbc.JDBCCommandFactory.createEJBQLQuery(JDBCCommandFactory.java:44)
      at org.jboss.ejb.plugins.cmp.jdbc.JDBCQueryManager.start(JDBCQueryManager.java:218)
      ...

      (The exception is tooooooo large)

      Does anybody know the problem and the solution?

      Thank you very much and sorry for my poor English.

        • 1. Re: Problems with JBoss3.0.3 and EJB-QL
          pedro

          I'm sorry. I made a mistake when I wrote the EJB-QL query in my email. The finder method in my non-worked application is:

          "SELECT OBJECT(c) FROM Category c WHERE c.padre=?1"

          My application still doesn't work.

          • 2. Re: Problems with JBoss3.0.3 and EJB-QL
            alexb

            I'm assuming that everything else is correct in your jbosscmp-jdbc.xml file try this...
            In your jbosscmp-jdbc.xml file replace your code with this

            SELECT OBJECT(c)FROM Category AS c
            WHERE c.padre=?1

            hope this helps...
            Alex