This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes BEA/Weblogic and the fly likes Problems with JAAS setup in WL 8.1 SP3 Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Products » BEA/Weblogic
Bookmark "Problems with JAAS setup in WL 8.1 SP3 " Watch "Problems with JAAS setup in WL 8.1 SP3 " New topic
Author

Problems with JAAS setup in WL 8.1 SP3

meka toka
Ranch Hand

Joined: Dec 11, 2002
Posts: 75
Hi all,

I have WL 8.1 SP3 installed on a XP Prof box with JDK 1.4.2

I have an application that makes use of the JAAS. I keep getting the following error

javax.security.auth.login.LoginException: No LoginModules configured for <XXXXXX>
at javax.security.auth.login.LoginContext.init(LoginContext.java:189)
at javax.security.auth.login.LoginContext.<init>(LoginContext.java:350)
at javax.security.auth.login.LoginContext.<init>(LoginContext.java:465)



I know that this means that it couldnt find the login modules defined in the configuration file. But I have it defined there. The following is what I am doing

1. I have the startWebLogic.cmd as below.

%JAVA_HOME%\bin\java %JAVA_VM% %MEM_ARGS% %JAVA_OPTIONS% -Dweblogic.Name=%SERVER_NAME% -Dweblogic.ProductionModeEnabled=%PRODUCTION_MODE% -Djava.security.policy=%JAVA_HOME%\jre\lib\security\java.policy weblogic.Server


2. In the Java policy file located in security folder of the JDK home, I changed the security file to point to config file as below

login.config.url.1=file:${java.home}/lib/security/jaas.conf

Can someone suggest me a solution ?

Thanks
meka toka
[ September 01, 2004: Message edited by: meka toka ]

Thanks<br />MekaToka<br />SCJP 1.4
Rovas Kram
Ranch Hand

Joined: Aug 08, 2003
Posts: 135
Try:

-Djava.security.auth.login.config=jaas.config

I don't know that what you're doing is supposed to do the samething or not but the above works for us.
meka toka
Ranch Hand

Joined: Dec 11, 2002
Posts: 75
Actually, I tried a variety of ways

(1) The java system property defined programatically, because originally the configuration file is with in a jar file

(2) Defined the location of the configuration file at command line by editing the startWebLogic.cmd and adding the -D flag.

And I confirmed that both the above ways my server log showed that the system property java.security.auth.login.config is being set.

Following is a portion of dump in the server log

java.ext.dirs = C:\JAVA\sdk\J2SDK1~1.2_0\jre\lib\ext
java.home = C:\JAVA\sdk\J2SDK1~1.2_0\jre
java.io.tmpdir = C:\DOCUME~1\rsriper\LOCALS~1\Temp\
java.library.path = C:\JAVA\sdk\J2SDK1~1.2_0\bin;.;C:\WINDOWS\System32;C:\WINDOWS;C:\bea\WEBLOG~1\server\bin;C:\JAVA\sdk\J2SDK1~1.2_0\jre\bin;C:\JAVA\sdk\J2SDK1~1.2_0\bin;C:\Program Files\Oracle\jre\1.1.7\bin;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\Program Files\Support Tools\;c:\perl\bin;C:\Program Files\UltraEdit;C:\JAVA\apache-ant-1.6.1\bin;C:\JAVA\sdk\jdk1.3.1_12\bin;C:\Oracle\ora81\bin;C:\Program Files\GNU\WinCvs 1.3\CVSNT;C:\JAVA\ovpd\lib;C:\JAVA\ide\eclipse\workspace\MaisAuth\web\WEB-INF\lib\jaas.jar;C:\JAVA\ide\eclipse\workspace\MaisAuth\web\WEB-INF\lib\jcert.jar;C:\JAVA\ide\eclipse\workspace\MaisAuth\web\WEB-INF\libjsse.jar;C:\JAVA\ide\eclipse\workspace\MaisAuth\web\WEB-INF\lib\krb5.jar;;C:\bea\WEBLOG~1\server\bin\oci920_8
java.naming.factory.initial = weblogic.jndi.WLInitialContextFactory
java.naming.factory.url.pkgs = weblogic.jndi.factories:weblogic.corba.j2ee.naming.url
java.protocol.handler.pkgs = weblogic.utils|weblogic.utils|weblogic.net
java.runtime.name = Java(TM) 2 Runtime Environment, Standard Edition
java.runtime.version = 1.4.2_05-b04
java.security.auth.login.config = C:\bea\user_projects\domains\Gateway\Envy\stage\_appsdir_Gateway_war\Gateway.war\WEB-INF\classes\jaas.conf
java.security.policy = C:\JAVA\sdk\J2SDK1~1.2_0\jre\lib\security\java.policy
java.specification.name = Java Platform API Specification
java.specification.vendor = Sun Microsystems Inc.
java.specification.version = 1.4
java.util.prefs.PreferencesFactory = java.util.prefs.WindowsPreferencesFactory
java.vendor = Sun Microsystems Inc.
java.vendor.url = http://java.sun.com/
java.vendor.url.bug = http://java.sun.com/cgi-bin/bugreport.cgi
java.version = 1.4.2_05


Even then I get the same error which says ... "No LoginModules Configured for <app -name>"

Any suggestions .....
[ September 02, 2004: Message edited by: meka toka ]
meka toka
Ranch Hand

Joined: Dec 11, 2002
Posts: 75
I was able to make it work. I had to remove the entry

login.config.url.1=file:${java.home}/lib/security/jaas.conf from the java.security file.

Looks like this was blocking the java.security.auth.login.config property some how
[ September 02, 2004: Message edited by: meka toka ]
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: Problems with JAAS setup in WL 8.1 SP3
 
Similar Threads
IoException when opening stream from Url in WL 8.1 SP3
MissingResourceException in JAAS
question for RDBMSAuthenticator setup on weblogic
JAAS migration from JBoss to BEA
LoginContext and Configuration problem