[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 10:42:17 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/525121#525121
Author : Ben Cotton
Profile : http://community.jboss.org/people/ben.cotton@rutgers.edu
Message:
--------------------------------------------------------------
We are experiencing a problem when a remote desktop Java client attempts to lookup an object by name that is hosted in a JBoss AS 5.1 server's JNDI global namespace.
The JBoss admin console displays the following for the name 'IVTCF' in the JNDI global namespace (and it shows a correct and expected value).
Global JNDI Namespace
+- IVTCF (*class*: com.ibm.mq.connector.outbound.ConnectionFactoryImpl)
If we code the following +from a JBoss-deployed servlet+, everything works perfectly ... the JBoss hosted JNDI references correctly uses the IBM JCA resource adapter to bridge to WSMQ implementations of Queue and QueueConnectionFactory.
> InitialContext ic = new InitialContext();
>
> javax.jms.ConnectionFactory cf = (javax.jms.ConnectionFactory) ic.lookup("IVTCF");
> log.info("'IVTCF' javax.jms.ConnectionFactory found: [" + cf + "]");
>
> Queue q = (Queue) ic.lookup("IVTQueue");
> log.info("'IVTQueue' javax.jms.Queue found: [" + q +"]");
>
>
>
However, If I code the following +from a standalone Java client app on a remote dektop machine+, the ConnectionFactory lookup always results with 'factory' == NULL. .
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");
props.setProperty(Context.URL_PKG_PREFIXES, "org.jboss.naming:org.jnp.interfaces");
Context ctx = *new* InitialContext(props);
javax.jms.ConnectionFactory factory = (javax.jms.ConnectionFactory)ctx.lookup("IVTCF");
// 'factory' always value = NULL at his time, why?
System.out.println("'IVTCF' ConnectionFactory established! IVTCF=["+factory+"]");
Any ideas as to why the remote client lookup always returns a fatcory == NULL value, when the locally deployed servlet's lookup is always able to successfully return a correct value (for the +exact same+ JNDI object name)?
We have tried other JBoss forums suggested remedies ( http://community.jboss.org/thread/129674 ) but have not had success.
We would like a confirmation that, given the first block of code works correctly, we should reasonably expect the second block of code to also work correctly. It is our belief that the fact that the second block of code does not work may be an indication of a JBoss bug. Agree?
--------------------------------------------------------------
To reply to this message visit the message page: http://community.jboss.org/message/525121#525121
More information about the jboss-user
mailing list