I got a MQFTE job that move a file from one Agent to another Agent. Once the file has been moved, the file gets split into individual messages by the MQFTE Agent.
Once the split has been done, the messages needs to be moved form one queue to another queue by a user exit. The user exit is implemented by implementing the DestinationTransferEndExit interface.
The issue is that I can't get a handle to the QueueManager in a bindings mode. If I execute the code outside the Agent JVM it works without any issues.
I get the following error:
[01/03/2015 13:46:31:107 SAST] 0000001d StdErr E com.ibm.mq.MQException: MQJE001: Completion Code '2', Reason '2495'.
.
.
.
[01/03/2015 13:46:31:115 SAST] 0000001d StdErr E Caused by: com.ibm.mq.jmqi.local.LocalMQ$3: CC=2;RC=2495;AMQ8598: Failed to load the WebSphere MQ native JNI library: 'mqjbnd'.
.
.
.
[01/03/2015 13:46:31:117 SAST] 0000001d StdErr E Caused by: java.lang.UnsatisfiedLinkError: mqjbnd (Library is already loaded in another ClassLoader)
The code that I execute is as follow:
MQEnvironment.properties.put(MQC.TRANSPORT_PROPERTY,
MQC.TRANSPORT_MQSERIES_BINDINGS);
MQQueueManager sourceMgr = new MQQueueManager(aQManagerName);
int openOptions = MQC.MQOO_INPUT_AS_Q_DEF | MQC.MQOO_OUTPUT ;
MQQueue source_queue = sourceMgr.accessQueue(aSourceQName, openOptions);