bmp中ejb查找数据库的问题
我的代码是
Context ctx=new InitialContext();
Object objref=ctx.lookup("Account");
AccountHome home=(AccountHome)javax.rmi.PortableRemoteObject.narrow(objref,AccountHome.class);
AccountPK pk=new AccountPK("689");
account=home.findByPrimaryKey(pk);
System.out.println("find id "+account.getName());
是否可以这样写
但是在执行ejbLoad()时出现例外
系统提示:
Context ctx=new InitialContext();
Object objref=ctx.lookup("Account");
AccountHome home=(AccountHome)javax.rmi.PortableRemoteObject.narrow(objref,AccountHome.class);
AccountPK pk=new AccountPK("689");
account=home.findByPrimaryKey(pk);
System.out.println("find id "+account.getName());
请问如何解决?
3ks