How to remote lookup WMQ resource adapter in JBoss7/WildFly?
hai_feng Dec 5, 2013 4:01 AMHI Everybody!
I have deployed a resource adapter and added a connection definition in standalone-full.xml.This configuration is according to the below document:
Now i have to test it's connection using remote client.
Following is the resource adapter configuration :
<subsystem xmlns="urn:jboss:domain:resource-adapters:2.0"> <resource-adapters> <resource-adapter id="wmq.jmsra-7.0.1.3.rar"> <archive> wmq.jmsra-7.0.1.3.rar </archive> <transaction-support>NoTransaction</transaction-support> <connection-definitions> <connection-definition class-name="com.ibm.mq.connector.outbound.ManagedConnectionFactoryImpl" jndi-name="java:jboss/exported/jms/MQConnectionFactory" enabled="true" pool-name="jms/MQConnectionFactory"> <config-property name="port"> 1420 </config-property> <config-property name="channel"> CHANNEL1 </config-property> <config-property name="hostName"> 10.20.90.110 </config-property> <config-property name="transportType"> 1 </config-property> <config-property name="queueManager"> APPDEV01_QM </config-property> <security> <application/> </security> <validation> <background-validation>false</background-validation> </validation> </connection-definition> </connection-definitions> <admin-objects> <admin-object class-name="com.ibm.mq.connector.outbound.MQQueueProxy" jndi-name="java:jboss/exported/jms/queue/CGF_TESTQ" enabled="true" use-java-context="false" pool-name="jms/queue/CGF_TESTQ"/> </admin-objects> </resource-adapter> </resource-adapters> </subsystem>
----------------------------------------------------------Jboss Console -------------------------------------------------------------------------------------------------------------------------
16:01:15,625 INFO [org.jboss.as.connector.deployment] (MSC service thread 1-3) JBAS010406: Registered connection factory java:jboss/exported/jms/MQConnectionFactory
16:01:15,736 INFO [org.jboss.as.connector.deployment] (MSC service thread 1-3) JBAS010405: Registered admin object at java:jboss/exported/jms/queue/CGF_TESTQ
16:01:15,772 INFO [org.jboss.as.connector.deployment] (MSC service thread 1-4) JBAS010401: Bound JCA ConnectionFactory [java:jboss/exported/jms/MQConnectionFactory]
16:01:15,773 INFO [org.jboss.as.connector.deployment] (MSC service thread 1-2) JBAS010401: Bound JCA AdminObject [java:jboss/exported/jms/queue/CGF_TESTQ]
-------------------------------------------------- Remote Client Application ----------------------------------------------------------------------------------------------------------------
final Properties env = new Properties();
env.put(Context.INITIAL_CONTEXT_FACTORY, "org.jboss.naming.remote.client.InitialContextFactory");
//env.put(Context.PROVIDER_URL, "http-remoting://127.0.0.1:8080");
env.put(Context.PROVIDER_URL, "remote://localhost:4447");
env.put(Context.SECURITY_PRINCIPAL, "admin");
env.put(Context.SECURITY_CREDENTIALS, "sn@12345");
context = new InitialContext(env);
ConnectionFactory connectionFactory = (ConnectionFactory) context.lookup("jms/MQConnectionFactory");
Queue destination = (Queue) context.lookup("jms/queue/CGF_TESTQ");
--------------------------------------------------------java console----------------------------------------------------------------------------------------------------------------------------------------------------
Error:
SEVERE: Failed to lookup
Exception in thread "main" org.jboss.naming.remote.protocol.NamingIOException: Failed to lookup [Root exception is java.io.NotSerializableException: org.jboss.jca.core.connectionmanager.ccm.CachedConnectionManagerImpl]
at org.jboss.naming.remote.client.ClientUtil.namingException(ClientUtil.java:49)
at org.jboss.naming.remote.protocol.v1.Protocol$1.execute(Protocol.java:104)
at org.jboss.naming.remote.protocol.v1.RemoteNamingStoreV1.lookup(RemoteNamingStoreV1.java:95)
at org.jboss.naming.remote.client.HaRemoteNamingStore$1.operation(HaRemoteNamingStore.java:245)
at org.jboss.naming.remote.client.HaRemoteNamingStore.namingOperation(HaRemoteNamingStore.java:132)
at org.jboss.naming.remote.client.HaRemoteNamingStore.lookup(HaRemoteNamingStore.java:241)
at org.jboss.naming.remote.client.RemoteContext.lookup(RemoteContext.java:79)
at org.jboss.naming.remote.client.RemoteContext.lookup(RemoteContext.java:83)
at javax.naming.InitialContext.lookup(InitialContext.java:411)
at jmsTest.JMSProducer.main(JMSProducer.java:44)
__________________________________________________________
I look for a article which the same with my problem,but it has no answer,the link below:
Re: How to remote lookup resource adapter in Jboss 7.1.0.Final?
This problem confuse me a few day,I hope your assistance eagerly!
__________________________________________________________
There is another question confuse me,the description forllowing:
I open the "JNDI View" under the management console and look for the MQConnectionFactory,CGF_TESTQ which I definition previous.There is a phenomenon which you can see by the below picture:
I don't know the "?" mean.Is that say the MQConnectionFactory,CGF_TESTQ what I definite are invalid?but in the Jboss Console we can see they were registered and bound.
your answer please!
Wind Wild
Thanks!