這幾周在弄ejb,如果註冊AppModel裏的類中jndi名稱和路徑不對的話,就會報下面的錯誤:
javax.naming.NamingException: Could not load ejb proxy class com.appweb.services.ejb.messagebox.IEmailReceiveDAO [Root exception is java.lang.ClassNotFoundException: com.appweb.services.ejb.messagebox.IEmailReceiveDAO from [Module "deployment.appDD.ear.appweb.war:main" from Service Module Loader]]
發現是因爲IEmailReceiveDAO的類路徑不對而找不到類,改爲 super("EmailReceiveDAOImpl!com.app.services.ejb.messagebox.IEmailReceiveDAO");後正常;
public class EmailReceiveServiceImpl extends BaseServiceImpl implements IEmailReceiveService{
public EmailReceiveServiceImpl(){
super("EmailReceiveDAOImpl!com.appweb.services.ejb.messagebox.IEmailReceiveDAO");
}
}