[jboss-user] [JCA] New message: "Re: How to code JNDI lookup of JCA Resource ConnectionFactor"

Ben Cotton do-not-reply at jboss.com
Mon Feb 8 12:43:50 EST 2010


User development,

A new message was posted in the thread "How to code JNDI lookup of JCA Resource ConnectionFactory?":

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

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

Message:
--------------------------------------------------------------
Thanks Vicky.  Attached is the ConnectionFactory deployment descriptor. 
 
Note:  If I 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");
 
 
 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+"]");

 
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.
 
(Attachment:  IVTCF-ds.xml)
> <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
> <connection-factories>
> 
> 
>     <mbean code="org.jboss.resource.deployment.AdminObject" name="jca.wmq:name=IVTQueue">      
>         <attribute name="JNDIName">/IVTQueue</attribute>
>         <depends optional-attribute-name="RARName">
>             jboss.jca:service=RARDeployment,name='wmq.jmsra.rar' </depends>
>         <attribute name="Type">javax.jms.Queue</attribute>
>         <attribute name="Properties"> 
>             baseQueueManagerName=CapMktsQM
>             baseQueueName=SYSTEM.DEFAULT.LOCAL.QUEUE </attribute>         
>     </mbean>
> 
>     <tx-connection-factory>
>         <jndi-name>IVTCF</jndi-name> 
>         <xa-transaction/>
>         <rar-name>wmq.jmsra.rar</rar-name>
>         <use-java-context>false</use-java-context>
>         <connection-definition>javax.jms.ConnectionFactory</connection-definition>
>         <jmx-invoker-name>jboss:service=invoker,type=jrmp</jmx-invoker-name>
>         <min-pool-size>1</min-pool-size>
>         <max-pool-size>10</max-pool-size>
>         <blocking-timeout-millis>30000</blocking-timeout-millis>
>         <idle-timeout-minutes>30</idle-timeout-minutes>
>         <prefill>false</prefill>
>         <background-validation>false</background-validation>
>         <background-validation-millis>0</background-validation-millis>
>         <validate-on-match>true</validate-on-match>
>         <statistics-formatter>org.jboss.resource.statistic.pool.JBossDefaultSubPoolStatisticFormatter</statistics-formatter>
>         <isSameRM-override-value>false</isSameRM-override-value>
>         <allocation-retry>0</allocation-retry>
>         <allocation-retry-wait-millis>5000</allocation-retry-wait-millis>
>         <config-property type="java.lang.String" name="channel">SYSTEM.DEF.SVRCONN</config-property>
>         <config-property type="java.lang.String" name="hostName">10.9.60.107</config-property>
>         <config-property type="java.lang.String" name="port">1414</config-property>
>         <config-property type="java.lang.String" name="queueManager">CapMktsQM</config-property>
>         <config-property type="java.lang.String" name="transportType">CLIENT</config-property>
>         <security-domain-and-application>JmsXARealm</security-domain-and-application>
>         <xa-resource-timeout>0</xa-resource-timeout>
>     </tx-connection-factory>
> </connection-factories>
> 

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

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




More information about the jboss-user mailing list