-
Bug
-
Resolution: Done
-
Major
-
JBossAS-4.0.2 Final
-
None
The current InitialContext environment traversal done the by NamingService has been reported to cause CCEs with a CompoundName showing up in the environment. The current code is doing unsafe and uneccessary type casts that should be cleaned up.
InitialContext iniCtx = new InitialContext();
Hashtable env = iniCtx.getEnvironment();
if (debug)
log.debug("InitialContext Environment:");
String providerURL = null;
for (Enumeration keys = env.keys(); keys.hasMoreElements(); )
{
String key = (String) keys.nextElement();
String value = (String) env.get(key);
if (debug)
if( key.equals(Context.PROVIDER_URL) )
providerURL = value;
}
// Warn if there was a Context.PROVIDER_URL
if( providerURL != null )
log.warn("Context.PROVIDER_URL in server jndi.properties, url="+providerURL);