一个紧急的问题(各位请进 进者有分)
以下两个方法是SESSION BEAN 下的( 远程接口)
public java.lang.Integer funFind(String name) {
this.name=name;
try{
InitialContext ctx=new InitialContext();
Object ref = ctx.lookup("Account");//错误在此
AccountHome home = (AccountHome)ref;
try{
Account account=home.findByPrimaryKey(name);
result=account.getBalance();
return result;
}
catch(Exception ex){
System.out.println("Find Error:"+ex.getMessage());
}
}
catch(Exception ex){
throw new EJBException("Unable To Connection To Database :"+ex.getMessage());
}
return null;
}
public String funMessage(){
return "TEST OK!";
}
测试程序去调用 funMessage() 方法成功。
但是去调用funFind("teddy") 方法失败。
Object ref = ctx.lookup("Account");//错误在此
AccountHome home = (AccountHome)ref;
Account是一个ENTITY BEAN ( 本地接口 )
环境:JBUILDER 9, INTERBASE, Borland Enterprise Server 5.2
请问如何解决?
MSN/EMAIL:CHENHAIJUN5858@163.COM