JMSWMQ00018: failed to connect to queue manager - ibm-mq

I'm getting the error while ant script is trying to put a message in mq queue. I provided the correct queue manager details in the property file.
The same qm I'm able to connect from rfhutil, and able to write the message to the queue

Not enough information and you should be posting your code where it is failing.
Also, a JMS exception does not provide enough information. You need to get the MQ reason code. Update your code as follows:
catch (JMSException e)
{
System.err.println("getLinkedException()=" + e.getLinkedException());
System.err.println(e.getLocalizedMessage());
}
The LinkedException will contain the MQ reason code.

Related

IBM MQ - I can't create topic doesn't start with DEV. on docker version

I have installed the docker version of IBM MQ based on the following link
https://developer.ibm.com/tutorials/mq-connect-app-queue-manager-containers/
Then I created new topic with the following specs:
Name: PROD.TEST
Topic string: dev/test/
Then from C# client I am using dev/test/ to create subscriber to the created topic:
destination = sessionWMQ.CreateTopic(env.Conn.topic_name); subscriber
= sessionWMQ.CreateConsumer(destination);
For some reason if the Topic name doesn't start with DEV. the second line throws the following exception:
XMSException caught: IBM.XMS.IllegalStateException: Failed to
subscribe to topic dev/test/ using MQSUB. There may have been a
problem creating the subscription due to it being used by another
message consumer. Make sure any message consumers using this
subscription are closed before trying to create a new subscription
under the same name.
Linked Exception : CompCode: 2, Reason: 2035
To get you started quickly, container image of MQ's developer edition pre-authorises a user called "app" to be able to connect to the queue manager and access a set of predefined queues and topics. These are the DEV.* queues and the "dev/" branch of the topic tree through the DEV.BASE.TOPIC definition. This is explained here
You can then build on this by adding queues and topics and granting access to these as you require.
To do this with MQ's CLI (runmqsc) you would use the SET AUTHREC command. Or to use the web interface you would click on the configuration of the new topic and select the security tab. You'll need to grant publish or subscribe authority depending on what the application wants to do.
Obviously, this just gets you going, as you move forward you'll want to review the security requirements and decide how to configure MQ to provide this.

solace creates multi connection with spring boot

i try to use solace with spring boot.
here is a demo application and the log its create:
https://github.com/GreenRover/solace_spring_multiconnection/blob/master/problem.log
I wonder about this error (INFO) message
c.s.jcsmp.impl.SessionModeSupport .... - Error Response (400) - Already Exists
Is it normal to get this message or goes something wrong?
This message indicates that a queue fails to be created because a queue with the same name already exists.
This is expected since your sample code tries to create a queue with the same name more than once. It is ok to ignore this message.
However, if you want to avoid the message, the application has to make sure that only one queue is created with the name.

java mongodb driver how do you catch exceptions?

I want to be able to detect if a mongo server is available from the java driver for the purpose of reacting to any abnormal events as one would in JDBC land etc. It all works fine when the server is up but I am struggling to understand why it is so difficult to detect errors. I have a feeling its because the mongo client runs in a different thread and it doesn't re throw to me or something?
try {
MongoClient mongoClient = new MongoClient("localhost", 27017);
MongoDatabase db = mongoClient.getDatabase("mydb");
// if db is down or error getting people collection handle it in catch block
MongoCollection<Document> people = commentarr.getCollection("people");
} catch (Exception e) {
// handle server down or failed query here.
}
The result is
INFO: Exception in monitor thread while connecting to server localhost:27017
With the resulting stack trace containing a few different exceptions which I have tried to catch but my catch blocks still didn't do anything.
com.mongodb.MongoSocketOpenException: Exception opening socket
Caused by: java.net.ConnectException: Connection refused
I am using the java mongodb driver 3.0.4, most posts I read are from an older API with hacks like MongoClient.getDatabaseNames() which throws a MongoException if errors, except this is deprecated now and replaced with MongoClient.listDatabaseNames() which doesn't have the same error throwing semantics.
Is there a way to just execute a mongo query from the java driver in a try catch block and actually have the exception caught?
In the new API, MongoException is a RuntimeException. You can either catch the generic MongoException or, I believe, listDatabaseNames() would end up throwing a MongoCommandException ultimately.
You can redirect System.err to a ByteArrayOutputStream buffer. If a runtime exception is thrown, it will be collected into the buffer.
See an answer to a similar problem at: https://stackoverflow.com/a/47699292/7388679

issue while loading the messages in to MQ

issue facing while loading the messages in to mq channel, recieving an error like below pasted
MQOPEN ended with reason code 2001
unable to open queue for output
how can i resolve this above issue,kindly can any one please advice on the same
The return code resolves as follows:
C:\>mqrc 2001
2001 0x000007d1 MQRC_ALIAS_BASE_Q_TYPE_ERROR
The Infocenter page for this return code provides the following explanation:
2001 (07D1) (RC2001): MQRC_ALIAS_BASE_Q_TYPE_ERROR
Explanation
An MQOPEN or MQPUT1 call was issued specifying an alias queue as the destination, but the BaseQName in the alias queue definition resolves to a queue that is not a local queue, a local definition of a remote queue, or a cluster queue. Completion Code
*MQCC_FAILED Programmer response*
Correct the queue definitions.
In other words, the queue your app is opening is an alias queue. If you are opening for input and the base queue is not a local queue, this error results. If you are opening for output and the base queue is not a local queue, a local definition of a remote queue, or a cluster queue you also get this error.
What is not mentioned in the error code above is that if the alias queue points directly to a transmit queue you also get this error. In that case what you need is a QRemote and not an alias.

Weblogic Error - Method not supported : Statement.cancel

I am running an application on Weblogic 9.2 MP3, currently having problem with connection pool.
ERROR - UserBean retrieving user record. weblogic.jdbc.extensions.PoolLimitSQLException:
weblogic.common.resourcepool.ResourceLimitException: No resources currently available in pool MyApp Data Source to allocate to applications, please increase the size of the pool and retry..
I also kept getting below error message, saying "Method not supported : Statement.cancel()" which I think it is the cause to the error above.
<Error> <JDBC> <BEA-001131> <Received an exception when closing a cached statement for the pool "MyApp Data Source": java.sql.SQLException: Method not supported : Statement.cancel()..>
I went through the app source code, this method didn't seem to be used by the app at all. Just though it might be something to do with weblogic itself.
Anyone have any idea to fix this error?
Firstly, I'd make sure that I was closing every java.sql.Connection variable.
e.g.
final Connection connection = dataSource.getConnection();
// do your database work here
if (connection != null) {
connection.close();
}
You could probably make it even tighter by putting connection.close(); into the finally part of a try/catch block.

Resources