[oscg-general] Authentication problem with Tomcat Manager Application & a possible solution

Actions

From Önder Örnek Mar 26, 2011 12:43 PM

Hi,

I loaded the Tomcat 7.0.8 + PostgreSQL 9.0.3 (16-Feb-11)  for Mac32. 

Because of the authentication problems it was impossible to access the manager application. The catalina log showed the following error with JAASRealm authentication:

----------------------------------
Mar 26, 2011 3:31:20 PM org.apache.catalina.realm.JAASRealm authenticate
SEVERE: Unexpected error
javax.security.auth.login.LoginException: No LoginModules configured for Catalina
	at javax.security.auth.login.LoginContext.init(LoginContext.java:273)
	at javax.security.auth.login.LoginContext.<init>(LoginContext.java:418)
	at org.apache.catalina.realm.JAASRealm.authenticate(JAASRealm.java:394)
	at org.apache.catalina.realm.JAASRealm.authenticate(JAASRealm.java:334)
	at org.apache.catalina.authenticator.BasicAuthenticator.authenticate(BasicAuthenticator.java:157)
	at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:554)
	at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:164)
	at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:100)
	at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)
	at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:383)
	at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:243)
	at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:188)
	at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:166)
	at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:288)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
	at java.lang.Thread.run(Thread.java:636)
----------------------------------

After some search in the web and documentation I figured out the failure. The follwing line in the conf/server.xml was missing:

<Realm className="org.apache.catalina.realm.UserDatabaseRealm" resourceName="UserDatabase"/>

Please refer to Tomcat 7 documentation if you will use other authentication methods.

It was a little bit challenging. I hope that OpenSCG change the settings and re-assemble the package.

Kind regards,
Önder