I'm trying to access a queue.
def mqProps = new Hashtable<String, Object>()
mqProps.put(MQConstants.CHANNEL_PROPERTY, 'CHANNEL')
mqProps.put(MQConstants.PORT_PROPERTY, PORT)
mqProps.put(MQConstants.HOST_NAME_PROPERTY, 'HOST')
mqProps.put(MQConstants.USER_ID_PROPERTY, 'myuser') // is it the correct property for the user?
mqProps.put(MQConstants.PASSWORD_PROPERTY, 'mypassword') // is it the correct property for the password?
def qMgr = new MQQueueManager('QM', mqProps)
However I'm facing the following error
javax.script.ScriptException: com.ibm.mq.MQException: MQJE001: Completion Code '2', Reason '2538'
...
Caused by: com.ibm.mq.MQException: MQJE001: Completion Code '2', Reason '2538'.
...
Caused by: com.ibm.mq.jmqi.JmqiException: CC=2;RC=2538;AMQ9204: Connection to host 'HOST(PORT)' rejected.
...
Caused by: com.ibm.mq.jmqi.JmqiException: CC=2;RC=2538;AMQ9204: Connection to host 'HOST/address:PORT' rejected.
...
Caused by: java.net.ConnectException: Connection timed out: connect
...
The error happened on the line:
def qMgr = new MQQueueManager('QM', mqProps)
Can you please explain me reason of this issue? Thank you a lot.
Reason Code 2538 is MQRC_HOST_NOT_AVAILABLE.
You can quickly discover this by using the mqrc command line tool that comes with IBM MQ. Type:
mqrc 2538
and you will be told:
2538 0x000009ea MQRC_HOST_NOT_AVAILABLE
Alternatively you can look it up in the IBM MQ Knowledge Center.
Reading the explanation in Knowledge Center will show you a number of common possibilities for the problem.
The listener has not been started on the remote system.
The connection name in the client channel definition is incorrect.
The network is currently unavailable.
A firewall blocking the port, or protocol-specific traffic
Perhaps the most common of errors is that the listener running at the queue manager is not using the same port number that you have put in the client application connection details.
You haven't shown us in your question any details about the listener running on the queue manager, so we will have to leave that for you to check yourself.
Related
Hello i have a error in Hermes jms when click on discover
this is error
javax.jms.JMSException: Could not create InitialContext: Failed to initialize JNDI context, tried 2 time or times totally, the interval of each time is 0ms.
Timed out while attempting to establish connection to :t3://100.100.00.101:7002
at hermes.JNDIContextFactory.createContext(JNDIContextFactory.java:282)
at hermes.ext.HermesAdminSupport.discoverDestinationConfigs(HermesAdminSupport.java:441)
at hermes.impl.HermesAdminAdapter.discoverDestinationConfigs(HermesAdminAdapter.java:82)
at hermes.impl.DefaultHermesImpl.discoverDestinationConfigs(DefaultHermesImpl.java:1126)
at hermes.browser.tasks.DiscoverDestinationsTask.invoke(DiscoverDestinationsTask.java:77)
at hermes.browser.tasks.TaskSupport.run(TaskSupport.java:175)
at hermes.browser.tasks.ThreadPool.run(ThreadPool.java:170)
at java.lang.Thread.run(Thread.java:745)
anyone can help me to solve this problem?
Not really a direct answer to your question, but depending on your use cases, you could give a try to JMSToolBox
I am getting the below errors when my application trying send the response messages.
[2/15/17 14:25:09:341 AEDT] 0000e283 ConnectionEve W J2CA0206W: A connection error occurred. To help determine the problem, enable the Diagnose Connection Usage option on the Connection Factory or Data Source. This is the multithreaded access detection option. Alternatively check that the Database or MessageProvider is available.
[2/15/17 14:25:09:346 AEDT] 0000e283 ConnectionEve A J2CA0056I: The Connection Manager received a fatal connection error from the Resource Adapter for resource jms/amq/IB2B_qcf. The exception is: javax.jms.JMSException: Connection refused:java.net.ConnectException: Connection refused
I am using IBM Websphere MQ 7.5 in Unix system. I have installed the client on my machine and server is running on other machine. I am observing a scenario where I am able to communicate with server when running my JMS application via 'mqm' user but facing below mentioned error when using other user.
But I am able to run 'amqsputc' and 'amqsgetc' command and communicate with the server with mqm as well as other user also. I have followed all steps mentioned http://www-01.ibm.com/support/knowledgecenter/SSFKSJ_7.5.0/com.ibm.mq.ins.doc/q009300_.htm?lang=en
Exception:
com.ibm.msg.client.jms.DetailedJMSSecurityException: JMSWMQ2013: The security authentication was not valid that was supplied for QueueManager 'TestManager' with connection mode 'Client' and host name 'x.x.x.x(9923)'.
Please check if the supplied username and password are correct on the QueueManager to which you are connecting.
at com.ibm.msg.client.wmq.common.internal.Reason.reasonToException(Reason.java:521)
at com.ibm.msg.client.wmq.common.internal.Reason.createException(Reason.java:221)
at com.ibm.msg.client.wmq.internal.WMQConnection.<init>(WMQConnection.java:426)
at com.ibm.msg.client.wmq.factories.WMQConnectionFactory.createV7ProviderConnection(WMQConnectionFactory.java:6902)
at com.ibm.msg.client.wmq.factories.WMQConnectionFactory.createProviderConnection(WMQConnectionFactory.java:6277)
at com.ibm.msg.client.jms.admin.JmsConnectionFactoryImpl.createConnection(JmsConnectionFactoryImpl.java:285)
at com.ibm.mq.jms.MQConnectionFactory.createCommonConnection(MQConnectionFactory.java:6233)
at com.ibm.mq.jms.MQQueueConnectionFactory.createQueueConnection(MQQueueConnectionFactory.java:120)
at com.ibm.mq.jms.MQQueueConnectionFactory.createConnection(MQQueueConnectionFactory.java:203)
at performance.IBMMQTestProducer.start(IBMMQTestProducer.java:142)
at performance.IBMMQTestProducer.main(IBMMQTestProducer.java:177)
Caused by: com.ibm.mq.MQException: JMSCMQ0001: WebSphere MQ call failed with compcode '2' ('MQCC_FAILED') reason '2035' ('MQRC_NOT_AUTHORIZED').**
at com.ibm.msg.client.wmq.common.internal.Reason.createException(Reason.java:209)
... 9 more
Caused by: com.ibm.mq.jmqi.JmqiException: CC=2;RC=2035;AMQ9509: Program cannot open queue manager object. [1=2035,5=???]**
at com.ibm.mq.jmqi.internal.JmqiTools.getQueueManagerInfo(JmqiTools.java:783)
at com.ibm.mq.jmqi.remote.impl.RemoteSession.loadInfo(RemoteSession.java:1993)
at com.ibm.mq.jmqi.remote.impl.RemoteSession.getName(RemoteSession.java:2026)
at com.ibm.mq.jmqi.remote.api.RemoteHconn.getName(RemoteHconn.java:728)
at com.ibm.mq.ese.intercept.JmqiConnInterceptorImpl.validate(JmqiConnInterceptorImpl.java:321)
at com.ibm.mq.ese.intercept.JmqiConnInterceptorImpl.afterConnect(JmqiConnInterceptorImpl.java:226)
at com.ibm.mq.ese.intercept.JmqiConnInterceptorImpl.afterJmqiConnect(JmqiConnInterceptorImpl.java:133)
at com.ibm.mq.ese.jmqi.InterceptedJmqiImpl.jmqiConnect(InterceptedJmqiImpl.java:315)
at com.ibm.mq.ese.jmqi.ESEJMQI.jmqiConnect(ESEJMQI.java:337)
I am able to run it when I am running as myself and passing 'mqm' when starting the connection.
connection = cf.createConnection("mqm", "pswd");
I am not getting anything in manager's log. Below is the log.
------------------------------------------------------------------------------
10/30/2015 06:50:54 AM - Process(31064.1) User(mqm) Program(strmqm)
Host(x.x.x.x) Installation(Installation1)
VRMF(7.5.0.2)
AMQ7125: There are 83 days left in the trial period for this copy of WebSphere
MQ.
EXPLANATION:
This copy of WebSphere MQ is licensed for a limited period only.
ACTION:
None.
Given that you have told us that you have successfully connected and run the amqsgetc and amqsputc client samples using the same server-connection channel as you are attempting to use for your JMS program that suggests that this is not a connection time problem, in other words the MQCONN to the queue manager has been successful and something following that is failing. We know that you can MQPUT and MQGET (since that is what the aforementioned samples do).
Something that JMS does that those simple samples do not do, is an MQINQ of the queue manager. The following part of your exception makes me wonder if that is what you are tripping over:-
Caused by: com.ibm.mq.jmqi.JmqiException: CC=2;RC=2035;
AMQ9509: Program cannot open queue manager object. [1=2035,5=???] at
com.ibm.mq.jmqi.internal.JmqiTools.getQueueManagerInfo(JmqiTools.java:783) at
To be completely certain you must check the queue manager AMQERR01.LOG to see what is reported there. If it is missing authorization then it will tell you there.
I am running the smoke suite on Jmeter with WMQ and IMA set Up. I am facing an issue where after running the suite say for eg 10 mins rest of the samplers( Jms Subscriber,Jms Point to Point) are failing because of below error code:
2015/08/31 13:18:07 ERROR - jmeter.protocol.jms.sampler.JMSSampler: Unable to connect to the target queue manager 172.18.14.115:1419/VJT.CLIENT.SMH javax.naming.ServiceUnavailableException: Unable to connect to the target queue manager 172.18.14.115:1419/VJT.CLIENT.SMH [Root exception is com.ibm.mq.MQException: MQJE001: An MQException occurred: Completion Code 2, Reason 2009
MQJE016: MQ queue manager closed channel immediately during connect
Closure reason = 2009]
at com.ibm.mq.jms.context.MQContext.(MQContext.java:196)
at com.ibm.mq.jms.context.WMQInitialContextFactory.getInitialContext(WMQInitialContextFactory.java:29)
at javax.naming.spi.NamingManager.getInitialContext(Unknown Source)
at javax.naming.InitialContext.getDefaultInitCtx(Unknown Source)
at javax.naming.InitialContext.init(Unknown Source)
at javax.naming.InitialContext.(Unknown Source)
at org.apache.jmeter.protocol.jms.sampler.JMSSampler.getInitialContext(JMSSampler.java:424)
at org.apache.jmeter.protocol.jms.sampler.JMSSampler.threadStarted(JMSSampler.java:319)
at org.apache.jmeter.threads.JMeterThread$ThreadListenerTraverser.addNode(JMeterThread.java:597)
at org.apache.jorphan.collections.HashTree.traverseInto(HashTree.java:961)
at org.apache.jorphan.collections.HashTree.traverse(HashTree.java:946)
at org.apache.jmeter.threads.JMeterThread.threadStarted(JMeterThread.java:566)
at org.apache.jmeter.threads.JMeterThread.initRun(JMeterThread.java:554)
at org.apache.jmeter.threads.JMeterThread.run(JMeterThread.java:253)
at java.lang.Thread.run(Unknown Source)
Caused by: com.ibm.mq.MQException: MQJE001: An MQException occurred: Completion Code 2, Reason 2009
MQJE016: MQ queue manager closed channel immediately during connect
Closure reason = 2009
at com.ibm.mq.MQManagedConnectionJ11.(MQManagedConnectionJ11.java:212)
at com.ibm.mq.MQClientManagedConnectionFactoryJ11._createManagedConnection(MQClientManagedConnectionFactoryJ11.java:318)
at com.ibm.mq.MQClientManagedConnectionFactoryJ11.createManagedConnection(MQClientManagedConnectionFactoryJ11.java:338)
at com.ibm.mq.StoredManagedConnection.(StoredManagedConnection.java:84)
at com.ibm.mq.MQSimpleConnectionManager.allocateConnection(MQSimpleConnectionManager.java:168)
at com.ibm.mq.MQQueueManagerFactory.obtainBaseMQQueueManager(MQQueueManagerFactory.java:772)
at com.ibm.mq.MQQueueManagerFactory.procure(MQQueueManagerFactory.java:697)
at com.ibm.mq.MQQueueManagerFactory.constructQueueManager(MQQueueManagerFactory.java:657)
at com.ibm.mq.MQQueueManagerFactory.createQueueManager(MQQueueManagerFactory.java:153)
at com.ibm.mq.MQQueueManager.(MQQueueManager.java:451)
at com.ibm.mq.pcf.PCFAgent.connect(PCFAgent.java:240)
at com.ibm.mq.pcf.PCFAgent.(PCFAgent.java:174)
at com.ibm.mq.pcf.PCFMessageAgent.(PCFMessageAgent.java:142)
at com.ibm.mq.jms.context.MQContext.(MQContext.java:183)
... 14 more
Caused by: com.ibm.mqservices.MQInternalException: MQJE001: An MQException occurred: Completion Code 2, Reason 2009
MQJE016: MQ queue manager closed channel immediately during connect
Closure reason = 2009
we are unable to get the root cause, Can anyone please suggest the reason.
we got the root cause of this issue, it is not because of Jmeter but because WMQ properties MAXINST & MAXINSTC for all the channels They were set to 25 that's why we are not able to establish the connection with WMQ after 25 request.
So we increased the size to 150 and the issue got resoved.
When standalone client and jboss server runs on the same machine, everything works fine, but when i try to run the JBoss on a VM, i can get a JNDIContext from the Server,i can do a successful lookup, but i cannot establish a connection.
The Client throwing an exception as:
Exception in thread "main" javax.jms.JMSException: Failed to create session factory
at org.hornetq.jms.client.HornetQConnectionFactory.createConnectionInternal(HornetQConnectionFactory.java:605)
at #org.hornetq.jms.client.HornetQConnectionFactory.createConnection(HornetQConnectionFactory.java:119)
...
Caused by: HornetQException[errorCode=2 message=Cannot connect to server(s). Tried with all available servers.]
at org.hornetq.core.client.impl.ServerLocatorImpl.createSessionFactory(ServerLocatorImpl.java:769)
at org.hornetq.jms.client.HornetQConnectionFactory.createConnectionInternal(HornetQConnectionFactory.java:601)
... 2 more
And the server End showing msg as,
JBAS011806: Channel end notification received, closing channel Channel ID 459d0f32 (inbound) of Remoting connection 00e9212a to /192.168.35.29:42179
I have seen other posts also related to this issue , but I didnt clear with the solution . So Plz help me out and forgive me If I am asking silly question since I am new in this domain.
Thanks.
You have to configure the port on the server. You probably have the server starting as localhost and you are connecting externally, in such way the JNDI can connect but not the HornetQ connector.
You certainly have a configuration error, but without knowing version, what actual message you got and configuration options I have little information to help you more beyond that.