Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Tomcat issue with custom JAASLogin module

 
Suresh Bab
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 10336
Eclipse IDE Hibernate Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
"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.
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 65227
95
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Rahul Bhattacharjee
Ranch Hand
Posts: 2308
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
How are you specifying the login.config to your JAAS.
 
Suresh Bab
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 14
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic