javax.naming.ConfigurationException不包含IOR

时间:2019-07-07 09:58:21

标签: java java-ee server ejb corba

运行Ejb Bean的客户端代码时遇到问题

Properties prop = new Properties();
prop.put(Context.INITIAL_CONTEXT_FACTORY,"com.sun.jndi.cosnaming.CNCtxFactory");
System.out.println("property"+prop.getProperty(Context.INITIAL_CONTEXT_FACTORY));
prop.put(Context.PROVIDER_URL,"http://localhost:9191");
InitialContext context = new InitialContext(prop);
System.out.println("ha context"+context);
System.out.println(context.getEnvironment());
Object o = context.lookup("Advisor");
System.out.println("object"+o);
AdviceHome adviceHome = (AdviceHome) PortableRemoteObject.narrow(o,AdviceHome.class);
System.out.println("ha adviceHome"+adviceHome);
Advice advice = adviceHome.create();
System.out.println("enfin notre chere advice"+advice.getAdvice());
  

错误:javax.naming.ConfigurationException:http://localhost:9191确实   不包含IOR

我正在使用j2sdkee1.3.1服务器

0 个答案:

没有答案