aspose file tools*
The moose likes JBoss/WildFly and the fly likes Jboss doesn't deploy CMP entity bean because the bean is defined as abstract???? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Products » JBoss/WildFly
Bookmark "Jboss doesn Watch "Jboss doesn New topic
Author

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

Vili Leonardo
Greenhorn

Joined: Mar 12, 2004
Posts: 18
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>
Don Griffing
Ranch Hand

Joined: Nov 21, 2003
Posts: 33
I noticed that you have:

It should be:

for your CMP entity beans.
Vili Leonardo
Greenhorn

Joined: Mar 12, 2004
Posts: 18
the <ejb-class> element should point to the fully qualified bean class. My bean is called EntityUserBean not EntityUserBeanCMP.
Vili Leonardo
Greenhorn

Joined: Mar 12, 2004
Posts: 18
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.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Jboss doesn't deploy CMP entity bean because the bean is defined as abstract????
 
Similar Threads
Problem Deploying in jboss3.2
try to solve cmp exception over weblogic8.1
CMP bean does not deploy -- need your advice
Error with data source and jndi connectivity
Exception:Attempt to get a lock for a null object ?