[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 13:23:02 EST 2010


User development,

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

http://community.jboss.org/message/525194#525194

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

Message:
--------------------------------------------------------------
Thanks for this quick reply .... very interesting ... and, I think you might be correct. 
 
Consider the following Java client code (modified slightly from what was posted earlier above).  The 'factory' lookup() still returns NULL every time.  But, the 'q' lookup() returns the correct value of a remotely hosted JBoss  JNDI object reference named 'IVTQueue' (that also uses IBM's JCA adapter to bridge to a WSMQ implementation of javax.jms.Queue)
 
>   Properties props = new Properties();
>             props.setProperty(Context.INITIAL_CONTEXT_FACTORY,"org.jnp.interfaces.NamingContextFactory"); 
>             props.setProperty(Context.PROVIDER_URL,"jnp://10.4.164.105:11099");  //Linux dndcor3autw001.aur.lehman.com 
>             props.setProperty(Context.URL_PKG_PREFIXES, "org.jboss.naming:org.jnp.interfaces");
>         
>             
>             Context ctx = new InitialContext(props);
>             
>             
>             javax.naming.Reference factory = (javax.naming.Reference) ctx.lookup("IVTCF"); 
>             // 'factory' always returned value 'NULL' ... why?
>             System.out.println("looked up 'IVTCF' javax.jms.QueueConnectionFactory established! 'factory'=["+    factory    +"]");
>             
> 
>             
>             javax.jms.Queue q = (javax.jms.Queue) ctx.lookup("IVTQueue");
>             // 'q' returned CORRECT non-NULL value from same remote JBoss JNDI tree .... why?  must not be remoteness issue?
>             System.out.println("'IVTQueue' javax.jms.Queue found: [" + q +"]");
>             
> 
 
Output:
 
> looked up 'IVTCF' javax.jms.QueueConnectionFactory established! 'factory'=[null]
> 'IVTQueue' javax.jms.Queue found: [queue://CapMktsQM/SYSTEM.DEFAULT.LOCAL.QUEUE]
 
So this success, suggests that +remoteness+ has nothing to do with the failure of the ConnectionFactory lookup.
 
I am contacting the author of IBM's WSMQ JCA resource apapter for comment and confirmation re: IBM MQ ConnectionFactoryImpl
 
Thank you very much, Jaikiran!


--------------------------------------------------------------

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




More information about the jboss-user mailing list