带有空格的路径中的java.security.auth.login.config文件

str*_*cer 5 java jaas

当我执行

System.setProperty("java.security.auth.login.config", ejbLoginConfig);
Run Code Online (Sandbox Code Playgroud)

使用ejbLoginConfig = "../conf/weblogicdomain.conf"并且我的客户端位于包含空格的路径中,我为我的EJB调用获取ClassNotFoundException:

Caused by: java.lang.ClassNotFoundException: my.app.MyFassade
    at weblogic.ejb.container.deployer.RemoteBizIntfClassLoader.getClassBytes(RemoteBizIntfClassLoader.java:151)
...
Run Code Online (Sandbox Code Playgroud)

如果我将所有内容移动到没有空格的路径,它将起作用。使用绝对路径不会更改任何内容。

感谢您的想法!

小智 2

该值需要包含在引号中(使用转义引号):

System.setProperty("java.security.auth.login.config", "\"" + ejbLoginConfig + "\"");
Run Code Online (Sandbox Code Playgroud)