private Context getInitialContext() throws Exception {
String url = "t3://localhost:7001";
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);
}
return new InitialContext(properties);
}
catch(Exception e) { throw e;
}
}
----------------------------------------------
你可把上面这段用
private Context getInitialContext() throws Exception {
try{
return new InitialContext();
}catch(Exception e)
}
替换试试!
如果java类与jsp是执行在同一进程容器,应不用加参数的!我想可能也与weblogic的java_home配置有关吧!不当之处,请指教!
String url = "t3://localhost:7001";
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);
}
return new InitialContext(properties);
}
catch(Exception e) { throw e;
}
}
----------------------------------------------
你可把上面这段用
private Context getInitialContext() throws Exception {
try{
return new InitialContext();
}catch(Exception e)
}
替换试试!
如果java类与jsp是执行在同一进程容器,应不用加参数的!我想可能也与weblogic的java_home配置有关吧!不当之处,请指教!
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货