- This topic has 4 replies, 2 voices, and was last updated 20 years ago by Riyad Kalla.
-
AuthorPosts
-
waiwahMember* @ejb.finder signature=”Collection findAll()”
* query=”SELECT OBJECT(b) FROM Borrower b”
*
* @ejb.finder signature=”Collection findBySurname(String surname)”
* query=”SELECT OBJECT(b) FROM Borrower b WHERE b.surname = ?1″
*
* @ejb.finder signature=”Collection findByFullname(String fullname)”
* query=”SELECT OBJECT(b) FROM Borrower b WHERE b.fullname = ?1″
*I have the above xdoclet tags in my entity bean. When i deploy to JBoss, it shows the errors below. When i remove the last 2 tags, which is findBySurname and findByFullname, it works. I double checked the deployment descriptor, the queries are there. What am I missing?? thanks.,
02:51:26,468 WARN [verifier] EJB spec violation:
Bean : Borrower
Method : public abstract Collection findBySurname(String) throws FinderException
Section: 10.5.6
Warning: Every finder method except findByPrimaryKey(key) must be associated with a query element in the deployment descriptor.02:51:26,468 WARN [verifier] EJB spec violation:
Bean : Borrower
Method : public abstract Collection findByFullname(String) throws FinderException
Section: 10.5.6
Warning: Every finder method except findByPrimaryKey(key) must be associated with a query element in the deployment descriptor.
Riyad KallaMemberI am checking with our EJB guru.
waiwahMemberproblem solved. it appears that u need to put the full path for datatypes…. java.lang.String instead of String and java.util.Collection instead of just Collection. The tutorial which i was reading did not have to put the full path. It would be great to know if this is a MyEclipse bug…. or XDoclet bug…. or JBoss bug… :/ thanks. below is the corrected version.
* @ejb.finder signature=”java.util.Collection findAll()”
* query=”SELECT OBJECT(b) FROM Borrower b”
*
* @ejb.finder signature=”java.util.Collection findBySurname(java.lang.String surname)”
* query=”SELECT OBJECT(b) FROM Borrower b WHERE b.surname = ?1″
*
* @ejb.finder signature=”java.util.Collection findByFullname(java.lang.String fullname)”
* query=”SELECT OBJECT(b) FROM Borrower b WHERE b.fullname = ?1″
*
*/
waiwahMember1 more thing, it still does not explain why it works for findAll() earlier but not for the others…. ermm… I guess this happens when u have parameters in ur finder methods. *_*
Riyad KallaMemberAhh great followup, thank you for posting it. It is most likely you needed to fully qualify the class because java.lang package is automatically imported, so things like String would be fine, but classes in the util package would need to be imported (or fully qualified) which you ended up needing to do.
-
AuthorPosts