从远程服务器获取频道 table 文件
Get channel table file from remote server
我正在尝试使用位于远程服务器中的 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.
我正在尝试使用位于远程服务器中的 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.