2 Replies Latest reply on Sep 10, 2002 8:29 AM by Carles Pairot

    Error compiling ejbql

    Carles Pairot Newbie

      Hi all,

      I am just having a problem defining an entity's finder query. The query is defined as follows:

      <ejb-ql><![CDATA[SELECT OBJECT(r) FROM ProjectUserRole AS r WHERE r.user = ?1 AND r.role = ?2]]></ejb-ql>

      But when I deploy it on JBoss 3.0.2 it gives me this error:

      09:31:20,328 WARN [ServiceController] Problem starting service jboss.j2ee:servi
      org.jboss.deployment.DeploymentException: Error compiling ejbql; - nested throwa
      ble: (org.jboss.ejb.plugins.cmp.ejbql.ParseException: Encountered "1" at line 1,
      column 59.
      Was expecting one of:
      at org.jboss.ejb.plugins.cmp.jdbc.JDBCEJBQLQuery.(JDBCEJBQLQuery.j
      at org.jboss.ejb.plugins.cmp.jdbc.JDBCCommandFactory.createEJBQLQuery(JD
      at org.jboss.ejb.plugins.cmp.jdbc.JDBCQueryManager.start(JDBCQueryManage
      at org.jboss.ejb.plugins.cmp.jdbc.JDBCStoreManager.startStoreManager(JDB
      at org.jboss.ejb.plugins.cmp.jdbc.JDBCStoreManager.start(JDBCStoreManage
      at org.jboss.ejb.plugins.CMPPersistenceManager.start(CMPPersistenceManag
      at org.jboss.ejb.EntityContainer.start(EntityContainer.java:376)
      at org.jboss.ejb.Container.invoke(Container.java:764)
      at org.jboss.ejb.EntityContainer.invoke(EntityContainer.java:1055)

      As the query's syntax appears to be fine, I think the problem may be because the ?1 and ?2 parameters are in fact VARCHAR(48) fields rather than VARCHAR(255) fields, as Java Strings are mapped to. So I think I have an incompatible type problem.

      If so, do you have any ideas on how could I fix this problem ?

      Thanks in advance.