1 Reply Latest reply on Nov 25, 2002 12:20 PM by Jeremy Boynes

    EJB-QL Parse Exception in 3.0.4

    Viktor Mikho Newbie


      I have a strange problem trying to use the following EJB-QL query:

      SELECT OBJECT(o) FROM StatusHistory AS o WHERE o.msgId=?1

      Is there anything wrong with it ?

      Exception is thrown:

      org.jboss.deployment.DeploymentException: Error compiling ejbql; - nested throwable: (org.jboss.ejb.plugins.cmp.ejbql.ParseException: Encountered "o.msgId" at line 1, column 50.
      Was expecting one of:
      "NOT" ...
      "(" ...
      "CONCAT" ...
      "SUBSTRING" ...
      "LENGTH" ...
      "LOCATE" ...
      "ABS" ...
      "SQRT" ...
      "+" ...
      "-" ...
      at org.jboss.ejb.plugins.cmp.jdbc.JDBCEJBQLQuery.(JDBCEJBQLQuery.java:46)

      The following is an extract from ejb-jar.xml


      <ejb-ql>SELECT OBJECT(o) FROM StatusHistory AS o WHERE o.msgId=?1</ejb-ql>

        • 1. Re: EJB-QL Parse Exception in 3.0.4
          Jeremy Boynes Newbie

          JBoss does not recognize BigDecimal as a defined EJB-QL type and so treats it as a ValueClassValuedPath. These cannot be used in ComparisonExpression's.

          Fixed decimals like BigDecimal are specifically not supported by the spec (11.2.12) so unless you can convert your id's to an integer type EJB-QL may not work for you.

          You might be able to code this with declared-sql.