Context myContext=new InitialContext(); is absolutely wrong!
should be
Properties pro = new Properties();
pro.put(InitialContext.INITIAL_CONTEXT_FACTORY,
"weblogic.jndi.WLInitialContextFactory");
pro.put(InitialContext.PROVIDER_URL, "t3://youpathtopb:7001"); Context ctx = new InitialContext(pro);maybe this is not suitable for you!
should be
Properties pro = new Properties();
pro.put(InitialContext.INITIAL_CONTEXT_FACTORY,
"weblogic.jndi.WLInitialContextFactory");
pro.put(InitialContext.PROVIDER_URL, "t3://youpathtopb:7001"); Context ctx = new InitialContext(pro);maybe this is not suitable for you!
解决方案 »
- MyEclipse SVN 报错
- 哥,我还是个婴儿,有道题不会做了
- java scoket问题
- spring中注解AOP编程一个小问题.
- obj那2个配置文件在myeclipse中编辑怎么才能出编辑提示信息?
- 请问我的xmlHttp.readyState为何没有值??
- 在jsp页面中操作,交给javabean处理然后返回jsp 页面,为什么要用到servlet呢?本人对servlet就是不通,请高手多指教
- Web 服务器工作原理的问题
- 一般J2EE的开发,每个人的工作任务是怎么划分的?
- weblogic部署报错Exception in AppMerge flows' progression
- 请问各位大侠:J2EE和.net架构有什么不同或优势?
- weblogic使用问题?
String user = null;
String password = null;
Properties properties = null;
try {
properties = new Properties();
properties.put(Context.INITIAL_CONTEXT_FACTORY, "weblogic.jndi.WLInitialContextFactory");
properties.put(Context.PROVIDER_URL, url);
if (user != null) {
properties.put(Context.SECURITY_PRINCIPAL, user);
properties.put(Context.SECURITY_CREDENTIALS, password == null ? "" : password);
} Context myContext=new InitialContext(properties);
}
catch(Exception e) {
}