2017-08-07 3 views
1

MQ Java PCF APIを使用してMQインストールから情報を取得しています。 PCFMessageAgentクラスにはいくつかのコンストラクタがあります。ホスト、ポート、およびチャネル名を受け入れるものがあります。私はドキュメンテーションの抜粋を示しました。PCFを使用してチャネル情報を取得しようとすると、MQRC_NOT_AUTHORIZEDエラーが発生するのはなぜですか?

公共PCFMessageAgent(文字列のホスト、 int型ポート、 文字列のチャネル) はMQException 初期化にキューマネージャへのクライアント接続を使用して新しいPCFMessageAgentをスローします。
私が持っているコードは

PCFMessageAgent agent = new PCFMessageAgent(host, port, "SYSTEM.DEF.SVRCONN"); 
    PCFMessage pcfCmd = new PCFMessage(MQConstants.MQCMD_INQUIRE_CHANNEL); 
    pcfCmd.addParameter(MQConstants.MQCACH_CHANNEL_NAME, channelName); 
    PCFMessage[] pcfResponse = agent.send(pcfCmd); 

ですが、私はこのエラーが出るのはなぜ

Exception in thread "main" com.ibm.mq.MQException: MQJE001: Completion Code '2', Reason '2035'. 
    at com.ibm.mq.MQManagedConnectionJ11.<init>(MQManagedConnectionJ11.java:249) 
    at com.ibm.mq.MQClientManagedConnectionFactoryJ11._createManagedConnection(MQClientManagedConnectionFactoryJ11.java:450) 
    at com.ibm.mq.MQClientManagedConnectionFactoryJ11.createManagedConnection(MQClientManagedConnectionFactoryJ11.java:487) 
    at com.ibm.mq.StoredManagedConnection.<init>(StoredManagedConnection.java:97) 
    at com.ibm.mq.MQSimpleConnectionManager.allocateConnection(MQSimpleConnectionManager.java:194) 
    at com.ibm.mq.MQQueueManagerFactory.obtainBaseMQQueueManager(MQQueueManagerFactory.java:868) 

MQRC_NOT_AUTHORIZEDエラーが出ますか?これをどのように修正するのですか?

エラーログにこれが見つかりました。どんな助けでも大歓迎です。

07/08/17 15:42:51 - Process(3294.15) User(user1) Program(amqrmppa) 
        Host(ubuntuvm-2) Installation(Installation1) 
        VRMF(8.0.0.7) QMgr(QM_FR2_2) 

AMQ9777: Channel was blocked 

EXPLANATION: 
The inbound channel 'SYSTEM.DEF.SVRCONN' was blocked from address 
'192.168.56.101' because the active values of the channel matched a record 
configured with USERSRC(NOACCESS). The active values of the channel were 
'CLNTUSER(user1)'. 
ACTION: 
Contact the systems administrator, who should examine the channel 
authentication records to ensure that the correct settings have been 
configured. The ALTER QMGR CHLAUTH switch is used to control whether channel 
authentication records are used. The command DISPLAY CHLAUTH can be used to 
query the channel authentication records. 
----- cmqxrmsa.c : 1462 ------------------------------------------------------- 
07/08/17 15:42:51 - Process(3294.15) User(user1) Program(amqrmppa) 
        Host(ubuntuvm-2) Installation(Installation1) 
        VRMF(8.0.0.7) QMgr(QM_FR2_2) 

AMQ9999: Channel 'SYSTEM.DEF.SVRCONN' to host '192.168.56.101' ended 
abnormally. 

EXPLANATION: 
The channel program running under process ID 3294 for channel 
'SYSTEM.DEF.SVRCONN' ended abnormally. The host name is '192.168.56.101'; in 
some cases the host name cannot be determined and so is shown as '????'. 
ACTION: 
Look at previous error messages for the channel program in the error logs to 
determine the cause of the failure. Note that this message can be excluded 
completely or suppressed by tuning the "ExcludeMessage" or "SuppressMessage" 
attributes under the "QMErrorLog" stanza in qm.ini. Further information can be 
found in the System Administration Guide. 
----- amqrmrsa.c : 930 -------------------------------------------------------- 

答えて

1

問題は、チャネルSYSTEM.DEV.SVRCONNに接続しようとしていることです。デフォルトでは​​3210という名前のチャンネルへのアクセスをブロックするCHLAUTHルールがあります。

SYSTEMで始まる名前を持たない新しいSVRCONNチャネルを作成すると、このチェックを過ぎることになります。

+0

@Ajayこれは問題を解決するのに役立ちましたか?参考になった場合は、「[誰かが私の質問に答えるとどうすればいいですか?](https://stackoverflow.com/help/someone-answers)」を参照してください。あなたが役に立つと思ったら、特に投票を受け入れてください。 – JoshMc

+0

@Ajay、あなたが気づいていない場合、回答を受け入れるには、答えの左側にある下向きの矢印の下にある灰色のチェックマークをクリックします。 – JoshMc

関連する問題