problem with ejb-ql and cmr-field
adrianob Jan 26, 2005 3:09 PMHello,
im having the problem (bellow) with a finder method:
public Collection findContatosByPessoaPK(Long pessoaPK) throws javax.ejb.FinderException;
The error msg:
18:07:22,343 INFO [EJBDeployer] Deployed: file:/usr/local/jboss-4.0.0/server/default/deploy/cadPessoaServer.jar
18:07:22,694 ERROR [URLDeploymentScanner] Incomplete Deployment listing:
MBeans waiting for other MBeans:
ObjectName: jboss.j2ee:service=EJB,plugin=pool,jndiName=local/TipoTelefone
state: CREATED
I Depend On:
Depends On Me:
ObjectName: jboss.j2ee:jndiName=local/TipoTelefone,service=EJB
state: FAILED
I Depend On:
Depends On Me: org.jboss.deployment.DeploymentException: Error compiling EJB-QL statement 'SELECT OBJECT(o)
FROM Contato AS o, IN (o.representa) AS rep
WHERE rep.pessoaPK = ?1'; - nested throwable: (org.jboss.ejb.plugins.cmp.ejbql.UnknownPathException: Unknown terminal field: at line 2, column 83. Encountered: "representa" after: "o.")
MBEANS THAT ARE THE ROOT CAUSE OF THE PROBLEM:
ObjectName: jboss.j2ee:service=EJB,plugin=pool,jndiName=local/TipoTelefone
state: CREATED
I Depend On:
Depends On Me:
ObjectName: jboss.j2ee:jndiName=local/TipoTelefone,service=EJB
state: FAILED
I Depend On:
Depends On Me: org.jboss.deployment.DeploymentException: Error compiling EJB-QL statement 'SELECT OBJECT(o)
FROM Contato AS o, IN (o.representa) AS rep
WHERE rep.pessoaPK = ?1'; - nested throwable: (org.jboss.ejb.plugins.cmp.ejbql.UnknownPathException: Unknown terminal field: at line 2, column 83. Encountered: "representa" after: "o.")
---
So, representa (Collection) is a cmr-field resulted from ejb-relation between Pessoa and Contato. Why this error if representa is declared in ejb-relation?
<ejb-relation> <ejb-relation-name>representa</ejb-relation-name> <ejb-relationship-role> <ejb-relationship-role-name>Pessoa</ejb-relationship-role-name> <multiplicity>Many</multiplicity> <relationship-role-source> <ejb-name>Pessoa</ejb-name> </relationship-role-source> </ejb-relationship-role> <ejb-relationship-role> <ejb-relationship-role-name>Contato</ejb-relationship-role-name> <multiplicity>Many</multiplicity> <relationship-role-source> <ejb-name>Contato</ejb-name> </relationship-role-source> <cmr-field> <cmr-field-name>representa</cmr-field-name> <cmr-field-type>java.util.Collection</cmr-field-type> </cmr-field> </ejb-relationship-role> </ejb-relation>
Another information is that get/set of representa exist in ContatoBean, and are abstract.
Thanks.