3 Replies Latest reply on Jul 2, 2003 11:43 AM by Ronald Brindl

    EJB home methods are not allowed to access CMP or CMR fields

    Ronald Brindl Newbie

      I suppose this is a cmp-related issue.
      For two days I keep getting this exception and i havent got a clue, what the problem could be.
      it doesnt matter if i am using jboss 3.0.7 or 3.2.1, so it doesnt seem to be a jboss-problem.
      I use xdoclet and have set up the following structure:
      i have 4 entity beans, whose local-interface implements a custom "SearchableIntf"-Interface. this declares one method: Object getValue().
      this method is implemented by my entity beans and simply calls the corresponding "getAccountEJBValue", "getProductEJBValue" - functions which are generated by xdoclet in the ...EJBCMP-Classes (and declared abstract in my bean).
      this enables me to build a generic paging-bean, which gets an object of the type "SearchableIntf" as parameter. this paging-bean calls the ejb-home-method "SearchPageable" (defined in the Interface "SearchableHome"), which returns a collection of the corresponding local-intefaces (for example: "Product"). then it loops over a sublist to get a certain page (f.e.: items 20-40) and calls "getValue()" on them. this way only the currently needed entities get activated.

      this whole thing works well for 3 of the 4 entity beans i am using for this, but it generates the attached stacktrace for the fourth.

      attached are the stacktrace and the questionable bean (ProductBean), as I suppose, the error is in that bean and not anywhere else, as it works with the other beans.

      PS: As i found out right now, i get that message in any case, when i call the "getProductEJBValue"-Method. I also tried to edit the generated class and set "getProductEJBValue" to empty, still getting the same exception. so i guess its somewhere inside productbean but outside getProductEJBValue. its real messy.

      please help me!!!