[jboss-jira] [JBoss JIRA] Commented: (JBNAME-42) Log debug info when NamingContext.getObjectInstance() fails to create the instance
Ron Sigal (JIRA)
jira-events at lists.jboss.org
Fri Feb 26 17:50:10 EST 2010
[ https://jira.jboss.org/jira/browse/JBNAME-42?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12517088#action_12517088 ]
Ron Sigal commented on JBNAME-42:
---------------------------------
No,
if(obtained == null && obj instanceof Reference)
{
final Reference ref = (Reference) obj;
throw MissingObjectFactoryException.create(ref.getFactoryClassName(), name);
}
doesn't make sense. obtained == null && obj instanceof Reference would be true if the factory were found and it returned null. If no factory is found, then the original Reference is returned, so the test should be
if(obj instanceof Reference && obj == obtained)
{
final Reference ref = (Reference) obj;
throw MissingObjectFactoryException.create(ref.getFactoryClassName(), name);
}
> 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
> Fix For: 5.1.0.Beta1
>
> 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