部署cmp出现错误,请教.. User这个Bean不可以是abstract class 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 例子中的cmp都是abstract的,这里为什么不可以呢 应该是某些CMP字段没有定义SET和GET方法。 public abstract class UserBean implements EntityBean { private EntityContext ctx; Logger logger_ = Logger.getLogger(getClass().getName()); //access methods for cmp fields public abstract void setUserName(String userName); public abstract String getUserName(); public abstract void setPassword(String password); public abstract String getPassword(); public abstract void setPrivilege(String privilege); public abstract String getPrivilege(); //ejb required methods, called by container // public UserBean() {} public void ejbActivate() { this.logger_.info("ejbActivate() called."); } public void ejbPassivate() { this.logger_.info("ejbPassivate() called."); } public void ejbRemove() { this.logger_.info("ejbRemove() called."); } public void ejbLoad() { this.logger_.info("ejbLoad() called."); } public void ejbStore() { this.logger_.info("ejbStore() called."); } public void setEntityContext(EntityContext ctx) { this.logger_.info("setEntityContext() called."); this.ctx = ctx; } public void unSetEntityContext() { this.logger_.info("unSetEntityContext() called."); this.ctx = null; } public void ejbPostCreate(String userName, String password, String privilege) throws CreateException{ this.logger_.info("ejbPostCreate() called."); } public String ejbCreate(String userName, String password, String privilege) throws CreateException { this.setUserName(userName); this.setPassword(password); this.setPrivilege(privilege); return userName; }} >>例子中的cmp都是abstract的,这里为什么不可以呢EJB规范这么规定的,至少2.1是这样,就是不能用abstract。 系统有的人能打开有的人打不开 什么原因呢 这样的XML文件该怎么写? 一个java程序员应该培养怎样的习惯有利于提高自己的专业素养 hibernate中Session 问题 spring事务问题 请问在hibernate中集合映射与不采用集合的映射关系的区别?? js迭代radio 后台action如何接受radio的值 在j2ee中是否有类似OpenDiaglog的类,如何使用 用JBuilder 6开发EJB需要用什么版本的JDK? 有关ejb调用的问题,大虾帮忙啊!!!! 请大侠指点以下页面跳转问题.急!!!分值不够可以再加! hibernate的问题啊!
private EntityContext ctx;
Logger logger_ = Logger.getLogger(getClass().getName()); //access methods for cmp fields
public abstract void setUserName(String userName);
public abstract String getUserName();
public abstract void setPassword(String password);
public abstract String getPassword();
public abstract void setPrivilege(String privilege);
public abstract String getPrivilege();
//ejb required methods, called by container
// public UserBean() {}
public void ejbActivate() {
this.logger_.info("ejbActivate() called.");
}
public void ejbPassivate() {
this.logger_.info("ejbPassivate() called.");
}
public void ejbRemove() {
this.logger_.info("ejbRemove() called.");
}
public void ejbLoad() {
this.logger_.info("ejbLoad() called.");
}
public void ejbStore() {
this.logger_.info("ejbStore() called.");
}
public void setEntityContext(EntityContext ctx) {
this.logger_.info("setEntityContext() called.");
this.ctx = ctx;
}
public void unSetEntityContext() {
this.logger_.info("unSetEntityContext() called.");
this.ctx = null;
}
public void ejbPostCreate(String userName, String password,
String privilege)
throws CreateException{
this.logger_.info("ejbPostCreate() called.");
}
public String ejbCreate(String userName, String password,
String privilege)
throws CreateException {
this.setUserName(userName);
this.setPassword(password);
this.setPrivilege(privilege);
return userName;
}
}
EJB规范这么规定的,至少2.1是这样,就是不能用abstract。