1 Reply Latest reply on Mar 25, 2006 10:12 AM by Emmanuel Bernard

    URGENT: My SubQuery not working in JBoss 4.0.3SP1 & JBoss 4.

    Sami Newbie

      PLEASE HELP ME TO RESOLVE THIS SUBQUERY ISSUE

      My subquery is giving problem, I tried on both JBoss 4.0.3SP1 & JBoss 4.0.4RC1. I am using java version "1.5.0_06".

      In jbosscmp-jdbc.xml
      --------------------------
      <cmp-field><field-name>creationDate</field-name><column-name>CREATION_DATE</column-name></cmp-field>

      ==> In Oracle db CREATION_DATE field type is DATE


      In ejb-jar.xml
      -----------------


      <query-method>
      <method-name>findByBarIdAndProcessName</method-name>
      <method-params>
      <method-param>java.lang.String</method-param>
      <method-param>java.lang.String</method-param>
      </method-params>
      </query-method>
      <ejb-ql>

      <![CDATA[
      SELECT OBJECT(B)
      FROM BTS_WAF_SLICE_REJECTS B
      WHERE B.process = ?1 AND B.barId = ?2 AND B.creationDate = (SELECT MAX(A.creationDate) FROM BTS_WAF_SLICE_REJECTS A WHERE A.process = ?1 AND A.barId = ?2)
      ]]>

      </ejb-ql>


      I am getting exception in the console:-

      14:01:12,187 ERROR [STDERR] org.jboss.ejb.plugins.cmp.ejbql.ParseException: Encountered "(" at line 3, column 72.
      Was expecting one of:
      <DATETIME_VALUED_PARAMETER> ...
      <DATETIME_VALUED_PATH> ...
      .
      .
      14:01:12,750 WARN [ServiceController] Problem starting service jboss.j2ee:jndiName=bts/ejb/BtsWafSliceRejectHistoryHome,service=EJB
      org.jboss.deployment.DeploymentException: Error compiling EJB-QL statement 'SELECT OBJECT(B)
      FROM BTS_WAF_SLICE_REJECTS_HISTORY B
      WHERE B.process = ?1 AND B.barId = ?2 AND B.creationDate = (SELECT MAX(A.creationDate) FROM BTS_WAF_SLICE_REJECTS_HISTORY A WHERE A.process = ?1 AND A.barId = ?2)'; - nested throwable: (org.jboss.ejb.plugins.cmp.ejbql.ParseException: Encountered "(" at line 3, column 72.
      Was expecting one of:
      <DATETIME_VALUED_PARAMETER> ...
      <DATETIME_VALUED_PATH> ...
      )
      .
      .
      .
      14:01:15,031 ERROR [URLDeploymentScanner] Incomplete Deployment listing:

      --- MBeans waiting for other MBeans ---
      ObjectName: jboss.j2ee:jndiName=bts/ejb/BtsWafSliceRejectHistoryHome,service=EJB
      State: FAILED
      Reason: org.jboss.deployment.DeploymentException: Error compiling EJB-QL statement 'SELECT OBJECT(B)
      FROM BTS_WAF_SLICE_REJECTS_HISTORY B
      WHERE B.process = ?1 AND B.barId = ?2 AND B.creationDate = (SELECT MAX(A.creationDate) FROM BTS_WAF_SLICE_REJECTS_HISTORY A WHERE A.process = ?1 AND A.barId = ?2)'; - nested throwable: (org.jboss.ejb.plugins.cmp.ejbql.ParseException: Encountered "(" at line 3, column 72.
      Was expecting one of:
      <DATETIME_VALUED_PARAMETER> ...
      <DATETIME_VALUED_PATH> ...
      )

      --- MBEANS THAT ARE THE ROOT CAUSE OF THE PROBLEM ---
      ObjectName: jboss.j2ee:jndiName=bts/ejb/BtsWafSliceRejectHistoryHome,service=EJB
      State: FAILED
      Reason: org.jboss.deployment.DeploymentException: Error compiling EJB-QL statement 'SELECT OBJECT(B)
      FROM BTS_WAF_SLICE_REJECTS_HISTORY B
      WHERE B.process = ?1 AND B.barId = ?2 AND B.creationDate = (SELECT MAX(A.creationDate) FROM BTS_WAF_SLICE_REJECTS_HISTORY A WHERE A.process = ?1 AND A.barId = ?2)'; - nested throwable: (org.jboss.ejb.plugins.cmp.ejbql.ParseException: Encountered "(" at line 3, column 72.
      Was expecting one of:
      <DATETIME_VALUED_PARAMETER> ...
      <DATETIME_VALUED_PATH> ...
      )
      .
      .