[jboss-user] [JNDI and Naming] New message: "Re: Remote vs. Local client lookup of same JNDI object"

Ben Cotton do-not-reply at jboss.com
Tue Feb 9 15:15:43 EST 2010

User development,

A new message was posted in the thread "Remote vs. Local client lookup of same JNDI object":


Author  : Ben Cotton
Profile : http://community.jboss.org/people/ben.cotton@rutgers.edu

Thanks Brian.
Single step debugging from my client code statement ...
> javax.naming.Reference factory = (javax.naming.Reference) ctx.lookup("IVTCF"); 
.... our thread stack enters into org.jnp.interfaces.NamingContext.java (line 726) and executes
                     res = naming.lookup(n);

That assignment is INDEED non-NULL  ... *the 'res' identifier is correctly assigned a reference to an IBM WSMQ javax.jms.ConnectionFactory implementation class*.  (see attached screen shot for details of assignment).
The lookup() looks great at this stage.
The logical flow proceeds from line 726 in NamingContext.java andexecutes the follwoing code (lines 819-827).
>          else if (res instanceof Reference)  *//true
> *         {
>             // Dereference object
>            + res = getObjectInstanceWrapFailure(res, name, refEnv);+  *// assigned NULL here*
>             if (res instanceof LinkRef)
>                res = resolveLink(res, refEnv);   *// returned NULL value here ... which is assigned to 'factory' in client code.
> *         }
>          return res;
So my lookup() at one time had a desired reference to my IBM WSMQ implementation of javax.jms.ConnectionFactory ... but lost it because that reference is an instanceof  Reference.
Any ideas on how I can overcome this?



To reply to this message visit the message page: http://community.jboss.org/message/525222#525222

More information about the jboss-user mailing list