[jboss-jira] [JBoss JIRA] Updated: (JBNAME-42) Log debug info when NamingContext.getObjectInstance() fails to create the instance

Andrew Lee Rubinger (JIRA) jira-events at lists.jboss.org
Mon Dec 7 15:55:30 EST 2009


     [ https://jira.jboss.org/jira/browse/JBNAME-42?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Andrew Lee Rubinger updated JBNAME-42:
--------------------------------------

    Attachment: JBNAME-42.patch


Attached patch and tests for review

> Log debug info when NamingContext.getObjectInstance() fails to create the instance
> ----------------------------------------------------------------------------------
>
>                 Key: JBNAME-42
>                 URL: https://jira.jboss.org/jira/browse/JBNAME-42
>             Project: JBoss Naming
>          Issue Type: Feature Request
>          Components: jnpserver
>            Reporter: Brian Stansberry
>            Assignee: Andrew Lee Rubinger
>         Attachments: JBNAME-42.patch
>
>
> 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;
>    }

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: https://jira.jboss.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        



More information about the jboss-jira mailing list