Hi,
I wrote abstract class for entity bean and deploying it in
jboss 3.2.1but it's throwing exception and warning during deployment such as
-3.2.1_tomcat-4.1.24/server/default/deploy/customer.jar
22:04:29,897 WARN [verifier] EJB spec violation:
Bean : CustomerBeanCMP
Section: 9.2.2
Warning: The entity bean class must not be defined as abstract.
22:04:29,907 WARN [verifier] EJB spec violation:
Bean : CustomerBeanCMP
Section: 9.4.7.1
Warning: The primkey-field element must name a public field in the bean implemen
tation class.
22:04:29,907 ERROR [MainDeployer] could not create deployment: file:/C:/jboss-3.
2.1_tomcat-4.1.24/server/default/deploy/customer.jar
org.jboss.deployment.DeploymentException: Verification of Enterprise Beans faile
d, see above for error messages.
at org.jboss.ejb.EJBDeployer.create(EJBDeployer.java:487)
..........so on
Here is the code of my entity bean class
package customer;
import javax.ejb.*;
public abstract class CustomerBeanCMP implements EntityBean{
private EntityContext context;
public String ejbCreate(String last,String first,String addr){
this.setLast(last);
this.setFirst(last);
this.setPK(makePK());
this.setAddress(addr);
return null;
}
public void ejbPostCreate(String last,String first,String addr){
}
public abstract String getLast();
public abstract void setLast(String last);
public abstract String getFirst();
public abstract void setFirst(String first);
public abstract String getCustAddress();
public abstract void setCustAddress(String addr);
public abstract String getPK();
public abstract void setPK(String pk);
public String getLastName(){
return this.getLast();
}
public void setLastName(String name){
this.setLast(name);
}
public String getFirstName(){
return this.getFirst();
}
public void setFirstName(String name){
this.setFirst(name);
}
public String getAddress(){
return this.getCustAddress();
}
public void setAddress(String addr){
this.setCustAddress(addr);
}
public void setEntityContext(EntityContext etx){
context=etx;
}
public void unsetEntityContext(){}
public void ejbLoad(){}
public void ejbStore(){}
public void ejbActivate(){}
public void ejbPassivate(){}
public void ejbRemove(){}
private String makePK(){
int rand=(int)(Math.random() * 42);
return ""+rand;
}
}
I will appreciate your input in this.
Regards,
Nauman Khan <br />SCJP,MCSE,SCWCD,SCBCD,SCWCD1.4