当我执行
System.setProperty("java.security.auth.login.config", ejbLoginConfig);
使用 ejbLoginConfig = "../conf/weblogicdomain.conf"
并且我的客户端位于包含空格的路径中,我的 EJB 调用出现 ClassNotFoundException:
Caused by: java.lang.ClassNotFoundException: my.app.MyFassade
at weblogic.ejb.container.deployer.RemoteBizIntfClassLoader.getClassBytes(RemoteBizIntfClassLoader.java:151)
...
如果我将所有内容移动到没有空格的路径,它就可以工作。使用绝对路径不会改变任何东西。
谢谢你的想法!
最佳答案
值需要包含在引号中(使用转义引号):
System.setProperty("java.security.auth.login.config", "\"" + ejbLoginConfig + "\"");
关于带空格的路径中的 java.security.auth.login.config 文件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8167550/