5 Replies Latest reply on Jun 3, 2003 3:29 PM by ccsdev

    Error compiling EJB-QL statement

    ccsdev Newbie

      Hi, I'm having some problems deploying my jar in jboss. When I run jboss it gives me the following exception:

      [ObjectName: jboss.j2ee:jndiName=MyBeanLocalHome,service=EJB
      state: FAILED
      I Depend On:
      Depends On Me: org.jboss.deployment.DeploymentException: Error compiling EJB-QL
      statement 'SELECT DISTINCT OBJECT(o) FROM MyBean o WHERE o.cost = ?1'; - n
      ested throwable: (org.jboss.ejb.plugins.cmp.ejbql.ParseException: Encountered "o
      .cost" at line 1, column 54.
      Was expecting one of:
      "NOT" ...
      "(" ...
      <COLLECTION_VALUED_PATH> ...
      <STRING_VALUED_PATH> ...
      "CONCAT" ...
      "SUBSTRING" ...
      <BOOLEAN_VALUED_PATH> ...
      <DATETIME_VALUED_PATH> ...
      <ENTITY_VALUED_PATH> ...
      <IDENTIFICATION_VARIABLE> ...
      <NUMERIC_VALUED_PATH> ...
      "LENGTH" ...
      "LOCATE" ...
      "ABS" ...
      "SQRT" ...
      "+" ...
      "-" ...
      <INTEGER_LITERAL> ...
      <FLOATING_POINT_LITERAL> ...
      <NUMERIC_VALUED_PARAMETER> ...
      )]

      You must know that my jar was generated by middlegen and I've had no luck with their mailing list regarding this subject. I'm using MSSQL 2000.

      I would truly appreciate any help you could give me.

        • 1. Re: Error compiling EJB-QL statement
          Juha Lindfors Master

          can you post the relevant parts of your deployment descriptor -- the type of cost CMP field, the type of the arg ?1, abstract schema names etc.

          • 2. Re: Error compiling EJB-QL statement
            ccsdev Newbie

            The following is the entity in question. I took out the irrelevant fields but I left in all the queries.

            I must tell you that this not only happens with this particular entity, I used to think it had something to do with my database and I eliminated the table who's entity was giving me problems and now this one's giving me the same problem.

            I truly appreciate your help. I don't know what else to do.


            <ejb-name>DemoService</ejb-name>

            <local-home>tellarian.interfaces.DemoServiceLocalHome</local-home>
            tellarian.interfaces.DemoServiceLocal

            <ejb-class>tellarian.ejb.DemoServiceCMP</ejb-class>
            <persistence-type>Container</persistence-type>
            <prim-key-class>java.lang.String</prim-key-class>
            False
            <cmp-version>2.x</cmp-version>
            <abstract-schema-name>DemoService</abstract-schema-name>

            <cmp-field >
            <![CDATA[Returns the cost]]>
            <field-name>cost</field-name>
            </cmp-field>

            <primkey-field>code</primkey-field>


            <query-method>
            <method-name>findAll</method-name>
            <method-params>
            </method-params>
            </query-method>
            <result-type-mapping>Local</result-type-mapping>
            <ejb-ql><![CDATA[SELECT OBJECT(o) FROM DemoService o]]></ejb-ql>


            <![CDATA[name is not indexed.]]>
            <query-method>
            <method-name>findByName</method-name>
            <method-params>
            <method-param>java.lang.String</method-param>
            </method-params>
            </query-method>
            <result-type-mapping>Local</result-type-mapping>
            <ejb-ql><![CDATA[SELECT DISTINCT OBJECT(o) FROM DemoService o WHERE o.name = ?1]]></ejb-ql>


            <![CDATA[cost is not indexed.]]>
            <query-method>
            <method-name>findByCost</method-name>
            <method-params>
            <method-param>java.math.BigDecimal</method-param>
            </method-params>
            </query-method>
            <result-type-mapping>Local</result-type-mapping>
            <ejb-ql><![CDATA[SELECT DISTINCT OBJECT(o) FROM DemoService o WHERE o.cost = ?1]]></ejb-ql>

            • 3. Re: Error compiling EJB-QL statement
              Frank Langelage Master

              If I remember correct, Datatype BigDecimal is not supported here.
              You may try an nearly equivalent (Double).
              I gues this will work.

              • 4. Re: Error compiling EJB-QL statement
                ccsdev Newbie

                Thank you, I'll certainly try that. I'll llet everyone know if it works.

                • 5. Re: Error compiling EJB-QL statement
                  ccsdev Newbie

                  It was definitely that!!!!! I changed it for double and it deployed just fine.

                  I truly appreciate all the help.