java - 从远程服务器获取 channel 表文件

标签 java ftp ibm-mq

我正在尝试使用位于远程服务器中的 ccdt 文件设置 ccdturl。我尝试使用 ftp 设置 ccdt url,但没有成功。有谁知道在远程服务器中设置 ccdt 文件 url 的正确方法是什么? 谢谢!

我尝试过:

String channelTablePath = "ftp://user@host:/path-to-ccdt-file";
Url url = new URL(channelTablePath );
connectionFactory.setCCDTURL(url); 

我得到的错误是:

Exception in thread "main" javax.jms.JMSException: JMSWMQ2020: Failed to connect                                                                                              to queue manager '*QQ' with connection mode 'Client' and supplied CCDT URL 'ftp://user@host:/path/ccdt.tab',                                                                                              see linked exception for more information.
JMS Error code: com.ibm.mq.MQException: JMSCMQ0001: WebSphere MQ call failed with compcode '2' ('MQCC_FAILED') reason '2278' ('MQRC_CLIENT_CONN_ERROR').
EXPLANATION:
The filesystem returned error code 'java.net.ConnectException[Connection timed
out]' for file 'ftp://user@host:/path/ccdt.tab'.
ACTION:
Record the name of the file 'ftp://user@host:/path/ccdt.tab'
and tell the systems administrator, who should ensure that file 'ftp://user@host:/path/ccdt.tab'
is correct and available.

最佳答案

摘要:

URL 中的主机后面不应有冒号 (:)。如果需要,您应该在 URL 中指定密码值。您还需要指定 ccdt 文件的名称。本答案末尾引用了 IBM 知识中心。

尝试使用以下值:

String channelTablePath = "ftp://user:pass@host/path-to-ccdt-file/AMQCLCHL.TAB";
<小时/>

IBM MQ v9 知识中心页面“Using a client channel definition table with IBM MQ classes for JMS”指出:

As another example, suppose the file ccdt2.tab contains a client channel definition table and is stored on a system that is different from the one on which the application is running. If the file can be accessed using the FTP protocol, the application can set the CCDTURL property in the following way:

java.net.URL chanTab2 = new URL("ftp://ftp.server/admdata/ccdt2.tab");
factory.setCCDTURL(chanTab2);
<小时/>

IBM MQ v9 知识中心页面“Web addressable access to the client channel definition table”显示了带有用户名和密码的 FTP URL 示例:

Authenticated connections

export MQCHLLIB=ftp://myuser:password@myhost.sample.com/var/mqm/qmgrs/QMGR/@ipcc
export MQCHLLIB=http://myuser:password@myhost.sample.com/var/mqm/qmgrs/QMGR/@ipcc

...

Note

If you want to use authenticated connections you must, as with JMS, provide the user name and password encoded in the URL.

关于java - 从远程服务器获取 channel 表文件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48588673/

相关文章:

java - JNI - 找不到 native 库

java - Eclipse 在同一行打开大括号?

python - ftplib.FTP 超时具有不一致的行为

java - Spring 集成: Allocate Space when sending file to FTP

python - 连接到 FTP 后删除所有文件和文件夹

jms - 如何为 JMS 消息设置 Content-Type header

esb - 在 DEV、QA 和 PROD 环境之间移动 IBM Message Broker 组件的最佳方法是什么?

java - 如何在没有 Jms session 对象的情况下复制 javax.jms.TextMessage

java - 在哪里可以找到 javax.crypto 源代码?

java - 以编程方式失败的 Maven 测试 JUnit5 测试