classpath-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[cp-patches] FYI: Load LoginModules through context class loader


From: Mark Wielaard
Subject: [cp-patches] FYI: Load LoginModules through context class loader
Date: Wed, 19 Oct 2005 18:07:11 +0200

Hi,

This was one of the patches needed to get JBoss starting up. We were not
finding any LoginModules since we were trying to find them through the
bootstrap class loader.

2005-10-19  Mark Wielaard  <address@hidden>

        * javax/security/auth/login/LoginContext.java (lookupModule):
        Load LoginModule through Thread context class loader.

We should do an audit of all places where Class.forName() is called to
see whether they really need to have a ClassLoader argument.

Committed,

Mark

diff -u -r1.3 LoginContext.java
--- javax/security/auth/login/LoginContext.java 2 Jul 2005 20:32:46 -0000      
1.3
+++ javax/security/auth/login/LoginContext.java 19 Oct 2005 16:06:30 -0000
@@ -220,7 +220,9 @@
     Exception cause = null;
     try
       {
-        module = (LoginModule) Class.forName 
(entry.getLoginModuleName()).newInstance();
+       ClassLoader cl = Thread.currentThread().getContextClassLoader();
+       Class c = Class.forName(entry.getLoginModuleName(), true, cl);
+       module = (LoginModule) c.newInstance();
       }
     catch (ClassNotFoundException cnfe)
       {

Attachment: signature.asc
Description: This is a digitally signed message part


reply via email to

[Prev in Thread] Current Thread [Next in Thread]