0
public void runTest() throws Exception {
InitialContext ctx = new InitialContext();
ResourceManager bean = (ResourceManager) ctx.lookup("ejb/ResourceManagerJNDI");
System.out.println(bean.DummyText());
}
你好。所以我試圖創建一個EJB應用程序,這是它的測試客戶端。 JNDI查找是成功的,但調用「DummyText」方法時,我得到以下錯誤:需要EJB幫助
javax.ejb.EJBException: nested exception is: java.rmi.ServerException: RemoteException occurred in server thread; nested exception is:
java.rmi.RemoteException: nested exception is: javax.ejb.EJBException: nested exception is: javax.ejb.CreateException: Could not create stateless EJB; nested exception is:
javax.ejb.EJBException: nested exception is: javax.ejb.CreateException: Could not create stateless EJB (...)
這是bean類的樣子:
@Stateless(name="ResourceManager", mappedName="ejb/ResourceManagerJNDI")
@Remote
@Local
public class ResourceManagerBean implements ResourceManager
{
@EJB
private AccessDAO accessDAO;
@EJB
private ResourceDAO resourceDAO;
@EJB
private DepartmentDAO departmentDAO;
(list of methods)
}
任何意見,將不勝感激。謝謝。