Hi !
I use weblogic 5.1. I've created jar file manually. But when I try to generate container classes using ejbc, I get the following error:
ERROR: Error from ejbc: [9.2.9] In EJB Test, the primary key class must implement the method public int hachCode()
ERROR: Error from ejbc: [9.2.9] In EJB Test, the primary key class must implement the method boolean equals <Object other>.
ERROR: ejbc found errors.
Then I included the two methods in my Primary class files ()returning 0 and false). But still I get the same errors.
Could any one help me out regarding this problem. It is very urgent.
Thanx
AJP
-
URGENT - ejbc problem ... (4 messages)
- Posted by: A JP
- Posted on: January 03 2001 21:07 EST
Threaded Messages (4)
- URGENT - ejbc problem ... by Web Master on January 03 2001 23:30 EST
- URGENT - ejbc problem ... by samir kapila on January 04 2001 02:06 EST
- URGENT - ejbc problem ... by A JP on January 04 2001 12:58 EST
- URGENT - ejbc problem ... by Vel Saran on January 05 2001 08:02 EST
-
URGENT - ejbc problem ...[ Go to top ]
- Posted by: Web Master
- Posted on: January 03 2001 23:30 EST
- in response to A JP
I think it would be a good idea if u can show ur Primary key class.
-
URGENT - ejbc problem ...[ Go to top ]
- Posted by: samir kapila
- Posted on: January 04 2001 02:06 EST
- in response to Web Master
hi
see the primary key class must implement hashcode and equals object method
so u must ev these methods dclared in ur class
than compile this class first remove previous class file
now run ur bean -
URGENT - ejbc problem ...[ Go to top ]
- Posted by: A JP
- Posted on: January 04 2001 12:58 EST
- in response to Web Master
package hitachi.buyplan;
Hi !
This is my Primary key class. Still I get the problem.
import java.io.Serializable;
public class TestPK implements Serializable
{
public TestPK(){}
public int hashCode()
{
return 0;
}
public boolean equals(Object obj)
{
return false;
}
}
Thanx.
AJP -
URGENT - ejbc problem ...[ Go to top ]
- Posted by: Vel Saran
- Posted on: January 05 2001 20:02 EST
- in response to A JP
Hi,
Change u'r PK file as follows:
public class TestPK implements java.io.Serializable
{
public int id;
public TestPK(){}
public int hashCode()
{
return id;
}
public boolean equals(Object obj)
{
if(obj instanceof TestPK)
{
return (id == ((TestPK)obj).id);
}
return false;
}
public String toString()
{
return String.valueOf(id);
}
}
Hope it should work now.
Regards
Saran