JBoss does not find query tags in ejb-jar.xml
lordjoe Aug 10, 2004 11:38 PMI am trying to add custom finder methods to a CMP entity bean using xdoclet.
When I deploy I get the following errors
Bean : Player
Method : public abstract Collection findByValues(String, String, String, String) throws FinderException, RemoteException
Section: 10.5.6
Warning: Every finder method except findByPrimaryKey(key) must be associated with a query element in the deployment descriptor.
20:21:42,553 WARN [verifier] EJB spec violation:
Bean : Player
Method : public abstract Collection findByPosition(String) throws FinderException, RemoteException
Section: 10.5.6
Warning: Every finder method except findByPrimaryKey(key) must be associated with a query element in the deployment descriptor.
FOLLOWED BY :
20:21:42,933 ERROR [MainDeployer] could not create deployment: file:/K:/jboss-3.2.5/server/default/deploy/FBDraftEJB.jar
org.jboss.deployment.DeploymentException: Verification of Enterprise Beans failed, see above for error messages.
at org.jboss.ejb.EJBDeployer.create(EJBDeployer.java:517)
These lines appear in ejb-jar.xml within the Entity tag
<!-- THIS IS OK -->
<query-method>
<method-name>findAll</method-name>
<method-params>
</method-params>
</query-method>
<ejb-ql><![CDATA[SELECT OBJECT(a) FROM Player as a]]></ejb-ql>
<!-- FAILS -->
<query-method>
<method-name>findByValues</method-name>
<method-params>
<method-param>java.lang.String</method-param>
<method-param>java.lang.String</method-param>
<method-param>java.lang.String</method-param>
<method-param>java.lang.String</method-param>
</method-params>
</query-method>
<ejb-ql><![CDATA[SELECT OBJECT(a) FROM Player as a WHERE a.firstName LIKE ?1 and a.lastName LIKE ?2 and a.team.teamId LIKE ?3 and a.position.positionId LIKE ?4]]></ejb-ql>
<!-- FAILS -->
<query-method>
<method-name>findByPosition</method-name>
<method-params>
<method-param>java.lang.String</method-param>
</method-params>
</query-method>
<ejb-ql><![CDATA[SELECT OBJECT(a) FROM Player as a WHERE a.position.positionId = ?1]]></ejb-ql>
As far as I can tell everything looks right and the query tags that the deployer is complaining about are there -
Any bright ideas what is wrong