我正在尝试使用位于远程服务器中的 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/