I'm trying to get MQ integrated using the generic resource adapter. I followed these instructions:
https://genericjmsra.dev.java.net/docs/websphere-mq-integration-guide/webspheremq_integration_guide.html
I have tested a simple class via my rest controller and the file based jndi is working fine inside glassfish and I can send messages. Here is my domain.xml settings for the genericra:
<admin-object-resource enabled="true" jndi-name="jms/PROXYGEN_IN" object-type="user" res-adapter="genericra" res-type="javax.jms.Queue">
<property name="DestinationJndiName" value="PROXYGEN_IN_Q"/>
</admin-object-resource>
<admin-object-resource enabled="true" jndi-name="jms/PROXYGEN_BKR" object-type="user" res-adapter="genericra" res-type="javax.jms.Queue">
<property name="DestinationJndiName" value="PROXYGEN_BKR_Q"/>
</admin-object-resource>
<connector-resource enabled="true" jndi-name="jms/MsfQueueConnectionFactory" object-type="user" pool-name="MsfQueueConnectionFactory"/>
<resource-adapter-config object-type="user" resource-adapter-name="genericra">
<property name="SupportsXA" value="true"/>
<property name="RMPolicy" value="OnePerPhysicalConnection"/>
<property name="LogLevel" value="finest"/>
<property name="ProviderIntegerationMode" value="jndi"/>
<property name="JndiProperties" value="java.naming.factory.url.pkgs=com.ibm.mq.jms.naming,java.naming.factory.initial=com.sun.jndi.fscontext.RefFSContextFactory,java.naming.provider.url=file:/opt/mqm/jndi"/>
</resource-adapter-config>
<connector-connection-pool associate-with-thread="false" connection-creation-retry-attempts="0" connection-creation-retry-interval-in-seconds="10" connection-definition-name="javax.jms.QueueConnectionFactory" connection-leak-reclaim="false" connection-leak-timeout-in-seconds="0" fail-all-connections="false" idle-timeout-in-seconds="300" is-connection-validation-required="false" lazy-connection-association="false" lazy-connection-enlistment="false" match-connections="true" max-connection-usage-count="0" max-pool-size="100" max-wait-time-in-millis="60000" name="MsfQueueConnectionFactory" pool-resize-quantity="2" resource-adapter-name="genericra" steady-pool-size="20" transaction-support="NoTransaction" validate-atmost-once-period-in-seconds="0">
<property name="ConnectionFactoryJndiName" value="DEV_QCF"/>
<property name="Name" value="MsfQueueConnectionFactory"/>
</connector-connection-pool>
<admin-object-resource enabled="true" jndi-name="jms/PROXYGEN_IN" object-type="user" res-adapter="genericra" res-type="javax.jms.Queue">
<property name="DestinationJndiName" value="PROXYGEN_IN_Q"/>
</admin-object-resource>
<admin-object-resource enabled="true" jndi-name="jms/PROXYGEN_BKR" object-type="user" res-adapter="genericra" res-type="javax.jms.Queue">
<property name="DestinationJndiName" value="PROXYGEN_BKR_Q"/>
</admin-object-resource>
<connector-resource enabled="true" jndi-name="jms/MsfQueueConnectionFactory" object-type="user" pool-name="MsfQueueConnectionFactory"/>
<resource-adapter-config object-type="user" resource-adapter-name="genericra">
<property name="SupportsXA" value="true"/>
<property name="RMPolicy" value="OnePerPhysicalConnection"/>
<property name="LogLevel" value="finest"/>
<property name="ProviderIntegerationMode" value="jndi"/>
<property name="JndiProperties" value="java.naming.factory.url.pkgs=com.ibm.mq.jms.naming,java.naming.factory.initial=com.sun.jndi.fscontext.RefFSContextFactory,java.naming.provider.url=file:/opt/mqm/jndi"/>
</resource-adapter-config>
I get this exception:
#|2009-09-02T14:22:21.995-0400|INFO|sun-appserver2.1|com.sun.genericjmsra|_ThreadID=18;_ThreadName=pool-1-thread-10;|Error in allocating a connection. Cause: null
javax.resource.spi.ResourceAllocationException: Error in allocating a connection. Cause: null
at com.sun.enterprise.connectors.ConnectionManagerImpl.internalGetConnection(ConnectionManagerImpl.java:353)
at com.sun.enterprise.connectors.ConnectionManagerImpl.allocateConnection(ConnectionManagerImpl.java:189)
at com.sun.enterprise.connectors.ConnectionManagerImpl.allocateConnection(ConnectionManagerImpl.java:165)
at com.sun.enterprise.connectors.ConnectionManagerImpl.allocateConnection(ConnectionManagerImpl.java:158)
at com.sun.genericra.outbound.ConnectionFactory.createConnection(ConnectionFactory.java:75)
at org.springframework.jms.support.JmsAccessor.createConnection(JmsAccessor.java:184)
at org.springframework.jms.listener.AbstractJmsListeningContainer.createSharedConnection(AbstractJmsListeningContainer.java:378)
at org.springframework.jms.listener.AbstractJmsListeningContainer.establishSharedConnection(AbstractJmsListeningContainer.java:346)
at org.springframework.jms.listener.DefaultMessageListenerContainer.establishSharedConnection(DefaultMessageListenerContainer.java:678)
at org.springframework.jms.listener.AbstractJmsListeningContainer.doStart(AbstractJmsListeningContainer.java:258)
at org.springframework.jms.listener.AbstractJmsListeningContainer.initialize(AbstractJmsListeningContainer.java:171)
at org.springframework.jms.listener.AbstractPollingMessageListenerContainer.initialize(AbstractPollingMessageListenerContainer.java:204)
at org.springframework.jms.listener.DefaultMessageListenerContainer.initialize(DefaultMessageListenerContainer.java:459)
at org.springframework.jms.listener.AbstractJmsListeningContainer.afterPropertiesSet(AbstractJmsListeningContainer.java:134)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1369)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1335)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:473)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory$1.run(AbstractAutowireCapableBeanFactory.java:409)
at java.security.AccessController.doPrivileged(Native Method)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:380)
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:264)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:261)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:185)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:164)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:429)
at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:728)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:380)
at org.springframework.web.context.ContextLoader.createWebApplicationContext(ContextLoader.java:255)
at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:199)
at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:45)
at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4632)
at org.apache.catalina.core.StandardContext.start(StandardContext.java:5312)
at com.sun.enterprise.web.WebModule.start(WebModule.java:353)
at com.sun.enterprise.web.LifecycleStarter.doRun(LifecycleStarter.java:58)
at com.sun.appserv.management.util.misc.RunnableBase.runSync(RunnableBase.java:304)
at com.sun.appserv.management.util.misc.RunnableBase.run(RunnableBase.java:341)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334)
at java.util.concurrent.FutureTask.run(FutureTask.java:166)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
at java.lang.Thread.run(Thread.java:636)
Caused by: com.sun.enterprise.resource.PoolingException
at com.sun.enterprise.resource.AbstractResourcePool.createSingleResource(AbstractResourcePool.java:918)
at com.sun.enterprise.resource.AbstractResourcePool.createResourceAndAddToPool(AbstractResourcePool.java:1832)
at com.sun.enterprise.resource.AbstractResourcePool.createResources(AbstractResourcePool.java:976)
at com.sun.enterprise.resource.AbstractResourcePool.initPool(AbstractResourcePool.java:226)
at com.sun.enterprise.resource.AbstractResourcePool.internalGetResource(AbstractResourcePool.java:528)
at com.sun.enterprise.resource.AbstractResourcePool.getResource(AbstractResourcePool.java:455)
at com.sun.enterprise.resource.PoolManagerImpl.getResourceFromPool(PoolManagerImpl.java:248)
at com.sun.enterprise.resource.PoolManagerImpl.getResource(PoolManagerImpl.java:176)
at com.sun.enterprise.connectors.ConnectionManagerImpl.internalGetConnection(ConnectionManagerImpl.java:313)
... 42 more
[Message sent by forum member 'drfence' (markrstephens_at_gmail.com)]
http://forums.java.net/jive/thread.jspa?messageID=362750