Uploaded image for project: 'Application Server 3  4  5 and 6'
  1. Application Server 3 4 5 and 6
  2. JBAS-2265

Unexpected content in default InitialContext seen by NamingService

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Major Major
    • JBossAS-5.0.0.Beta1
    • JBossAS-4.0.2 Final
    • Naming
    • 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)

      { log.debug("key="+key+", value="+value); }

      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);

              Unassigned Unassigned
              starksm64 Scott Stark (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

                Created:
                Updated:
                Resolved: