7 Replies Latest reply on Aug 10, 2005 11:24 AM by Amir Hakim

    Configuration file for Loging modules NOT found

    jaikiran pai Master

      Hi,
      I am doing a jaas login through my code. I have placed my class files in a jar file name myClient.jar. In the code i have set the config file as follows:

      System.setProperty("java.security.auth.login.config","myConfig.conf");

      I have placed this myConfig.conf file inside the myClient.jar and placed the myClient.jar in my classpath.

      I get the following error during login:

      Exception in thread "main" java.lang.SecurityException: myConfig.conf(No such fil
       at com.sun.security.auth.login.ConfigFile.<init>(ConfigFile.java:97)
       at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Meth
       at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstr
       at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Delegati
       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:2
       at java.security.AccessController.doPrivileged(Native Method)
       at javax.security.auth.login.Configuration.getConfiguration(Configura
       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:40
       at com.teradata.crm.processingengine.client.ProcessingEngineClient.lo
       at com.teradata.crm.processingengine.client.ProcessingEngineClient.ma
      Caused by: java.io.IOException: myConfig.conf(No such file or directory)
       at com.sun.security.auth.login.ConfigFile.init(ConfigFile.java:157)
       at com.sun.security.auth.login.ConfigFile.<init>(ConfigFile.java:95)
       ... 15 more


      I have put the

      However, if i specify the exact path of the file as follows, then it works:
      System.setProperty("java.security.auth.login.config","d:/MyTestDir/myClient.jar/myConfig.conf");

      I DO NOT want to specify the absolute path in my code. Is there any solution for this(apart from passing the file as an argument through command line during executing the program)?

      Thank you