facebook

Error in deployment descriptor, finder method [Closed]

  1. MyEclipse IDE
  2.  > 
  3. Java EE Development (EJB, JSP, Struts, XDoclet, etc.)
Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #222909 Reply

    waiwah
    Member

    * @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.

    #222928 Reply

    Riyad Kalla
    Member

    I am checking with our EJB guru.

    #223037 Reply

    waiwah
    Member

    problem 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″
    *
    */

    #223038 Reply

    waiwah
    Member

    1 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. *_*

    #223042 Reply

    Riyad Kalla
    Member

    Ahh 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.

Viewing 5 posts - 1 through 5 (of 5 total)
Reply To: Error in deployment descriptor, finder method [Closed]

You must be logged in to post in the forum log in