Menu

java.lang.SecurityException: when logging in

2005-05-12
2013-04-03
  • Serguei Khramtchenko

    I've been trying to get your FDDPMA working properly on our test server.  Every
    time I attempt to authenticate a user, it fails to progress beyond the login
    screen.  No error messages are reported on screen, however the Tomcat stdout.log
    reports the following:

    java.lang.SecurityException: Unable to locate a login configuration
        at com.sun.security.auth.login.ConfigFile.<init>(Unknown Source)
        at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
        at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
        at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
        at java.lang.reflect.Constructor.newInstance(Unknown Source)
        at java.lang.Class.newInstance0(Unknown Source)
        at java.lang.Class.newInstance(Unknown Source)
        at javax.security.auth.login.Configuration$3.run(Unknown Source)
        at java.security.AccessController.doPrivileged(Native Method)
        at javax.security.auth.login.Configuration.getConfiguration(Unknown Source)
        at javax.security.auth.login.LoginContext$1.run(Unknown Source)
        at java.security.AccessController.doPrivileged(Native Method)
        at javax.security.auth.login.LoginContext.init(Unknown Source)
        at javax.security.auth.login.LoginContext.<init>(Unknown Source)
        at org.apache.catalina.realm.JAASRealm.authenticate(JAASRealm.java:355)
        at
    org.apache.catalina.authenticator.FormAuthenticator.authenticate(FormAuthenticator.java:256)
        at
    org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:391)
        at
    org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
        at
    org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
        at
    org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
        at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
        at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:856)
        at
    org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:744)
        at
    org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
        at
    org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:80)
        at
    org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)
        at java.lang.Thread.run(Unknown Source)
    Caused by: java.io.IOException: Unable to locate a login configuration
        at com.sun.security.auth.login.ConfigFile.init(Unknown Source)
        ... 27 more

     
    • Serguei Khramtchenko

      It looks like JAAS authentication is not properly configured. Please varify these settings:

      1) jaas.properties file is in Tomcat's "conf" directory
      2) fddpma_jaas.jar file in Tomcat's "common/lib" directory
      3) This option is given to JVM when Tomcat starts:
      "-Djava.security.auth.login.config=%CATALINA_HOME%\conf\jaas.properties"
      If you are under Windows, the easy way to set this option is to copy "setenv.bat" file that comes with FDDPMA distribution to Tomcat's "bin" directory.

      Also make sure that you start your Tomcat using startup.bat. If your tomcat starts as Windows Service, it will not pickup the settings from "setenv.bat".

      There must be a way to configure the service as well, but I do not know it yet.

       
    • Dysard

      Dysard - 2006-10-26

      Hi, I have a fix for running Tomcat as a service.
      In the registry, navigate to:
      HKEY_LOCAL_MACHINE > SOFTWARE > Apache Software Foundation > Procrun 2.0 > Tomcat5 > Parameters > Java

      Select Options and put the following value in there:
      -Djava.security.auth.login.config=C:\Program Files\Apache Software Foundation\Tomcat 5.5\conf\jaas.properties

      Set the path according to your own install path off course.

       
      • Serguei Khramtchenko

        Hi,

        Thank you for the tip. I have these settings in my Tomcat ranning as service. The last one is the same as you posted.

        -Dcatalina.home=E:\Tomcat557
        -Djava.endorsed.dirs=E:\Tomcat557\common\endorsed
        -Djava.io.tmpdir=E:\Tomcat557\temp
        -Djava.security.auth.login.config=E:\Tomcat557\conf\jaas.properties

        Regards,
        Serguei

         
    • Dysard

      Dysard - 2006-10-26

      I have installed Tomcat 5.5.20 and these are the entries I have in that registry value:

      -Dcatalina.home=C:\Program Files\Apache Software Foundation\Tomcat 5.5
      -Dcatalina.base=C:\Program Files\Apache Software Foundation\Tomcat 5.5
      -Djava.endorsed.dirs=C:\Program Files\Apache Software Foundation\Tomcat 5.5\common\endorsed
      -Djava.io.tmpdir=C:\Program Files\Apache Software Foundation\Tomcat 5.5\temp
      -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager
      -Djava.util.logging.config.file=C:\Program Files\Apache Software Foundation\Tomcat 5.5\conf\logging.properties
      -Djava.security.auth.login.config=C:\Program Files\Apache Software Foundation\Tomcat 5.5\conf\jaas.properties

      I doubt that will help you, but it's worth a try.
      Did you compile the source yourself or did you grab the binaries? I compiled the source...

       

Log in to post a comment.