java - 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 服务器
解决方案
推荐阅读
- python - 熊猫 value_counts() + 重量
- python - python执行后如何运行sqlite命令
- java - 我正在尝试从 springboot 控制器下载一个 zip 文件,但我得到了奇怪的响应。请协助
- python - 从记事本++和OpenCV函数执行python代码时出错
- sql - 从特定月份开始的 3 年日期范围
- sql - SQL:获取有序表中组的最小值和最大值
- c# - 如何使用只读用户访问 azure 应用服务的 log4net 日志文件夹
- python - keras 自定义 sigmoid 添加偏差
- python - python中的bigquery API出现问题“AttributeError:'NoneType'对象没有属性'path'”
- python - 制作 3d 和 2d 方程