首页 > 解决方案 > javax.naming.ConfigurationException 不包含 IOR

问题描述

我在为 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 服务器

标签: javajakarta-eeserverejbcorba

解决方案


推荐阅读