Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / JavaBeans / April 2004

Tip: Looking for answers? Try searching our database.

Security Exception (No Such File or  Directory!!!)

Thread view: 
Petros Petrou - 24 Apr 2004 16:25 GMT
Hi

I am trying to test my ejbs via JUnit and my Application server is JBoss.
My ejbs are secured using JAAS and I am using Eclipse to develop
the project.

This is the code I am using to login.

MyCallbackHandler callback = new MyCallbackHandler(user,pass.toCharArray());
LoginContext loginContext = new LoginContext("MySecurity",callback);
loginContext.login();

The problem is that when I define the

-Djava.security.auth.login.config=auth.conf in VM parameters in Eclipse
and I run the test I come up with the following exception :

warning(junit.framework.TestSuite$1)junit.framework.AssertionFailedError:
Exception in constructor: testEjbCreateRemove
(java.lang.SecurityException: auth.conf (No such file or directory)
at com.sun.security.auth.login.ConfigFile.<init>(ConfigFile.java:97)

The auth.conf file is in the src directory of the project and the JUnit
class is in a package called tests. I have tried to move the auth.conf
file in the tests directory but I get the same error.

I cant understand why the file cannot be located as all the src and the
subdirectories should be in the classpath.

Petros
Petros Petrou - 26 Apr 2004 02:27 GMT
OK I sorted it out.

Something funny with the classpath. it was looking one directory above src.

> Hi
>
[quoted text clipped - 27 lines]
>
> Petros


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.