2012-03-15 5 views
0

대기열에 메시지를 작성해야하는 VB.NET 콘솔 응용 프로그램 (메인 프레임에 있음)이 있습니다. 우리는 모든 클러스터링과 모든 설정을 관리자가 수행합니다. 이미 성공적으로 메시지를 수신하고 여러 큐에 메시지를 쓰는 기존 Windows 서비스가 이미 있습니다..NET에서 MQ에 액세스 할 때 오류가 발생했습니다.

기본적으로 Windows 서비스 프로젝트에서 내 코드의 대부분을 다시 사용했습니다.

그러나 큐 관리자에 액세스하려고하면 "MQRC_HOST_NOT_AVAILABLE"예외가 발생합니다. Websphere MQ 폴더의 오류 로그는

AMQ9213: A communications error for occurred. 
EXPLANATION: 
An unexpected error occurred in communications. 
ACTION: 
The return code from the call was 0 (X'0'). Record these values and tell the systems administrator. 

입니다. 다음은 완전한 예외 스택입니다.

IBM.WMQ.MQException was unhandled 
Message="MQRC_HOST_NOT_AVAILABLE" 
Source="amqmdnet" 
StackTrace: 
    at IBM.WMQ.MQBase.throwNewMQException() 
    at IBM.WMQ.MQQueueManager.Connect(String queueManagerName) 
    at IBM.WMQ.MQQueueManager..ctor(String queueManagerName) 
    at LPMQtoClarify.Module1.Main() in D:\LPDEV\Developers\X173036_Santhanam\LPMQtoClarify\LPMQtoClarify\Module2.vb:line 47 
    at System.AppDomain.nExecuteAssembly(Assembly assembly, String[] args) 
    at System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args) 
    at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly() 
    at System.Threading.ThreadHelper.ThreadStart_Context(Object state) 
    at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state) 
    at System.Threading.ThreadHelper.ThreadStart() 

여기 내 코드의 일부입니다. 예외는 다음 줄에서 발생합니다.

QueueManager = New MQQueueManager(TransParmRec.MQManager) 

도움이 되었습니까? 감사.

Dim pos As Integer = 3 
Dim clarifyReturnCode As Integer = 0 
Dim clarifyRequestMessage As String = String.Empty 

Dim QueueManager As MQQueueManager 
clarifyQLauncherName = ConfigurationManager.AppSettings.[Get]("MQ_CLARIFY_REQUEST_Q") 


Dim initRetCode As Integer = 0 
Dim errorMessage As String = "" 
initRetCode = GetTransInfo(TransParmRec, dbConnectionString, errorMessage) 


MQEnvironment.Hostname = TransParmRec.MQHostName 
MQEnvironment.Channel = TransParmRec.MQChannel 

If TransParmRec.PortNumber.ToString().Length > 0 Then 
    MQEnvironment.Port = Convert.ToInt32(TransParmRec.PortNumber) 
End If 
If TransParmRec.SecExit.ToString().Length > 0 Then 
    MQEnvironment.SecurityExit = TransParmRec.SecExit 
End If 


QueueManager = New MQQueueManager(TransParmRec.MQManager) 
Using sw As New StreamWriter("C:\FCLARIFYMQ.REQ", True) 
    If QueueManager Is Nothing Then 
     sw.WriteLine("Queue Manager is null") 
    Else 
     sw.WriteLine("Queue Manager is not null") 

    End If 
End Using 
+0

'이 값을 기록하고 시스템 관리자에게 ' –

답변

0

호스트 이름 또는 포트 번호를 다시 확인하십시오. 호스트 이름 또는 포트 번호가 유효하지 않으면 MQRC_HOST_NOT_AVAILABLE이 리턴됩니다.

0

다른 사용자 계정으로 응용 프로그램을 실행할 때 코드가 작동했습니다. MQ 권한은 admin 계정과 다른 사용자 계정에 대해 설정됩니다.

관련 문제