[jboss-jira] [JBoss JIRA] Commented: (JBNAME-42) Log debug info when NamingContext.getObjectInstance() fails to create the instance
Brian Stansberry (JIRA)
jira-events at lists.jboss.org
Mon Dec 7 13:58:30 EST 2009
[ https://jira.jboss.org/jira/browse/JBNAME-42?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12498669#action_12498669 ]
Brian Stansberry commented on JBNAME-42:
----------------------------------------
An alternative to the above is to throw a NamingException instead of just logging. The JNDI "spec" (http://java.sun.com/j2se/1.5/pdf/jndispi.pdf) section 2.4 "encourages" us to return the correct type from Context operations. Note however that 2.4.1 includes a code example that matches our current behavior.
> 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
>
> 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