我正在使用Tomcat 6.0.44。我得到例外:
javax.security.auth.login.LoginException: java.lang.IllegalArgumentException:未知的处理程序密钥 javax.security.jacc.PolicyContext.getContext(PolicyContext.java:311)
在下面的代码行:
HttpServletRequest request = (HttpServletRequest) PolicyContext.getContext("javax.servlet.http.HttpServletRequest");
我提到依赖的POM文件是:
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>javax.servlet-api</artifactId>
<version>3.0.1</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>javax.security.jacc</groupId>
<artifactId>javax.security.jacc-api</artifactId>
<version>1.4</version>
</dependency>