我不断收到同样的错误,我已经更改了指定 jaas 配置文件位置的 tomcat7w 文件
javax.security.auth.login.LoginException: No LoginModules configured for JaaSExample:
at javax.security.auth.login.LoginContext.init(LoginContext.java:273)
at javax.security.auth.login.LoginContext.<init>(LoginContext.java:514)
at org.apache.catalina.realm.JAASRealm.authenticate(JAASRealm.java:417)
at org.apache.catalina.realm.JAASRealm.authenticate(JAASRealm.java:356)
at org.apache.catalina.realm.CombinedRealm.authenticate(CombinedRealm.java:146)
at org.apache.catalina.realm.LockOutRealm.authenticate(LockOutRealm.java:180)
at org.apache.catalina.authenticator.BasicAuthenticator.authenticate(BasicAuthenticator.java:166)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:574)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:171)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:100)
at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:953)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:408)
at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1041)
at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:603)
at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:310)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:744)
我已经将这个 tom 添加到我的 tomcat7w.exe 文件中。
-Djava.security.auth.login.config=C:\Program Files (x86)\Apache Software Foundation\Tomcat 7.0\conf\jaas.config
还有就是我也有这个境界
<Realm className="org.apache.catalina.realm.JAASRealm"
appName="JaaSExample"
userClassNames="Security.UserPrincipal" roleClassNames="Security.RolePrincipal" />
所以我错过了什么?请帮我,
我正在使用netbeans,tomcat 7.0.47。
thank you very much,
我已决定使用 glassfish!