Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

JAAS sample program in weblogic 6.0 sp2 giving java.lang.SecurityException: Unable to locate a login Exception

0 views
Skip to first unread message

nivas

unread,
Dec 3, 2001, 5:39:38 AM12/3/01
to

i am tried to run the sample program in weblogic with the following commands after
editing server.policy file in weblogic\lib folder.
D:\bea>c:\jdk1.3\jre\bin\java examples.security.jaas.SampleClient
t3://localhost :7001
giving following out put---------
java.lang.SecurityException: Unable to locate a login configuration
at com.sun.security.auth.login.ConfigFile.getAppConfigurationEntry(Confi
gFile.java:221)
at javax.security.auth.login.LoginContext.init(LoginContext.java:172)
at javax.security.auth.login.LoginContext.<init>(LoginContext.java:319)
at examples.security.jaas.SampleClient.main(examples/security/jaas/Sampl
eClient.java:73)

1)what is the reason for this error and is it needed to edit
server.policy file..?
pls reply me ASAP

Allan

unread,
Dec 4, 2001, 10:59:17 PM12/4/01
to
You probably have Sun's JAAS implementation in the classpath (the hint was
the com.sun.security.auth... in the stack trace). Weblogic's implementation
of JAAS is incompatible with Sun's. Remove Sun's from the classpath,
Weblogic's is in weblogic.jar.

Also, the Weblogic implementation does not support JAAS authorization, only
authentication. So a JAAS policy file is useless.

"nivas" <ni...@india.com> wrote in message
news:3c0b566a$1...@newsgroups.bea.com...

nivas

unread,
Dec 9, 2001, 1:33:24 AM12/9/01
to

on runnig the program during the call of method
Authenticate.authenticate(env, subject);
giving following exceptions
Error: Login Exception on authenticate, java.lang.SecurityException: attempting
to add an object which is not an instance of java.security.Principal to a Subjec
t's Principal Set
Authentication Failed: Unexpected Exception, javax.security.auth.login.LoginExce
ption: java.lang.SecurityException: attempting to add an object which is not an
instance of java.security.Principal to a Subject's Principal Set
javax.security.auth.login.LoginException: javax.security.auth.login.LoginExcepti
on: java.lang.SecurityException: attempting to add an object which is not an ins
tance of java.security.Principal to a Subject's Principal Set
at examples.security.jaas.SampleLoginModule.login(SampleLoginModule.java
:192)
at java.lang.reflect.Method.invoke(Native Method)
at javax.security.auth.login.LoginContext.invoke(LoginContext.java:595)
at javax.security.auth.login.LoginContext.access$000(LoginContext.java:1
25)
at javax.security.auth.login.LoginContext$3.run(LoginContext.java:531)
at java.security.AccessController.doPrivileged(Native Method)
at javax.security.auth.login.LoginContext.invokeModule(LoginContext.java
:528)
at javax.security.auth.login.LoginContext.login(LoginContext.java:449)
at examples.security.jaas.SampleClient.main(SampleClient.java:96)
1)what is the reason for this problem
2)in weblogic document they told to edit server.policy file
in webligic\lib folder
a)what the modification is needed in this file..?

nivas

unread,
Dec 9, 2001, 1:34:46 AM12/9/01
to
0 new messages