MQ问题 3011 : MQRCCF_CFST_STRING_LENGTH_ERR 如何解决
我查询通道的是否出现这个错误[ERROR] [2011-02-24 11:33:05.875]initialize Error!
com.ibm.mq.pcf.PCFException: MQJE001:完成码 2,原因 3011
at com.ibm.mq.pcf.PCFMessageAgent.send(PCFMessageAgent.java:247)
at com.mocha.bsm.resourcemodel.plugin.mqplugin.MQPCFAgentChannelMetric.initialize(Unknown Source)
at com.mocha.bsm.resourcemodel.plugin.mqplugin.MQPCFAgentChannelMetric.<init>(Unknown Source)
at com.mocha.bsm.resourcemodel.plugin.mqplugin.MQMetricResults.A(Unknown Source)
at com.mocha.bsm.resourcemodel.plugin.mqplugin.MQMetricResults.run(Unknown Source)
at java.lang.Thread.run(Thread.java:534)
我在网上查了一下是说 :
MQRCCF_CFST_STRING_LENGTH_ERR
结构长度无效。
MQCFST StringLength 字段值无效。 此值是负的或大于 参数 字段中参数指定的最大允许长度。
正确的操作:指定可用的参数字符串长度。
但是如何设置参数字符串的长度呢?请高手赐教,感激不尽。
以下是我的代码实现:
request = new PCFMessage (CMQCFC.MQCMD_INQUIRE_CHANNEL);
// add a parameter designating the name of the channel for which status is requested
request.addParameter(CMQCFC.MQCACH_CHANNEL_NAME, targetName);
// add a parameter designating the instance type (current) desired
request.addParameter(CMQCFC.MQIACH_CHANNEL_TYPE, PCFConstants.MQCHT_ALL);
try
{
responses = agent.send(request);
//System.out.println("Total Number of response:"+responses.length);
for (int i=0; i < responses.length; i++)
{
// get the channel name and trim the spaces
//String temp = responses [i].toString();
// System.out.println(i+"*************"+temp);
Enumeration enu = responses [i].getParameters();
while(enu.hasMoreElements()){
Object key = (Object) enu.nextElement();
PCFParameter pcfParam = (PCFParameter)key;
//System.out.println("getParameter:"+pcfParam.getParameter());
//System.out.println("getStringValue:"+pcfParam.getStringValue());
map.put(String.valueOf(pcfParam.getParameter()), pcfParam.getStringValue());
}
}
// Disconnect
agent.disconnect ();
//System.out.println ("Done.");
}
catch (Exception e)
{
if(agent!=null) {
agent.disconnect();
log.error("Disconnection Completed!");
}
log.error("initialize Error!", e);
e.printStackTrace();
throw e;
}
补充:企业软件 , 中间件