No abstract accessors - error msg
sseaman Sep 10, 2002 10:12 AMI am trying to deploy my first entity bean and keep getting a:
No abstract accessors for field name 'userId' found in entity class com.schedulestar.revolution.ejb.UserBean
I've checked my code time and time again but I must be missing something. Could someone help me out?
Here is my Remote Interface:
package com.schedulestar.revolution.ejb;
import java.rmi.RemoteException;
public interface User
extends javax.ejb.EJBObject
{
public abstract String getFirstName()
throws RemoteException;
public abstract String getLastName()
throws RemoteException;
public abstract Integer getUserId()
throws RemoteException;
public abstract void setFirstName(String aStr)
throws RemoteException;
public abstract void setLastName(String aStr)
throws RemoteException;
public abstract void setUserId(Integer aInt)
throws RemoteException;
}
My Home interface:
package com.schedulestar.revolution.ejb;
import java.rmi.RemoteException;
import javax.ejb.CreateException;
import javax.ejb.FinderException;
import java.util.Collection;
public interface UserHome
extends javax.ejb.EJBHome
{
public User create(Integer aId)
throws CreateException, RemoteException;
public Collection findAll()
throws FinderException, RemoteException;
public User findByPrimaryKey(UserPK aPk)
throws FinderException, RemoteException;
public User findByEmail(String aStr)
throws FinderException, RemoteException;
}
My Bean:
package com.schedulestar.revolution.ejb;
import javax.ejb.EntityContext;
import javax.ejb.CreateException;
public abstract class UserBean
implements javax.ejb.EntityBean
{
transient private EntityContext ctx;
public Integer userId;
public String fName;
public String lName;
public void ejbActivate() {}
public Integer ejbCreate(Integer aId)
throws CreateException
{
this.userId = aId;
return userId;
}
public void ejbLoad() {}
public void ejbPassivate() {}
public void ejbPostCreate(Integer aId) {
}
public void ejbRemove() {}
public void ejbStore() {}
public String getFirstName() {
return fName;
}
public String getLastName() {
return lName;
}
public Integer getUserId() {
return userId;
}
public void setEntityContext(EntityContext aCtx) {
this.ctx = aCtx;
}
public void setFirstName(String aStr) {
fName = aStr;
}
public void setLastName(String aStr) {
lName = aStr;
}
public void setUserId(Integer aInt) {
userId = aInt;
}
public void unsetEntityContext() {
ctx = null;
}
}
My PK:
package com.schedulestar.revolution.ejb;
public class UserPK
implements java.io.Serializable
{
public Integer userId;
}
My ejb-jar.xml:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE ejb-jar PUBLIC
"-//Sun Microsystems, Inc.//DTD Enterprise JavaBeans 2.0//EN"
"http://java.sun.com/dtd/ejb-jar_2_0.dtd">
<ejb-jar>
<display-name>User Jar</display-name>
<enterprise-beans>
<display-name>User Entity Bean</display-name>
User Entity Bean
<ejb-name>UserEJB</ejb-name>
com.schedulestar.revolution.ejb.UserHome
com.schedulestar.revolution.ejb.User
<ejb-class>com.schedulestar.revolution.ejb.UserBean</ejb-class>
<persistence-type>Container</persistence-type>
<prim-key-class>java.lang.Integer</prim-key-class>
False
<cmp-field><field-name>userId</field-name></cmp-field>
<cmp-field><field-name>firstName</field-name></cmp-field>
<cmp-field><field-name>lastName</field-name></cmp-field>
<primkey-field>userId</primkey-field>
</enterprise-beans>
</ejb-jar>
And my jboss.xml:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE jboss PUBLIC
"-//JBoss//DTD JBOSS 3.0//EN"
"http://www.jboss.org/j2ee/dtd/jboss_3_0.dtd">
<enterprise-beans>
<ejb-name>UserEJB</ejb-name>
<jndi-name>revolution/User</jndi-name>
</enterprise-beans>
Any help would be greatly appreciated.
Thanks!