1 Reply Latest reply on Sep 25, 2002 3:44 PM by Dain Sundstrom

    EJBQL Parser exception using AND

    Axel Mueller Newbie

      I'm getting an exception from the EJBQL parser whenever I try to use multiple conditions concatenated by AND keyword. From all EJB-QL files I have seen the code looks valid to me (but you never know ;-) ):


      <query-method>
      <method-name>findByBknrAndPano</method-name>
      <method-params>
      <method-param>long</method-param>
      <method-param>long</method-param>
      </method-params>
      </query-method>
      <result-type-mapping>Local</result-type-mapping>
      <ejb-ql><![CDATA[SELECT OBJECT(a) FROM Referenz AS a WHERE a.partnerBknr = ?1 AND a.partnerPano = ?2]]></ejb-ql>



      The exception I get is as follows:

      [java] 17:51:43,027 INFO [Referenz] Table 'REFERENZ_TAB' already exists
      [java] 17:51:43,042 ERROR [EntityContainer] Starting failed
      [java] org.jboss.deployment.DeploymentException: Error compiling ejbql; - nested throwable: (org.jboss.ejb.plugins.cmp.ejbql.ParseException: Encountered "2" at line 1, column 82.
      [java] Was expecting one of:
      [java] "CONCAT" ...
      [java] "SUBSTRING" ...
      [java] "(" ...
      [java] <STRING_LITERAL> ...
      [java] <STRING_VALUED_PARAMETER> ...
      [java] <STRING_VALUED_PATH> ...
      [java] )
      [java] at org.jboss.ejb.plugins.cmp.jdbc.JDBCEJBQLQuery.(JDBCEJBQLQuery.java:46)
      [java] at org.jboss.ejb.plugins.cmp.jdbc.JDBCCommandFactory.createEJBQLQuery(JDBCCommandFactory.java:44)
      [java] at org.jboss.ejb.plugins.cmp.jdbc.JDBCQueryManager.start(JDBCQueryManager.java:214)
      [java] at org.jboss.ejb.plugins.cmp.jdbc.JDBCStoreManager.startStoreManager(JDBCStoreManager.java:463)
      [java] at org.jboss.ejb.plugins.cmp.jdbc.JDBCStoreManager.start(JDBCStoreManager.java:369)
      [java] at org.jboss.ejb.plugins.CMPPersistenceManager.start(CMPPersistenceManager.java:198)
      [java] at org.jboss.ejb.EntityContainer.startService(EntityContainer.java:359)
      [java] at org.jboss.system.ServiceMBeanSupport.start(ServiceMBeanSupport.java:196)
      [java] at org.jboss.ejb.Container.invoke(Container.java:720)
      [java] at org.jboss.ejb.EntityContainer.invoke(EntityContainer.java:1023)
      [java] at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:549)
      [java] at org.jboss.system.ServiceController$ServiceProxy.invoke(ServiceController.java:960)
      [java] at $Proxy9.start(Unknown Source)
      [java] at org.jboss.system.ServiceController.start(ServiceController.java:387)
      [java] at sun.reflect.GeneratedMethodAccessor10.invoke(Unknown Source)
      [java] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      [java] at java.lang.reflect.Method.invoke(Method.java:324)
      [java] at org.jboss.mx.capability.ReflectedMBeanDispatcher.invoke(ReflectedMBeanDispatcher.java:284)
      [java] at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:549)
      [java] at org.jboss.util.jmx.MBeanProxy.invoke(MBeanProxy.java:174)
      [java] at $Proxy251.start(Unknown Source)
      [java] at org.jboss.ejb.EjbModule.startService(EjbModule.java:444)
      [java] at org.jboss.system.ServiceMBeanSupport.start(ServiceMBeanSupport.java:196)
      [java] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      [java] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      [java] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      [java] at java.lang.reflect.Method.invoke(Method.java:324)
      [java] at org.jboss.mx.capability.ReflectedMBeanDispatcher.invoke(ReflectedMBeanDispatcher.java:284)
      [java] at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:549)
      [java] at org.jboss.system.ServiceController$ServiceProxy.invoke(ServiceController.java:960)
      [java] at $Proxy9.start(Unknown Source)
      [java] at org.jboss.system.ServiceController.start(ServiceController.java:387)
      [java] at sun.reflect.GeneratedMethodAccessor10.invoke(Unknown Source)
      [java] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      [java] at java.lang.reflect.Method.invoke(Method.java:324)
      [java] at org.jboss.mx.capability.ReflectedMBeanDispatcher.invoke(ReflectedMBeanDispatcher.java:284)
      [java] at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:549)
      [java] at org.jboss.util.jmx.MBeanProxy.invoke(MBeanProxy.java:174)
      [java] at $Proxy20.start(Unknown Source)
      [java] at org.jboss.ejb.EJBDeployer.start(EJBDeployer.java:469)
      [java] at org.jboss.deployment.MainDeployer.start(MainDeployer.java:812)
      [java] at org.jboss.deployment.MainDeployer.start(MainDeployer.java:804)
      [java] at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:624)
      [java] at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:588)
      [java] at sun.reflect.GeneratedMethodAccessor17.invoke(Unknown Source)
      [java] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      [java] at java.lang.reflect.Method.invoke(Method.java:324)
      [java] at org.jboss.mx.capability.ReflectedMBeanDispatcher.invoke(ReflectedMBeanDispatcher.java:284)
      [java] at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:549)
      [java] at org.jboss.util.jmx.MBeanProxy.invoke(MBeanProxy.java:174)
      [java] at $Proxy7.deploy(Unknown Source)
      [java] at org.jboss.deployment.scanner.URLDeploymentScanner.deploy(URLDeploymentScanner.java:392)
      [java] at org.jboss.deployment.scanner.URLDeploymentScanner.scan(URLDeploymentScanner.java:516)
      [java] at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.doScan(AbstractDeploymentScanner.java:187)
      [java] at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.loop(AbstractDeploymentScanner.java:197)
      [java] at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.run(AbstractDeploymentScanner.java:177)
      [java] Caused by: org.jboss.ejb.plugins.cmp.ejbql.ParseException: Encountered "2" at line 1, column 82.
      [java] Was expecting one of:
      [java] "CONCAT" ...
      [java] "SUBSTRING" ...
      [java] "(" ...
      [java] <STRING_LITERAL> ...
      [java] <STRING_VALUED_PARAMETER> ...
      [java] <STRING_VALUED_PATH> ...
      [java]
      [java] at org.jboss.ejb.plugins.cmp.ejbql.EJBQLParser.generateParseException(EJBQLParser.java:3745)
      [java] at org.jboss.ejb.plugins.cmp.ejbql.EJBQLParser.jj_consume_token(EJBQLParser.java:3626)
      [java] at org.jboss.ejb.plugins.cmp.ejbql.EJBQLParser.StringExpression(EJBQLParser.java:1414)
      [java] at org.jboss.ejb.plugins.cmp.ejbql.EJBQLParser.ComparisonExpression(EJBQLParser.java:905)
      [java] at org.jboss.ejb.plugins.cmp.ejbql.EJBQLParser.SimpleCondExpression(EJBQLParser.java:588)
      [java] at org.jboss.ejb.plugins.cmp.ejbql.EJBQLParser.ConditionalPrimary(EJBQLParser.java:546)
      [java] at org.jboss.ejb.plugins.cmp.ejbql.EJBQLParser.ConditionalTest(EJBQLParser.java:514)
      [java] at org.jboss.ejb.plugins.cmp.ejbql.EJBQLParser.ConditionalFactor(EJBQLParser.java:491)
      [java] at org.jboss.ejb.plugins.cmp.ejbql.EJBQLParser.ConditionalTerm(EJBQLParser.java:453)
      [java] at org.jboss.ejb.plugins.cmp.ejbql.EJBQLParser.ConditionalExpression(EJBQLParser.java:401)
      [java] at org.jboss.ejb.plugins.cmp.ejbql.EJBQLParser.WhereClause(EJBQLParser.java:370)
      [java] at org.jboss.ejb.plugins.cmp.ejbql.EJBQLParser.EJBQL(EJBQLParser.java:102)
      [java] at org.jboss.ejb.plugins.cmp.ejbql.EJBQLParser.parse(EJBQLParser.java:60)
      [java] at org.jboss.ejb.plugins.cmp.jdbc.JDBCEJBQLCompiler.compileEJBQL(JDBCEJBQLCompiler.java:144)
      [java] at org.jboss.ejb.plugins.cmp.jdbc.JDBCEJBQLQuery.(JDBCEJBQLQuery.java:40)
      [java] ... 55 more

      I already seached JBoss forums but could not find the question already answered.

      Axel