Frage

Ich bin mit Tomcat 6.0.29 und ein Reich und Loginmodule meiner eigenen erstellt. Sie sind in server.xml definiert wie folgt:

<Realm className="mycompany.tomcat.MyRepositoryRealm" appName="My_Realm" userClassNames="mycompany.tomcat.IdentityPrincipal" roleClassNames="mycompany.tomcat.RolePrincipal" useContextClassLoader="true"/>

Ich habe die Bibliothek, die diese Klassen zu meinem tomcat / lib Ordner hinzugefügt. Abgesehen davon, habe ich nicht geändert Tomcat von seiner Standardkonfiguration.

Wenn ich die Tomcat-Manager-Anwendung auf http://localhost:9080/manager/html zu feuern, kann ich nicht einloggen und das tomcat Protokoll zeigt einen Fehler und Stacktrace für mein Login-Modul.

Irgendwelche Ideen? Dank!

Edit:

Per Anfrage, hier ist der Stacktrace. Mein Reich einer Verbindung zu einem JBoss-Dienst, so dass der Grund, warum ich den NamingContextFactory Fehler.

javax.security.auth.login.LoginException: Cannot instantiate class: org.jnp.interfaces.NamingContextFactory at mycompany.tomcat.MyRepositoryLoginModule.login(MyRepositoryLoginModule.java:88) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at javax.security.auth.login.LoginContext.invoke(LoginContext.java:769) at javax.security.auth.login.LoginContext.access$000(LoginContext.java:186) at javax.security.auth.login.LoginContext$4.run(LoginContext.java:683) at java.security.AccessController.doPrivileged(Native Method) at javax.security.auth.login.LoginContext.invokePriv(LoginContext.java:680) at javax.security.auth.login.LoginContext.login(LoginContext.java:579) at org.apache.catalina.realm.JAASRealm.authenticate(JAASRealm.java:410) at org.apache.catalina.realm.JAASRealm.authenticate(JAASRealm.java:335) at mycompany.tomcat.MyRepositoryRealm.authenticate(MyRepositoryRealm.java:34) at org.apache.catalina.authenticator.BasicAuthenticator.authenticate(BasicAuthenticator.java:181) at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:528) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:298) at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:857) at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:588) at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489) at java.lang.Thread.run(Thread.java:619)

War es hilfreich?

Lösung

Ich war in der Lage, das Problem zu verstehen.

Sicherheits Realms können für einen Motor, Host oder Kontext definiert werden. Ich hatte das Reich für die ganze Host (in server.xml) definiert, so dass die Kater-Manager-Anwendung versucht, es zu benutzen. Ich reparierte das Problem durch das Reich in einer META-INF / context.xml Datei in meiner Web-Anwendung zu definieren.

Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top