客户端运行不了,急!!!

h_q_l h_q_l 墨衍会员 · AI 创作全网分发 墨衍智能分发 通过墨衍一键同步至各平台 可同步平台 CSDN微信公众号微博知乎掘金百家号博客园抖音小红书 你的文章也可以这样分发 墨衍会员 ¥399起/年,写一次发全网 我也要 + 加入社区
我用SUN公司的J2EE服务器部署了一个session bean,JNDI中名称为ConverterBean

我的客户端的写法如下:

Context initial = new InitialContext();
Object objref= initial.lookup("java:comp/env/ejb/ConverterBean");

ConverterHome home =
(ConverterHome) PortableRemoteObject.narrow(objref,
ConverterHome.class);

Converter currencyConverter = home.create();


使用java运行的时候总提示我

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

要如何修改可以运行?
...全文
评论 2
收藏 已收藏
分享
返回顶部
h_q_l
Java EE 67,535 成员 225,843 内容