• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Error while validate Descriptors

 
Ranch Hand
Posts: 72
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
i am getting the following error. what is the cause for this error?


Checking J2EE compliance of beans

ERROR: Error while checking J2EE compliance of beans

ERROR: Error from ejbc: In EJB ProductBean, the local home interface findByPrimaryKey method must return the local interface type of the entity bean.

ERROR: Error from ejbc: In EJB ProductBean, the return type for the local home finder method findByPrimaryKey(java.lang.Integer) must be (for a single-object finder) the local interface type of the entity bean, or (for
a mult-object finder) java.util.Enumeration or java.util.Collection. NOTE: EJB2.0 CMP finders may not return a java.util.Enumeration Class.

ERROR: Error from ejbc: In EJB ProductBean, the return type for the local home create method create(java.lang.Integer) must be the local interface type of the bean.

ERROR: Error from ejbc: In EJB ProductBean, the return type for the local home create method createProductDetails(java.lang.Integer,java.lang.String,double) must be the local interface type of the bean.
 
Ranch Hand
Posts: 66
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi, Please see the suggestions below...

ERROR: Error from ejbc: In EJB ProductBean, the local home interface findByPrimaryKey method must return the local interface type of the entity bean.
Ans1:-> Check the return type of your findByPrimaryKey() method in your Local Home interface. It should always return local component interface.



ERROR: Error from ejbc: In EJB ProductBean, the return type for the local home finder method findByPrimaryKey(java.lang.Integer) must be (for a single-object finder) the local interface type of the entity bean, or (for
a mult-object finder) java.util.Enumeration or java.util.Collection. NOTE: EJB2.0 CMP finders may not return a java.util.Enumeration Class.

Ans:-> It seems that you are returning a Collection/Enumeration from your findByPrimaryKey(), which defies all logic. Your primary key should uniquely identify a row in your table, and this means, you should only return a LocalComponent Interface.


ERROR: Error from ejbc: In EJB ProductBean, the return type for the local home create method create(java.lang.Integer) must be the local interface type of the bean.
Ans: Again, return type for LocalHome create() method must be Local Component interface.

ERROR: Error from ejbc: In EJB ProductBean, the return type for the local home create method createProductDetails(java.lang.Integer,java.lang.String,double) must be the local interface type of the bean.
Ans: for any LocalHome create() method, return type must be local component interface. Your creatProductDetails(Integer,String,double) seems to be returning something else.

Hope that helps..
 
reply
    Bookmark Topic Watch Topic
  • New Topic