2016-06-10 2 views
0

때 (I 로컬 설정 서버가) 바인딩 모드에서 MQ에 연결을 시도, 나는 다음과 같은 예외가 얻을 :'IBM.WMQ.Nmqi.BindingsNmqiMQ'의 형식 이니셜 라이저에서 예외를 Throw

System.TypeInitializationException: The type initializer for 'IBM.WMQ.Nmqi.BindingsNmqiMQ' threw an exception. ---> System.NullReferenceException: Object reference not set to an instance of an object. 
    at IBM.WMQ.Nmqi.NativeManager.InitializeNativeApis(String mode) 
    at IBM.WMQ.Nmqi.BindingsNmqiMQ..cctor() 
    --- End of inner exception stack trace --- 
    at System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor) 
    at System.Reflection.RuntimeConstructorInfo.Invoke(BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture) 
    at System.RuntimeType.CreateInstanceImpl(BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes, StackCrawlMark& stackMark) 
    at System.Activator.CreateInstance(Type type, BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes) 
    at System.Reflection.Assembly.CreateInstance(String typeName, Boolean ignoreCase, BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes) 
    at IBM.WMQ.Nmqi.NmqiEnvironment.GetInstance(String name) 
    at IBM.WMQ.Nmqi.NmqiEnvironment.GetMQI(Int32 id) 
    at IBM.WMQ.MQQueueManager.Connect(String queueManagerName) 
    at IBM.WMQ.MQQueueManager..ctor(String queueManagerName, Hashtable properties) 
    at Project.MQConnector.CreateConnectAndAddQueueManager(QueueManagerConnectionDetails connDetails) 

생성자 : 다음 큐 관리자에 연결할 때

오류가 발생 connDetails가 P에 대해 단지 가게

Friend queueManagerConnectionProperties As New Hashtable() 
queueManagerConnectionProperties.Add(MQC.THREAD_AFFINITY_PROPERTY, True) 
If My.Settings.MQConnectAsClient Then 
    queueManagerConnectionProperties.Add(MQC.TRANSPORT_PROPERTY, MQC.TRANSPORT_MQSERIES_CLIENT) 
Else 
    queueManagerConnectionProperties.Add(MQC.TRANSPORT_PROPERTY, MQC.TRANSPORT_MQSERIES_BINDINGS) 
End If 

queueManagerConnectionProperties.Add(MQC.CONNECT_OPTIONS_PROPERTY, MQC.MQCNO_HANDLE_SHARE_BLOCK Or MQC.MQCNO_RECONNECT_Q_MGR) ' have handle-sharing with call blocking 

그리고 CreateConnectAndAddQueueManager 방법에서

(ORT, 호스트 이름, 등)

Dim specificQMConnProperties As Hashtable = CType(queueManagerConnectionProperties.Clone(), Hashtable) 
specificQMConnProperties.Add(MQC.CHANNEL_PROPERTY, connDetails.Channel) 
specificQMConnProperties.Add(MQC.CONNECTION_NAME_PROPERTY, connectionName) 
Dim qmgr As MQQueueManager = Nothing 

Try 
    qmgr = New MQQueueManager(connDetails.Name, specificQMConnProperties) 
Catch ex As MQException 
    ' error handling 
End Try 

I는 다음과 같은 환경 변수를 가지고

NMQ_MQ_LIB=mqm.dll 

하면 I가 접속 관리 (NMQ_MQ_LIB=managed를 사용하여 연결; MQC.TRANSPORT_PROPERTY을 설정하지 않으면 정상적으로 작동합니다.

의견이 있으십니까? 최근 코멘트 보면

--Edit--

C:\Program Files\IBM\MQSI\9.0.0.2>dspmqver -a 
Name:  WebSphere MQ 
Version:  7.5.0.6 
Level:  p750-006-160226 
BuildType: IKAP - (Production) 
Platform: WebSphere MQ for Windows 
Mode:  32-bit 
O/S:   Windows 7 Enterprise x64 Edition, Build 7601: SP1 
InstName: Installation1 
InstDesc: 
Primary:  No 
InstPath: C:\Program Files (x86)\IBM\WebSphere MQ 
DataPath: C:\Program Files (x86)\IBM\WebSphere MQ 
MaxCmdLevel: 750 
LicenseType: Production 
AMQ8351: WebSphere MQ Java environment has not been configured correctly. 
AMQ8351: WebSphere MQ Java environment has not been configured correctly. 

Name:  IBM WebSphere MQ custom channel for Windows Communication Foundation 
Version:  7.5.0.6 
Level:  wn750-006-151116 
Build Type: Production 


Name:  IBM Message Service Client for .NET (XMS .NET) 
Version:  2.5.0.6 
Level:  nn250-006-151116 
Build Type: Production 


Name:  IBM Global Security Kit for WebSphere MQ 
Version:  8.0.14.53 
Build Type: Production 
Mode:  32-bit 

Name:  IBM Global Security Kit for WebSphere MQ 
Version:  8.0.14.53 
Build Type: Production 
Mode:  64-bit 
+0

전체 MQ 클라이언트가 설치되었거나 amqmdnet.dll로만 실행되고 있습니까? – Shashi

+0

전체 MQ가 설치되어 있습니다 (특히, 7.5.0.6 - IIB 툴킷과 함께 제공되는 7.5.0.1에서 업그레이드 됨) – simonalexander2005

+0

내가 설치 한 항목을 좀 더 구체적으로 확인할 수 있다면 도움이 될 수 있습니다. – simonalexander2005

답변

1

. GAC에 원하지 않는 항목이 있습니다. 당신은 정리를해야합니다.

1) 명령 프롬프트를 엽니 다.

2) amqiregisterdotnet.cmd /u 명령을 실행하여 MQ .NET 어셈블리의 등록을 취소합니다.

3) Windows GAC에서 MQ .NET 어셈블리를 확인하십시오. MQ .NET 항목이 없는지 확인하십시오. 어떤 것이 있으면 gacutil 명령을 사용하여 수동으로 등록 해제하십시오.

4) 그런 다음 amqiregisterdotnet.cmd 명령을 실행하여 어셈블리를 다시 등록하십시오.

희망이 도움이됩니다.

+0

IIB 통합 콘솔에서 다음 명령을 실행하면 다음 오류가 발생합니다. "C : \ Windows \ WinSxS \ x86_microsoft.vb80.mfc_1fc8b3b9a1e183eb_8.0.50727.6195_none_cbf5e994470a1a8f \ MCF80U.dll이 Windows에서 실행되도록 설계되지 않았습니다. 원본 설치 미디어를 사용하여 프로그램을 다시 설치하거나 메시지 상자 헤더에 amqidnet.exe에 대한 지원 " – simonalexander2005

+0

"을 시스템 관리자 또는 소프트웨어 공급 업체에 문의하십시오. 5 ~ 6 번 나타납니다. – simonalexander2005

+0

잘못된 명령을 사용하고 있습니다. 위에서 언급 한 것처럼 amqiregisterdotnet.cmd 명령을 실행해야합니다. – Shashi

관련 문제