I am new to IBM WebSphere MQ. I am trying to connect to MQ using IBM.XMS dll in a plugin for Dynamics CRM and getting below error.
Exception:Fatal error. Failed to initialize XMSFactoryFactory
Stack Trace: at IBM.XMS.XMSFactoryFactory.GetXmsFactory(Int32 connectionType)
at IBM.XMS.XMSFactoryFactory.GetInstance(Int32 connectionType)
at Mta.ACBPS.Mta.Crm.Plugins.PostMtaMessageCreate.GetConnection(IOrganizationService service, mta_mqconnection mqConnectionRecord, ITracingService tracer)
Inner Exception:System.InvalidCastException: Unable to cast object of type 'IBM.XMS.Client.Impl.XmsFactoryFactoryImpl' to type 'IBM.XMS.XMSFactoryFactory'.
The source code is
var connectionfactory = (IConnectionFactory)null;
try
{
var factoryfactory = XMSFactoryFactory.GetInstance(XMSC.CT_WMQ);
connectionfactory = factoryfactory.CreateConnectionFactory();
connectionfactory.SetStringProperty(XMSC.WMQ_QUEUE_MANAGER, mqConnectionRecord.mta_name);
connectionfactory.SetStringProperty(XMSC.WMQ_HOST_NAME, mqConnectionRecord.mta_HostIP);
connectionfactory.SetIntProperty(XMSC.WMQ_PORT, int.Parse(mqConnectionRecord.mta_Port));
connectionfactory.SetStringProperty(XMSC.WMQ_CHANNEL, mqConnectionRecord.mta_Channel);
connectionfactory.SetIntProperty(XMSC.WMQ_BROKER_VERSION, XMSC.WMQ_BROKER_V2);
connectionfactory.SetIntProperty(XMSC.WMQ_CONNECTION_MODE, XMSC.WMQ_CM_CLIENT_UNMANAGED);
}
The obvious question is: have you installed MQ client or just copied IBM.XMS.DLL assembly from somewhere and using it? IBM.XMS has dependency on many other assemblies. Just having IBM.XMS assembly alone does not help.
IBM XMS .NET client comes bundled with MQ client. So you must install MQ client. You can download latest MQ client from here.
Once you install MQ client, refer the samples in \Tools\dotnet\samples\cs\xms directory.
Update based on comment
I am wondering if you need to reference other XMS assemblies in your plugin so that CRM finds those dependent assemblies. As a starting point, you can reference IBM.XMS.Client.Impl and IBM.XMS.Impl and see if it helps.
This is fixed. I was referencing IBM.XMS and using ILMerge to merge assembly with my plugin code dll. I rmeoved IMLerge and now plugin is using assemblies installed in GAC for IBM.XMS.
Related
I have a solution hosted in Azure that is using ServiceStack.Redis 2.0.601.
App Services (Web API) and On-Premise windows services are all working as expected but the Cloud service worker roles are throwing binding errors.
Add Binding redirect and enable auto binding redirect in the worker role.
Use ILSpy to verify the versions that are copied by the build have same version as defined in the binding redirect.
Use fuslogvw.exe to catch binding errors but couldn't make it get any data from the Cloud Service Emulator
I'm running the same code with same app configs in other type of projects and all working great
The code is very simple, Create a cloud service with one worker role.
Add StachExchange.Redis nuget version 2.0.601 and try to connect a REDIS instance using the following line:
var connection = ConnectionMultiplexer.Connect(#ConnectionString#);
This is the only line I have in the code inside WorkerRole.OnStart Method.
System.BadImageFormatException: 'Could not load file or assembly 'System.Memory, Version=4.0.1.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51' or one of its dependencies. Reference assemblies should not be loaded for execution. They can only be loaded in the Reflection-only loader context. (Exception from HRESULT: 0x80131058)'
I was getting similar errors, and realized I needed to add a bunch of additional Nuget packages.
System.Buffers
System.IO.Pipelines
System.Memory
I am developing a simple java program in CICS Explorer to connect to DB2 on mainframe.
Using the plug-in development option in CICS Explorer, I have converted the DB2 jars as plug-ins,deployed them and added the deployed plugins in the JVM profile OSGi Bundles option .I have also added the same in the LIBPATH option in JVMProfile and in the CICS Explorer target platform.
But on deploying the bundle in CICS , I am getting the error :
Error msg : No Suitable driver
SQLSTATE : 08001
Error code : 0
Kindly help me trace the issue
If you're having to convert the DB2 JARs into OSGi bundles it's likely that you've not got the requisite APARs applied. If you use the JARs that are provided with the following APARs:
PM36832
PM36838
then they are already OSGi bundles, plus, they also register the DB2 Driver automatically - avoiding the 'No Suitable driver' problem.
In trying to connect from an MQSeries 7.5 client to a 7.5 local server I'm getting a CSIException: JMSCS0002 which when I look up the error in the IBM codes says:
JMSCS0002
The call could not be completed because CommonServices has not been initialized.
CommonServices is an internal component and needs to be initialized at startup but has failed.
Check that the installation and classpath setup is correct.
But both my compile and run classpaths include com.ibm.mq.commonservices.jar, com.ibm.msg.client.commonservices.jar, and com.ibm.msg.client.commonservices.j2se.jar
I'm was using Oracle JDK 1.6. I tried using the WS MQ java but it made no difference.
Any help appreciated. Thanks.
Caused by: com.ibm.msg.client.commonservices.CSIException: JMSCS0002
at com.ibm.msg.client.commonservices.workqueue.PIWorkQueueManager.enqueueItem(PIWorkQueueManager.java:67)
at com.ibm.msg.client.commonservices.workqueue.WorkQueueManager.enqueue(WorkQueueManager.java:225)
at com.ibm.msg.client.commonservices.workqueue.WorkQueueManager.enqueue(WorkQueueManager.java:194)
at com.ibm.msg.client.wmq.common.internal.WMQThreadPool.enqueue(WMQThreadPool.java:91)
I had been using jar files from an uninstalled MQSeries 7.5 Client because I wanted to make sure that the functionality I was using would work just with the jars provided by the free client license. According to IBM documentation taking uninstalled jars is problematic.
When I switched to the jars from the installed server trial then things works ok.
I am using SAP PI to connect with IBM MQseries (v 5.3).
Whenever there is a n/w problem or any outage on WebSphere MQs, the SAP interfaces error out with the message "Completion Code 2, Reason 2161, MQJMS2002". To fix this, we are being asked to deploy new client files. Can anyone help us find these jar files. I have downloaded the v7 client from http://www-01.ibm.com/support/docview.wss?rs=171&uid=swg24019253&loc=en_US&cs=utf-8&lang=en, but it doesn't contain jar files. It has rte files.
For anyone locating this question and wanting an answer it is now (quite recently) possible to obtain the MQ JMS jar files for direct use rather than having to go through an install.
Read more about it here: Obtaining the WebSphere MQ classes for JMS
The .jar files are in MQC7 (the WebSphere MQ V7.0 Clients supportpac), which is where your link goes. The install location varies with platform, but will be a java/lib directory under the main install path e.g. on Linux it would be /opt/mqm/java/lib
I am trying to migrate an application from Websphere 6.1 to 7.0
I noticed that many of the ibm MQ/JMS classes have changed/disappeared =)
In particular, I am getting errors on
com.ibm.msg.client.jms.JmsQueue
com.ibm.mq.jmqi.JmqiObject
it is saying "...cannot be resolved. It is indirectly referenced from required .class files"
Does anyone know what I can do to get this to compile?
thanks
Hard to say exactly from the description so I'll provide some general pointers that may be of help.
The WMQ JMS and Java support was completely rewritten in V7 to use a common JMQI layer. This will affect the jar files that are referenced as well as the CLASSPATH and a few other things.
If you have bundled the WMQ jar files into your application, you will want to delete them and reference the ones installed with WAS instead.
If you used MDB listeners, you will need to switch to Activation Specs.
For more info, see the Integration of WebSphere MQ classes for JMS with WebSphere Application Server section in the WMQ V7 Migration manual and the CLASSPATH settings from the Environment section in the WMQ V7 Using Java manual.
The WebSphere Application Server V7 Migration Guide does not address WMQ in depth but it does have pointers to additional migration resources such as IBM Education Assistant as well as specific application and profile migration advice.