3 Replies Latest reply on Feb 27, 2002 10:33 AM by Marcus Brito

    EJB-QL Problem in jboss-3.0.0beta

    Marcus Brito Novice

      I've got a problem deploying some CMP entity beans into jboss 3.0 beta. Here is the problem:

      DEBUG [findAll] EQL-QL: SELECT OBJECT(a) FROM Agente a
      DEBUG [findAll] SQL: SELECT t1_a.AGENTE_ID FROM AGENTES t1_a
      DEBUG [findByLogin] EQL-QL: SELECT OBJECT(a) FROM Agente a WHERE a.login LIKE ?1ERROR [EntityContainer] Exception in service lifecyle operation: start
      org.jboss.deployment.DeploymentException: Unable to parse EJB-QL: SELECT OBJECT(a) FROM Agente a WHERE a.login LIKE ?1
       at org.jboss.ejb.plugins.cmp.jdbc.JDBCEJBQLQuery.<init>(JDBCEJBQLQuery.java:51)
       at org.jboss.ejb.plugins.cmp.jdbc.JDBCCommandFactory.createEJBQLQuery(JDBCCommandFactory.java:44)
       at org.jboss.ejb.plugins.cmp.jdbc.JDBCQueryManager.start(JDBCQueryManager.java:177)
       at org.jboss.ejb.plugins.cmp.jdbc.JDBCStoreManager.start(JDBCStoreManager.java:335)
      


      The stack trace continues. I posted only while it's in org.jboss.ejb.plugins.cmp.jdbc package. Please note that the findAll() EJB-QL is correctly parsed, but the findByLogin(String login) gives an error. Just to make sure I'm not crazy. here is the portion from ejb-jar.xml regarding this bean and query.


      <entity>
       <ejb-name>Agente</ejb-name>
       (...)
       <cmp-field>
       <description>[[CDATA[]]</description>
       <field-name>login</field-name>
       </cmp-field>
       (...)
       <query>
       <query-method>
       <method-name>findByLogin</method-name>
       <methad-params>
       <method-param>java.lang.String</method-param>
       </method-params>
       </query-method>
       <result-type-mapping>Local</result-type-mapping>
       <ejb-ql>[CDATA[SELECT OBJECT(a) FROM Agente(a) WHERE a.login LIKE ?1]]</ejb-ql>
       </query>
      </entity>
      


      And here is the jbosscmp-jdbc.xml section relative to this bean and query:
      <entity>
       <ejb-name>Agente</ejb-name>
       (...)
       <cmp-field>
       <field-name>login</field-name>
       <column-name>LOGIN</column-name>
       </cmp-field>
      </entity>
      

      What could be possibly wrong?