Win a copy of Testing JavaScript Applications this week in the HTML Pages with CSS and JavaScript forum!
  • 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Bear Bibeault
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Liutauras Vilda
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • fred rosenberger
  • salvin francis
Bartenders:
  • Piet Souris
  • Frits Walraven
  • Carey Brown

Jboss doesn't deploy CMP entity bean because the bean is defined as abstract????

 
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
When I deploy the following CMP entity bean, Jboss complains that it should not be declared as Abstract class. Can anyone show me what I did wrong? I thought the ejb spec says that the CMP entity bean must be defined as abstract??? Thanks
Here is the class definition:
public abstract class EntityUserBean implements EntityBean {

private EntityContext context;

public String getID(){
return this.getIdXX();
}

public abstract String getIdXX();
public abstract void setIdXX(String id);

public void setEntityContext(EntityContext ctx){
context = ctx;
}
public void unsetEntityContext(){ }
public void ejbLoad() {}
public void ejbStore() { }
public void ejbActivate(){}
public void ejbPassivate(){}
public void ejbRemove(){}

}
ejb-jar.xml:
<entity>
<ejb-name>User</ejb-name>
<local-home>com.ejb.EntityUserHome</local-home>
<local>com.ejb.EntityUser</local>
<ejb-class>com.ejb.EntityUserBean</ejb-class>
<abstract-schema-name>UserSchema</abstract-schema-name>
<persistence-type>Container</persistence-type>
<cmp-version>2.x</cmp-version>
<reentrant>False</reentrant>
<prim-key-class>java.lang.String</prim-key-class>
<cmp-field>
<field-name>idXX</field-name>
</cmp-field>
<primkey-field>idXX</primkey-field>
</entity>
standardjbosscmp-jdbc.xml:
<enterprise-beans>
<entity>
<ejb-name>User</ejb-name>
<table-name>Customerid</table-name>
<cmp-field>
<field-name>idXX</field-name>
<not-null/>
</cmp-field>
</entity>
</enterprise-beans>
 
Ranch Hand
Posts: 33
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I noticed that you have:

It should be:

for your CMP entity beans.
 
Vili Leonardo
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
the <ejb-class> element should point to the fully qualified bean class. My bean is called EntityUserBean not EntityUserBeanCMP.
 
Vili Leonardo
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have found out what causes the error. The ejb-jar.xml dtd is default to ejb spec 1.1. After I change the dtd to 2.0 everything is fine.
 
    Bookmark Topic Watch Topic
  • New Topic