2 Replies Latest reply on Aug 16, 2002 9:44 AM by vishal

    <dynamic-ql> problem

    vishal Newbie

      I defined findByPrimaryKeys in Home interface and also defined ejbFindByPromaryKeys in Bean method generating JBossQL query and passed it to the abstract ejbSelectGeneric method (as defined in GangsterBean example). ejbSelectGeneric method is defined both in ejb-jar.xml(as empty entry) and jbosscmp-jdbc.xml(as dynamic-ql)
      now it seems ok to me but jboss throws exception error

      16:45:56,741 DEBUG [ejbSelectGeneric] DYNAMIC-QL: SELECT OBJECT(obj) FROM CNCONSTANT obj WHERE obj.cnconstant IN (?1 , ?2 , ?3 , ?4 , ?5) ORDER BY obj.CNCONSTANT
      16:45:56,756 ERROR [ejbFindByPrimaryKeys] Error invoking custom finder ejbFindByPrimaryKeys
      javax.ejb.FinderException: Error compiling ejbql: org.jboss.ejb.plugins.cmp.ejbql.ParseException: Encountered "CNCONSTANT" at line 1, column 25.
      Was expecting one of:
      "IN" ...
      <ABSTRACT_SCHEMA> ...

      at org.jboss.ejb.plugins.cmp.jdbc.JDBCDynamicQLQuery.execute(JDBCDynamicQLQuery.java:74)
      at org.jboss.ejb.plugins.cmp.jdbc.bridge.JDBCSelectorBridge.execute(JDBCSelectorBridge.java:64)
      at org.jboss.ejb.plugins.cmp.bridge.EntityBridgeInvocationHandler.invoke(EntityBridgeInvocationHandler.java:95)
      at org.jboss.proxy.compiler.Runtime.invoke(Runtime.java:59)
      at uk.co.isesolutions.apps.ccd.cnconstant.entity.CnConstantBean$Proxy.ejbSelectGeneric()
      at uk.co.isesolutions.apps.ccd.cnconstant.entity.CnConstantBean.ejbFindByPrimaryKeys(Unknown Source)

        • 1. Re: <dynamic-ql> problem
          L.G. Newbie

          By EJB spec you must call ejbHome<...> method in bean class if you using HOme method and must not call find<...> method in Home Interface unless it's a real finder.
          Anyway, read the specs :)

          • 2. Re: <dynamic-ql> problem
            vishal Newbie

            I have changed the findByPrimaryKeys to selectByPrimaryKeys and same in bean changes ejbFindByPrimaryKeys to ejbHomeSelectByPrimaryKeys.
            i have defined cnConstant as <abstract-schema-name> and cnConstant is defined as <cmp-field> attribute in ejb-jar.xml.
            But jboss throws exception
            11:44:47,788 DEBUG [ejbSelectGeneric] DYNAMIC-QL: SELECT OBJECT(o) FROM cnConstant o WHERE o.cnConstant IN(?1 , ?2 , ?3 , ?4 , ?5)
            11:44:47,803 ERROR [STDERR] javax.ejb.FinderException: Error compiling ejbql: org.jboss.ejb.plugins.cmp.ejbql.ParseException: Encountered "o.cnConstant" at line 1, column 50.
            Was expecting one of:
            "NOT" ...
            <STRING_VALUED_PATH> ...
            <COLLECTION_VALUED_PATH> ...
            "(" ...
            "CONCAT" ...
            "SUBSTRING" ...
            "UCASE" ...
            "LCASE" ...
            <BOOLEAN_VALUED_PATH> ...
            <DATETIME_VALUED_PATH> ...
            <VALUE_CLASS_VALUED_PATH> ...
            <ENTITY_VALUED_PATH> ...
            <IDENTIFICATION_VARIABLE> ...
            <NUMERIC_VALUED_PATH> ...

            11:44:47,819 ERROR [STDERR] at org.jboss.ejb.plugins.cmp.jdbc.JDBCDynamicQLQuery.execute(JDBCDynamicQLQuery.java:74)
            11:44:47,819 ERROR [STDERR] at org.jboss.ejb.plugins.cmp.jdbc.bridge.JDBCSelectorBridge.execute(JDBCSelectorBridge.java:64)
            11:44:47,819 ERROR [STDERR] at org.jboss.ejb.plugins.cmp.bridge.EntityBridgeInvocationHandler.invoke(EntityBridgeInvocationHandler.java:95)
            11:44:47,819 ERROR [STDERR] at org.jboss.proxy.compiler.Runtime.invoke(Runtime.java:59)
            11:44:47,819 ERROR [STDERR] at uk.co.isesolutions.apps.ccd.cnconstant.entity.CnConstantBean$Proxy.ejbSelectGeneric()
            11:44:47,819 ERROR [STDERR] at uk.co.isesolutions.apps.ccd.cnconstant.entity.CnConstantBean.ejbHomeSelectByPrimaryKeys(Unknown Source)