MQ 连接在 java maven 项目中失败 (2508) 但与 MQ7.5 Jar 配合良好

问题描述 投票:0回答:0

我有一个使用 com.ibm.mq JAR lib 版本 7.5.0.8 连接 MQ 7 的工作源。

private Hashtable<String, Object> mqProperties = new Hashtable<String, Object>();

mqProperties.put(MQConstants.HOST_NAME_PROPERTY, ip);
mqProperties.put(MQConstants.PORT_PROPERTY, port);
mqProperties.put(MQConstants.USER_ID_PROPERTY, username);
mqProperties.put(MQConstants.PASSWORD_PROPERTY, password);
mqProperties.put(MQConstants.CHANNEL_PROPERTY, channelName);
mqProperties.put(MQConstants.CCSID_PROPERTY, "1098");

queueManager = new MQQueueManager(queueManagerName, mqProperties);

没问题。我将我的连接源移植到 Maven 应用程序并使用最新版本的 MQ 访问库

<!-- https://mvnrepository.com/artifact/com.ibm.mq/com.ibm.mq.allclient -->
<dependency>
    <groupId>com.ibm.mq</groupId>
    <artifactId>com.ibm.mq.allclient</artifactId>
    <version>9.3.1.0</version>
</dependency>

同源无法连接并出现 2508 错误?我还应该做些什么来连接?我的环境是 Windows 10 和 MQ 7.5 on win 2008.

java maven connect mq
© www.soinside.com 2019 - 2024. All rights reserved.