• 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
  • Tim Cooke
  • paul wheaton
  • Jeanne Boyarsky
  • Ron McLeod
Sheriffs:
  • Paul Clapham
  • Liutauras Vilda
  • Devaka Cooray
Saloon Keepers:
  • Tim Holloway
  • Roland Mueller
Bartenders:

Entity bean throwing exception

 
Ranch Hand
Posts: 49
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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,
 
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
is your ejb-jar.xml correct?
<primkey-field>pK</primkey-field>
 
Why does your bag say "bombs"? The reason I ask is that my bag says "tiny ads" and it has stuff like this:
New web page for Paul's Rocket Mass Heaters movies
https://coderanch.com/t/785239/web-page-Paul-Rocket-Mass
reply
    Bookmark Topic Watch Topic
  • New Topic