[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[patch #1833] [Patch #1833] make NamingManager handle nested names for J
From: |
noreply |
Subject: |
[patch #1833] [Patch #1833] make NamingManager handle nested names for JBoss |
Date: |
Fri, 24 Oct 2003 11:21:37 -0400 |
User-agent: |
Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.3) Gecko/20030312 |
Patch #1833 has been updated.
Project:
Category: None
Status: Open
Summary: make NamingManager handle nested names for JBoss
Follow-Ups:
Date: Sun 09/07/2003 at 21:22
By: mark
Comment:
Other jndi code uses the Thread context ClassLoader.
And documentation like the following tutorial also indicates that should be
used in 1.2 like environments.
So I suggest to change the patch as follows:
diff -u -r1.3 NamingManager.java
--- javax/naming/spi/NamingManager.java 13 Jul 2003 23:34:19 -0000 1.3
+++ javax/naming/spi/NamingManager.java 7 Sep 2003 21:19:56 -0000
@@ -231,7 +231,10 @@
if (fClass != null)
{
// Exceptions here are passed to the caller.
- Class k = Class.forName (fClass);
+ ClassLoader c = Thread.currentThread().getContextClassLoader();
+ Class k = (c == null)
+ ? Class.forName(fClass)
+ : Class.forName(fClass, true, c);
factory = (ObjectFactory) k.newInstance ();
}
else
@@ -318,14 +321,19 @@
// It is really unclear to me if this is right.
try
{
- Object obj = getObjectInstance (null, cpe.getAltName (),
- cpe.getAltNameCtx (), env);
+ Object obj = getObjectInstance (cpe.getResolvedObj(),
+ cpe.getAltName (),
+ cpe.getAltNameCtx (),
+ env);
if (obj != null)
return (Context) obj;
}
catch (Exception _)
{
}
+
+ // fix stack trace for re-thrown exception (message confusing otherwise)
+ cpe.fillInStackTrace();
throw cpe;
}
Does that work in your situation?
-------------------------------------------------------
Date: Sun 09/07/2003 at 21:24
By: mark
Comment:
I meant this tutorial:
http://java.sun.com/products/jndi/tutorial/beyond/misc/classloader.html
-------------------------------------------------------
Date: Fri 10/24/2003 at 15:21
By: robilad
Comment:
Hunk 3 was bad, and is no longer necessary since the fix from me and Helmer
Kraemer has been checked in:
2003-09-13 Dalibor Topic <address@hidden>,
Helmer Kraemer <address@hidden>
* javax/naming/spi/NamingManager.java (getURLContext,
getObjectInstance, getStateToBind): Always use current thread's
context class loader when calling Class.forName.
Hunks 1 and 2 are only useful in conjuction with hunk 3, so they don't need to
be applied as well. The security field declared in hunk 2 is only used in hunk
3. Accordingly the imports from hunk 1 are only useful for hunk 2.
Cutting that cruft away, this leaves us with the remaining hunks in the patch.
They clean up getContinuationContext a little bit and fix a bug in exception
throwing. Looks reasonable to me.
A ChangeLog would have been nice ;)
-------------------------------------------------------
-------------------------------------------------------
For more info, visit:
http://savannah.gnu.org/patch/?func=detailpatch&patch_id=1833&group_id=85
_______________________________________________
Message sent via/by Savannah
http://savannah.gnu.org/
- [patch #1833] [Patch #1833] make NamingManager handle nested names for JBoss,
noreply <=