简体   繁体   English

为什么tomcat7在JAAS中找不到LoginModule类

[英]Why is tomcat7 unable to find LoginModule class in JAAS

I have an application packaged in a WAR which is running great on an existing Tomcat6 server. 我有一个打包在WAR中的应用程序,该应用程序在现有的Tomcat6服务器上运行良好。

I am now trying to deploy it in tomcat7 but am getting the following error as soon as I run the login action: Failed login. 我现在正在尝试将其部署在tomcat7中,但是在运行登录操作后立即收到以下错误:登录失败。 Reason: LoginException: unable to find LoginModule class: security.jass.SimpleLoginModule 原因:LoginException:找不到LoginModule类:security.jass.SimpleLoginModule

I have the contents below in the conf file, which is defined in Java's security.properties: 我在conf文件中有以下内容,该文件在Java的security.properties中定义:

UserLoginImpo
{
security.jass.SimpleLoginModule required;
};

Changing the class name here (to a wrong one) will make tomcat say it can't find that one, which eliminates the cause "the conf file isn't being picked up". 在此更改类名(错误的类名)将使tomcat说找不到该类名,从而消除了“未拾取conf文件”的原因。

The class should be in the classpath: it's inside a jar in the lib folder of the WAR. 该类应位于类路径中:它位于WAR的lib文件夹中的一个jar中。

What could I be missing? 我可能会缺少什么?

As @Jim pointed out, the package name was not correct: security.jaas, not security.jass. 正如@Jim指出的那样,程序包名称不正确:security.jaas,而不是security.jass。

Goes to prove you really need to pay attention to details. 证明您确实需要注意细节。

Can ssomrone tell me the difference between those two class paths? ssomrone可以告诉我这两个类路径之间的区别吗? I can't see it. 我看不到 EDIT WOW that obvious, but that slippery as well - Two 's' chars vs two 's' chars. 编辑哇,这很明显,但也很滑-两个's字符与两个's字符。

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

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