一个小问题,大家帮帮忙
小愚初学Ejb,请大家帮我看看下面这段代码客户端调用Home对象
public static void main(String[] args) {
try{
Properties props=System.getProperties();
Context ctx=new InitialContext(props);
## MyHome Home=(MyHome)ctx.lookup("MyHome"); ##
MyRemote hello=Home.create();
hello.remove();
}
catch(Exception e){
e.printStackTrace();
}
}
有一个名叫"MyHome"的Home对象,和"MyRemote"的Remote对象,和一个叫"hello"的商务方法
上面这段代码为客户端代码
在运行到"##"的时候总是出现下面的错误
javax.naming.NoInitialContextException: Need to specify class name in environment or system property, or as an applet parameter, or in an application resource file: java.naming.factory.initial
刚才有人讲了一下,还不是太懂,谁能讲的清楚一些吗,来者有分,先谢了!