你应该将你的EJB CLASS文件也要放入你的CLASSPATH中的!(可能)呵呵!
解决方案 »
- java支持在电脑端的蓝牙开发吗? 看清楚:不是j2me。
- 100分求struts2 map传值问题!!这个很杯具啊。。。
- Editplus关联JDK 来学习JAVA编程,怎么设置编程的风格
- Spring 注入问题
- JSONObject的Java源码中居然使用了goto,哪位高人可以解释一下这个问题吗?
- JAVA菜鸟救助.
- struts2:一个action类里有两个方法,我访问其中的一个方法配置的action,为什么会将两个方法都执行?
- 寻求在JBuilder中配置Hibernate方法,在其他工具中的配置方法也可以
- EJB 可不可以继承?!
- 微信公众平台,成为开发者,URL如何填写
- 当我的一个j2ee项目完成之后,如何测试它的负载能力,有什么工具没?
- j2ee启动问题
Properties p = new Properties();
p.put(Context.INITIAL_CONTEXT_FACTORY,
"weblogic.jndi.WLInitialContextFactory");
p.put(Context.PROVIDER_URL, "t3://localhost:7001");
p.put(Context.SECURITY_PRINCIPAL,"system");
p.put(Context.SECURITY_CREDENTIALS,"password");
有可能是你Context.SECURITY_PRINCIPAL,及Context.SECURITY_CREDENTIALS
不对
String url = "t3://localhost:7001";
String user = "system";
String password = "12345678";
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) {
//System.out.println("Unable to connect to WebLogic server at " + url);
//System.out.println("Please make sure that the server is running.");
throw e;
}
}
帮我看看怎么会事呀。
把用户名密码加上啊!!!
properties.put(Context.SECURITY_PRINCIPAL, user);
properties.put(Context.SECURITY_CREDENTIALS, "password");
String user = "system";
String password = "12345678";我已经加了用户和密码。
.;C:\JBuilder6\jdk1.3.1\jre\lib\rt.jar;C:\JBuilder6\jdk1.3.1\jre\lib\i18n.jar;C:\JBuilder6\jdk1.3.1\lib\dt.jar;C:\JBuilder6\jdk1.3.1\lib\tools.jar;C:\bea\wlserver6.1\lib\wlepool.jar;C:\bea\wlserver6.1\lib\j2ee12.jar;C:\bea\wlserver6.1\lib\weblogic.jar;C:\bea\wlserver6.1\lib\ejb20.jar;D:\JClass
java ........... -Djava.security.manager -Djava.security.policy= sample.policy 你的类名
sample.policy 的内容为
grant{
permission java.security.AllPermission;
};