props.putContext.INITIAL_CONTEXT_FACTORY,"org.jnp.interfaces.
NamingContextFactory"); 这句有错误吧?最少括号,只有一边,既然能编译过去,强!
不如这么写:Context ctx =new InitialContext();
Object h = ctx.lookup("HelloWorld");
HelloHome home=(HelloHome)javax.rmi.PortableRemoteObject.narrow(h,HelloHome.class);Hello hello=home.create();
System.out.println(hello.hello());
hello.remove();
NamingContextFactory"); 这句有错误吧?最少括号,只有一边,既然能编译过去,强!
不如这么写:Context ctx =new InitialContext();
Object h = ctx.lookup("HelloWorld");
HelloHome home=(HelloHome)javax.rmi.PortableRemoteObject.narrow(h,HelloHome.class);Hello hello=home.create();
System.out.println(hello.hello());
hello.remove();
解决方案 »
- 求struts2购物车中求总价的思路
- jquery $(this).val()不明白在下例子中指哪个元素??
- iBatis对BLOB数据读写,但update不成功
- 如何通过相应的数据生成一个收据,请给出源码!谢谢!
- 请问高手,我要在java和.net平台间传送xml文件,确定要用webservice方式,该怎么写
- 框架学习小站java99开站,散分庆贺!!
- 使用javascript获取当前系统时间
- eclipse+struts碰到的问题
- 具有什么特征的项目需要分布式架构!!?(请高人指点指点!谢)
- jdbc连sql2000出现的错误
- 如何穿过代理服务器
- 关于JAVA中实现的MD5.怎么跟PHP中实现的结果不一样??
NamingContextFactory");
这句有错误同时,必须注意:Object obj=ctx.lookup("HelloHome");一句中的HelloHome必须是EJB中部署描述中的jndi-name 而不是你的home接口名
Jarky(武阳松清) 的Context ctx =new InitialContext();是程序中最常用的Context语句,比用
props.put(Context.INITIAL_CONTEXT_FACTORY,"org.jnp.interfaces.
NamingContextFactory");
props.put(Context.PROVIDER_URL,"localhost:1099");
好