问大家一个WAS中的JNDI查找的问题的问题;

smilingdeng 2003-11-05 02:58:37
我在WAS中配置了一个数据源连接,服务器启动了。JNDI名为:STILL
自己用文本工具写了一个CLASS,中含MAIN方法,在此MAIN()方法中使用了以下语句进行查找:

//引入包省了。
public class Text {
public static void main(String arg[]) {
Connection con = null;
Statement stmt = null;
ResultSet rs = null;
String SQL = "select * from USER_INFO";
try {
Properties prop = new Properties();
prop.put(Context.INITIAL_CONTEXT_FACTORY,
"com.ibm.ejs.ns.jndi.CNInitialContextFactory");
prop.put(Context.PROVIDER_URL, "iiop://localhost:900");

InitialContext tcx = new InitialContext(prop);
System.out.print(""+tcx);
DataSource ds = (DataSource) tcx.lookup("STILL");
/*con = ds.getConnection();
stmt = con.createStatement();
System.out.print(SQL);
rs = stmt.executeQuery(SQL);*/
}

catch(Exception ed){
ed.printStackTrace();
}
}
}

编译期间没问题,但执行报错.
Failed to initialize the ORB. Root exception is .lang.reflect.InvocationTargetException
不知道是什么原因

...全文
83 6 打赏 收藏 转发到动态 举报
写回复
用AI写文章
6 条回复
切换为时间正序
请发表友善的回复…
发表回复
iceleighton 2003-11-13
  • 打赏
  • 举报
回复
楼上的,客户机也不在NameSpace里面运行啊!
JianTang1 2003-11-13
  • 打赏
  • 举报
回复
你的独立程序并不在WAS的NAMESPACE里面运行。当然不行了
ybcheng 2003-11-13
  • 打赏
  • 举报
回复
你那样是不行的!
klbt 2003-11-06
  • 打赏
  • 举报
回复
奇怪的问题,帮你顶。
iceleighton 2003-11-06
  • 打赏
  • 举报
回复
老大,你的应用是J2EE1.3标准还是J2EE1.2标准呀?
如果是1.3请把900端口更改为2809端口。
因为在1.3标准中已经把bootstrapport从900改为2809了。
iceleighton 2003-11-06
  • 打赏
  • 举报
回复
关注呀!

2,633

社区成员

发帖
与我相关
我的任务
社区描述
WebSphere 是 IBM 的软件平台。它包含了编写、运行和监视全天候的工业强度的随需应变 Web 应用程序和跨平台、跨产品解决方案所需要的整个中间件基础设施,如服务器、服务和工具。
社区管理员
  • WebSphere社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧