[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
Wed Feb 10 14:30:47 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/525558#525558
Author : Ben Cotton
Profile : http://community.jboss.org/people/ben.cotton@rutgers.edu
Message:
--------------------------------------------------------------
Just as an FYI, my dialog with senior technical staff at IBM resulted in the following personal musings:
1. This is not a JBoss AS 5.1 lookup "bug". No where does the JCA specification address the requirement that JCA compatible application servers accommodate a +remote+ client lookup of a JNDI bound ConnectionFactory name that bridges to a provider's ConnectionFactory implementation via a resource adapter.
2. This is not an IBM resource adapter "bug". The exact same thing happens, in the exact same way, when my +remote+ client does a lookup of a JNDI bound ConnectionFactory name ('JmsXA') that bridges to a JBoss provided ConnectionFactory implementation via a JBoss provided resource adapter. (see below for details). Like IBM's RA ConnectionFactory, the jBoss RA ConnectionFactory lookup works perfect when the client code is +locally+ deployed to JBoss AS.
3. Though theres are not "bugs", we still suffer from not realizing an ideal (remote_client-->JBoss JNDI lookup-->IBM JCA RA bridge-->WSMQ) capability.
4. NOTE: The following bridge works ideally (remote_client-->Apache Geronimo JNDI lookup-->IBM JCA RA bridge--> WSMQ).
5. NOTE: The following bridge works ideally (remote_client-->GlassFish JNDI lookup-->IBM JCA RA bridge-->WSMQ).
6. NOTE: The following bridge has a (not ideal) functional work-around (remote_client-->WebLogic-->non-JCA WLS:MQ bridge-->WSMQ)
7. Though not a JBoss "bug", it may be appropriate to create a JBoss "feature enhancement" JIRA that requests that a capabilty similar to #4-#6 above be provided in JBoss AS. Agree?
Here are details for confirming #2.
(i) Change the default +$JBOSS_HOME/server/default/deploy/messaging+/+jms-ds.xml+ as follows
> <?xml version="1.0" encoding="UTF-8"?>
>
> <connection-factories>
>
> <!-- ==================================================================== -->
> <!-- JMS Stuff -->
> <!-- ==================================================================== -->
>
> <!--
> The JMS provider loader. Currently pointing to a non-clustered ConnectionFactory. Need to
> be replaced with a clustered non-load-balanced ConnectionFactory when it becomes available.
> See http://jira.jboss.org/jira/browse/JBMESSAGING-843.
> -->
> <mbean code="org.jboss.jms.jndi.JMSProviderLoader"
> name="jboss.messaging:service=JMSProviderLoader,name=JMSProvider">
> <attribute name="ProviderName">DefaultJMSProvider</attribute>
> <attribute name="ProviderAdapterClass">org.jboss.jms.jndi.JNDIProviderAdapter</attribute>
> <attribute name="FactoryRef">java:/XAConnectionFactory</attribute>
> <attribute name="QueueFactoryRef">java:/XAConnectionFactory</attribute>
> <attribute name="TopicFactoryRef">java:/XAConnectionFactory</attribute>
> </mbean>
>
> <!-- JMS XA Resource adapter, use this to get transacted JMS in beans -->
> <tx-connection-factory>
> <jndi-name>JmsXA</jndi-name>
> <xa-transaction/>
> <rar-name>jms-ra.rar</rar-name>
> * <use-java-context>false</use-java-context> <!-- add this line to "out of the box" config -->*
> <connection-definition>org.jboss.resource.adapter.jms.JmsConnectionFactory</connection-definition>
> <config-property name="SessionDefaultType" type="java.lang.String">javax.jms.Topic</config-property>
> <config-property name="JmsProviderAdapterJNDI" type="java.lang.String">java:/DefaultJMSProvider</config-property>
> <max-pool-size>20</max-pool-size>
> <security-domain-and-application>JmsXARealm</security-domain-and-application>
> <depends>jboss.messaging:service=ServerPeer</depends>
> </tx-connection-factory>
>
> </connection-factories>
>
(ii) reboot JBoss AS 5.1 process
(iii) confirm (from JMX consoleJNDIView) that the 'JmsXA' ConnectionFactory name is bound in JBoss' global JNDI tree, referencing the JBoss resource adapter ConnectionFactory implementation
> +- JmsXA (class: org.jboss.resource.adapter.jms.JmsConnectionFactoryImpl)
(iv) execute the followng lookup code from remote client Java application (sorry this code is listed as image, text cut/paste stopped working for me for this "Post reply" session)
http://community.jboss.org/servlet/JiveServlet/showImage/2037/Untitled.jpg
(v) Confirm from the stdout that this code's lookup() of the JBoss apapter's ConnectionFactory invoke returned NULL (exactly like the lookup() of the IBM adapter's ConnectionFactory)
http://community.jboss.org/servlet/JiveServlet/showImage/2038/JmsXaConnectionFacotry%3DNULL.jpg
--------------------------------------------------------------
To reply to this message visit the message page: http://community.jboss.org/message/525558#525558
More information about the jboss-user
mailing list