jetty - 使用 MQ 连接的码头配置时,WebSphere MQ 调用失败,compcode '2' ('MQCC_FAILED') 原因 '2397' ('MQRC_JSSE_ERROR')
问题描述
我在 jetty-env.xml 文件中将 MQ 连接配置为:
<New id="myJmsConnection" class="org.eclipse.jetty.plus.jndi.Resource">
<Arg><Ref refid="wac"/></Arg>
<Arg>jms/mymq</Arg>
<Arg>
<New class="com.ibm.mq.jms.MQConnectionFactory">
<Set name="connectionNameList">x.x.x.x</Set>
<Set name="port">xxx</Set>
<Set name="queueManager">xxx</Set>
<Set name="channel">xxx.CHANNEL</Set>
<Set name="transportType">1</Set>
<Set name="SSLCipherSuite">xxxx</Set>
</New>
</Arg>
</New>
使用上述配置,当我运行码头时,我收到此错误嵌套异常是 com.ibm.mq.MQException: JMSCMQ0001: WebSphere MQ call failed with compcode '2' ('MQCC_FAILED') reason '2397' ('MQRC_JSSE_ERROR' )
但是当我在我的代码中使用相同的配置值来建立 MQ 连接时,我能够建立连接
@Bean(name="MQConnectionFactory")
public ConnectionFactory connectionFactory() {
if (factory == null) {
factory = new MQConnectionFactory();
try {
factory.setConnectionNameList(env.getRequiredProperty(HOST));
factory.setPort(Integer.parseInt(env.getRequiredProperty(PORT)));
factory.setQueueManager(env.getRequiredProperty(QUEUE_MANAGER));
factory.setChannel(env.getRequiredProperty(CHANNEL));
factory.setTransportType(WMQConstants.WMQ_CM_CLIENT);
factory.setSSLCipherSuite(env.getRequiredProperty(SSL_CIPHER_SUITE));
factory.setStringProperty(WMQConstants.USERID, env.getRequiredProperty(QUEUE_USERID));
factory.setStringProperty(WMQConstants.PASSWORD, env.getRequiredProperty(QUEUE_PASSWORD));
} catch (JMSException e) {
throw new RuntimeException(e);
}
}
return factory;
}
我的问题是为什么连接在 Java 代码中工作,但在 jetty-env.xml 中配置时会引发 MQ 异常?
解决方案
推荐阅读
- networking - 是否在 OSI 模型的每一层添加/删除了标头?
- perl - 如何将转义的 t 转换为制表符
- javascript - 切换开关问题(将信息发送到 SQL 并在刷新页面后保持检查状态)
- excel - VBA如何在多列中搜索特定值并返回一个偏移单元格进行修改
- docker - 如何在 ubuntu docker 映像上安装手册页?
- ruby-on-rails - 提高服务器端数据表性能
- java - 如何防止用户调用公共注解方法
- c - 带有 dup2()-ed 描述符的 FILE * 流 — 标准输入不工作
- python - 我的 jupyter notebook 挑战 Python anytree 应用程序
- java - 了解 Springboot 中的 Cron,自动发送电子邮件