1 Reply Latest reply on Nov 29, 2002 11:18 AM by rafonso

    Error compiling ejbql

    rafonso

      Hello:
      I have a CMP EJB called StateCity. This bean has a field called countryStateId, that is a foreign key an a java.math.BigDecimal object. There is a other field called stateCityName, that is a String.
      In my bean I created a finder method called findByState() whose argument is a BigDecimal and returns a Collection with StateCities with same countryStateId. It's implements this EJBQL Query above:

      SELECT OBJECT(sc) FROM StateCity sc WHERE sc.countryStateId = ?1

      I use other finder method called findByName() whose argument is a String and returns a StateCity with same StateCityName. Its EJBQL query is:

      SELECT OBJECT(sc) FROM StateCity sc WHERE sc.stateCityName = ?1

      When I deploy my EJB, there is not problem with findByName(), but there is problem with findByState(). In deployment, JBoss shows this message:


      13:56:50,330 ERROR [URLDeploymentScanner] MBeanException: Exception in MBean operation 'checkIncompleteDeployments()'
      Cause: Incomplete Deployment listing:
      Packages waiting for a deployer:

      Incompletely deployed packages:

      MBeans waiting for classes:

      MBeans waiting for other MBeans:
      [ObjectName: jboss.j2ee:jndiName=CountryRemote,service=EJB
      state: FAILED
      I Depend On:
      Depends On Me: org.jboss.deployment.DeploymentException: Error compiling ejbql; - nested throwable: (org.jboss.ejb.plugins.cmp.ejbql.ParseException: Encountered "sc.countryStateId" at line 1, column 46.
      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> ...
      )]


      Even if I change findByState() argument type from BigDecimal to String or I change findByState() return type from Collection to a StateCity, I get the same message.
      What is the problem?

      Thanks,

      Rafael U. C. Afonso