• Post Reply Bookmark Topic Watch Topic
  • New Topic

Error while validate Descriptors  RSS feed

 
Ramakrishnan Ponmudi
Ranch Hand
Posts: 72
  • Mark post as helpful
  • send pies
  • 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.
 
Aleena Rehman
Ranch Hand
Posts: 66
  • Mark post as helpful
  • send pies
  • 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..
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!