当前位置: 技术问答>java相关
同情一下我吧,大侠们。JB7+WEB6配置好了,可发布时总不对
来源: 互联网 发布时间:2015-10-01
本文导语: 我写个个简单会话BEAN ,RUN CLIENT时包错 我的CLIENT是 public static void main(String[] args) throws Exception { Properties props = System.getProperties(); Context ctx = new InitialContext(props); Object obj = ctx.lookup("hHome"); ...
我写个个简单会话BEAN ,RUN CLIENT时包错 我的CLIENT是
public static void main(String[] args) throws Exception {
Properties props = System.getProperties();
Context ctx = new InitialContext(props);
Object obj = ctx.lookup("hHome");
hHome home = (hHome)
javax.rmi.PortableRemoteObject.narrow(
obj, hHome.class);
h h = home.create();
System.out.println(h.h());
h.remove();
}
}报错如下
:beajdk131binjavaw -classpath "C:bea111testclasses;D:beawlserver6.1libweblogic_sp.jar;D:beawlserver6.1libweblogic.jar;D:beajdk131jrelibi18n.jar;D:beajdk131jrelibjaws.jar;D:beajdk131jrelibrt.jar;D:beajdk131jrelibsunrsasign.jar;D:beajdk131libdt.jar;D:beajdk131libhtmlconverter.jar;D:beajdk131libtools.jar" test.hClient
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
at javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:643)
at javax.naming.InitialContext.getDefaultInitCtx(InitialContext.java:246)
at javax.naming.InitialContext.getURLOrDefaultInitCtx(InitialContext.java:283)
at javax.naming.InitialContext.lookup(InitialContext.java:350)
at test.hClient.main(hClient.java:37)
Exception in thread "main"
是因为我那里的设置还是不对吗?请给个理由
public static void main(String[] args) throws Exception {
Properties props = System.getProperties();
Context ctx = new InitialContext(props);
Object obj = ctx.lookup("hHome");
hHome home = (hHome)
javax.rmi.PortableRemoteObject.narrow(
obj, hHome.class);
h h = home.create();
System.out.println(h.h());
h.remove();
}
}报错如下
:beajdk131binjavaw -classpath "C:bea111testclasses;D:beawlserver6.1libweblogic_sp.jar;D:beawlserver6.1libweblogic.jar;D:beajdk131jrelibi18n.jar;D:beajdk131jrelibjaws.jar;D:beajdk131jrelibrt.jar;D:beajdk131jrelibsunrsasign.jar;D:beajdk131libdt.jar;D:beajdk131libhtmlconverter.jar;D:beajdk131libtools.jar" test.hClient
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
at javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:643)
at javax.naming.InitialContext.getDefaultInitCtx(InitialContext.java:246)
at javax.naming.InitialContext.getURLOrDefaultInitCtx(InitialContext.java:283)
at javax.naming.InitialContext.lookup(InitialContext.java:350)
at test.hClient.main(hClient.java:37)
Exception in thread "main"
是因为我那里的设置还是不对吗?请给个理由
|
context没有初始化好,你用的应用服务器是什么的?
您可能感兴趣的文章:
本站(WWW.)旨在分享和传播互联网科技相关的资讯和技术,将尽最大努力为读者提供更好的信息聚合和浏览方式。
本站(WWW.)站内文章除注明原创外,均为转载、整理或搜集自网络。欢迎任何形式的转载,转载请注明出处。
本站(WWW.)站内文章除注明原创外,均为转载、整理或搜集自网络。欢迎任何形式的转载,转载请注明出处。