简体   繁体   English

Tomcat上的JAAS登录配置错误。 无法删除JAAS配置文件

[英]JAAS login configuration error on Tomcat. Unable to loas JAAS config file

I am trying to implement a simple JAAS module with realm configuration on Tomcat 7. I am trying to implement this based on the following link: 我正在尝试在Tomcat 7上使用领域配置来实现一个简单的JAAS模块。我正在尝试基于以下链接来实现它:

http://www.byteslounge.com/tutorials/jaas-authentication-in-tomcat-example http://www.byteslounge.com/tutorials/jaas-authentication-in-tomcat-example

I have placed jass.config in CATALINA_HOME/conf folder and have added the following code to CATALINA_HOME/bin/catalina.bat file 我已将jass.config放在CATALINA_HOME / conf文件夹中,并将以下代码添加到CATALINA_HOME / bin / catalina.bat文件中

JAVA_OPTS=$JAVA_OPTS "-Djava.security.auth.login.config==$CATALINA_HOME/conf/jaas.config"     

However, once I start Tomcat and attempt to access the protected admin.html page, I get the basic login dialog of the browser (as expected). 但是,一旦启动Tomcat并尝试访问受保护的admin.html页面,就会得到浏览器的基本登录对话框(如预期的那样)。 But while trying to log in, Tomcat reports the following error: 但是在尝试登录时,Tomcat报告以下错误:

SEVERE: Unexpected error
java.lang.SecurityException: Unable to locate a login configuration

Please help how to make Tomcat find the JAAS config file. 请帮助如何使Tomcat查找JAAS配置文件。

The fact that you're using .bat file suggests you're using Windows where variables get referred to using %VARIABLE% notation instead of $VARIABLE . 使用.bat文件的事实表明您使用的Windows是使用%VARIABLE%表示法而不是$VARIABLE来引用$VARIABLE Try changing the expression to: 尝试将表达式更改为:

set JAVA_OPTS=%JAVA_OPTS% -Djava.security.auth.login.config=%CATALINA_HOME%/conf/jaas.config

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM