Primary key error in Bean manage Persistence (pls help)

Hi, i'm getting the error on the primary keys. I try to look into the error but to no avail. Can anyone please help me? The error which occurs makes me trace back to the customerBean.java, CustomerHome.java.I will attach these two files as well as the package jar files of the EJB, ejb-jar-customer.jar. Please give me some guidance. Thanks.

For additional information, the int customerID in CustomerBean, CustomerHome, CustomerModel which u can find in the attachment serve as the primary key of the enterprise bean as well as the unique key in the database.

I have attach my database backup as well but i'm using mySQL database.

The errors that occur once i place the ejb-jar-customer.jar into the server:

*13:40:50,906 WARN EJB spec violation:
Bean : CustomerBean
Method : public Integer ejbFindByPrimaryKey(Integer) throws FinderException
Section: 12.2.5
Warning: The result type for the ejbFindByPrimaryKey method must be the primary
key type.

13:40:50,906 WARN EJB spec violation:
Bean : CustomerBean
Method : public Integer ejbFindByPrimaryKey(Integer) throws FinderException
Section: 12.2.5
Warning: The ejbFindByPrimaryKey method must be a single-object finder.

13:40:50,906 WARN EJB spec violation:
Bean : CustomerBean
Method : public Integer ejbFindByPrimaryKey(Integer) throws FinderException
Section: 12.2.5
Warning: The return type of a finder method must be the entity bean's primary ke
y type, or a collection of primary keys (see Specification Section 12.1.7)

13:40:50,906 ERROR Could not create deployment: file:/C:/jboss-4.
0.3SP1/server/default/deploy/ejb-jar-customer.jar*

Message was edited by:
Shirley

Message was edited by:
Shirley

Message was edited by:
Shirley

2 comments
Comment actions Permalink

Hello Shirley,

Your ejb-jar.xml says that primary key class for the CustomerBean is:

<prim-key-class>java.lang.String</prim-key-class>

change the value to java.lang.Integer.

Regards,
Gregory Shrago

Shirley wrote:

Hi, i'm getting the error on the primary keys. I try to look into the error but to no avail. Can anyone please help me? The error which occurs makes me trace back to the customerBean.java, CustomerHome.java.I will attach these two files as well as the package jar files of the EJB. Please give me some guidance. Thanks.

The errors that occur once i place the ejb-jar-customer.jar into the server:

*13:40:50,906 WARN EJB spec violation:
Bean : CustomerBean
Method : public Integer ejbFindByPrimaryKey(Integer) throws FinderException
Section: 12.2.5
Warning: The result type for the ejbFindByPrimaryKey method must be the primary
key type.

13:40:50,906 WARN EJB spec violation:
Bean : CustomerBean
Method : public Integer ejbFindByPrimaryKey(Integer) throws FinderException
Section: 12.2.5
Warning: The ejbFindByPrimaryKey method must be a single-object finder.

13:40:50,906 WARN EJB spec violation:
Bean : CustomerBean
Method : public Integer ejbFindByPrimaryKey(Integer) throws FinderException
Section: 12.2.5
Warning: The return type of a finder method must be the entity bean's primary ke
y type, or a collection of primary keys (see Specification Section 12.1.7)

13:40:50,906 ERROR Could not create deployment: file:/C:/jboss-4.
0.3SP1/server/default/deploy/ejb-jar-customer.jar*

0
Comment actions Permalink

Thanks your ans have solve my error.

Thanks alot

Regards Shirley

0

Please sign in to leave a comment.