File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Tomcat and the fly likes Tomcat issue with custom JAASLogin module Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Products » Tomcat
Bookmark "Tomcat issue with custom JAASLogin module" Watch "Tomcat issue with custom JAASLogin module" New topic
Author

Tomcat issue with custom JAASLogin module

Suresh Bab
Greenhorn

Joined: Nov 30, 2006
Posts: 14
Hi ,

I had written a custom login module using JAAS and deployed the application in Tomcat server.

I am getting exception like , ( Sample is the name of the config file )

java.lang.SecurityException: Configuration Error:
Can not specify multiple entries for Sample
at com.sun.security.auth.login.ConfigFile.<init>(ConfigFile.java:97)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
at java.lang.reflect.Constructor.newInstance(Constructor.java:274)
at java.lang.Class.newInstance0(Class.java:308)
at java.lang.Class.newInstance(Class.java:261)
at javax.security.auth.login.Configuration$3.run(Configuration.java:221)
at java.security.AccessController.doPrivileged(Native Method)
at javax.security.auth.login.Configuration.getConfiguration(Configuration.java:215)
at javax.security.auth.login.LoginContext$1.run(LoginContext.java:170)
at java.security.AccessController.doPrivileged(Native Method)
at javax.security.auth.login.LoginContext.init(LoginContext.java:167)
at javax.security.auth.login.LoginContext.<init>(LoginContext.java:404)
at org.apache.catalina.realm.JAASRealm.authenticate(JAASRealm.java:298)
at org.apache.catalina.authenticator.FormAuthenticator.authenticate(FormAuthenticator.java:229)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:446)
at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:102)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:137)
at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:118)
at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:102)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:929)
at org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:160)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:799)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:705)
at org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:577)
at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:683)
at java.lang.Thread.run(Thread.java:534)
Caused by: java.io.IOException: Configuration Error:
Can not specify multiple entries for Sample
at com.sun.security.auth.login.ConfigFile.parseLoginEntry(ConfigFile.java:405)
at com.sun.security.auth.login.ConfigFile.readConfig(ConfigFile.java:308)
at com.sun.security.auth.login.ConfigFile.init(ConfigFile.java:218)
at com.sun.security.auth.login.ConfigFile.init(ConfigFile.java:181)
at com.sun.security.auth.login.ConfigFile.<init>(ConfigFile.java:95)

Thanks,
Suresh
Paul Sturrock
Bartender

Joined: Apr 14, 2004
Posts: 10336

"Suresh B"

You ahve been asked before to change your display name. Please we aware we require both a valid first and last name. A single initial is not considered a valid last name. Please change this here.

Thanks.


JavaRanch FAQ HowToAskQuestionsOnJavaRanch
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61309
    
  66

This was your third and final warning. Adjust your display name prior to your next post or your account will be disabled.

bear
JavaRanch Sheriff


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Rahul Bhattacharjee
Ranch Hand

Joined: Nov 29, 2005
Posts: 2308
How are you specifying the login.config to your JAAS.


Rahul Bhattacharjee
LinkedIn - Blog
Suresh Bab
Greenhorn

Joined: Nov 30, 2006
Posts: 14
Hi Rahul,

This is my login.config file,

JAASLoginModule{
com.<<<****>>>.customLogin.SampleJAASLoginModule
required
debug=true;
}

i had solved the previous error but know i am getting another exception like,

javax.security.auth.login.LoginException: unable to find LoginModule class: com.<<*********>>.customLogin.SampleJAASLoginModule
at javax.security.auth.login.LoginContext.invoke(LoginContext.java:711)
at javax.security.auth.login.LoginContext.access$000(LoginContext.java:129)
Suresh Bab
Greenhorn

Joined: Nov 30, 2006
Posts: 14
Hi ,

I went thorugh the LoginContext class of rt.jar and found that it is not able to load the SampleJAASLoginModule class.

Can any one tell me how i can solve this class loader exception i.e class not found exception.

I had even set the classpath of that particular file but still the same problem persists.

Thanks,
Suresh
 
GeeCON Prague 2014
 
subject: Tomcat issue with custom JAASLogin module