Uploaded image for project: 'JBoss Naming'
  1. JBoss Naming
  2. JBNAME-42

Log debug info when NamingContext.getObjectInstance() fails to create the instance

XMLWordPrintable

    • Icon: Feature Request Feature Request
    • Resolution: Done
    • Icon: Major Major
    • 5.1.0.Beta1
    • None
    • jnpserver
    • None

      The JDK javax.naming.spi.NamingManager.getObjectInstance() method doesn't provide any debugging output when it's unable to create an object from a Reference; it just silently returns the Reference. Perhaps org.jnp.interfaces.NamingContext.getObjectInstance() can help here

      private Object getObjectInstance(Object obj, Name name, Hashtable env)
      throws Exception
      {
      if (useAbsoluteName(env))
      name = getAbsoluteName(name);
      Object result = NamingManager.getObjectInstance(obj, name, this, env);
      if (result == obj log.isDebugEnabled())
      {
      try
      {
      Reference ref == null;
      if (obj instanceof Reference)

      { ref = (Reference) obj; }

      else if (obj instanceof Referenceable)

      { ref = ((Referenceable) obj).getReference(); }

      if (ref != null)

      { log.debug("Could not resolve reference " + ref + " with factory class " + ref.getFactoryClassName(); }

      }
      catch (RumtimeException ignored)

      { ; }

      catch (NamingException ne)
      {
      if (ne.getCause() instanceof InterruptedException)

      { Thread.currentThread().interrupted(); }

      }

      }
      return result;
      }

            arubinge@redhat.com Andrew Rubinger (Inactive)
            bstansbe@redhat.com Brian Stansberry
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: