我正在运行以下代码:
ManagementClass oMClass = new ManagementClass("Win32_NetworkAdapterConfiguration");
ManagementObjectCollection colMObj = oMClass.GetInstances();
Run Code Online (Sandbox Code Playgroud)
这是抛出这个异常:
System.Management.ManagementException: Not found
at System.Management.ThreadDispatch.Start()
at System.Management.ManagementScope.Initialize()
at System.Management.ManagementObject.Initialize(Boolean getObject)
at System.Management.ManagementClass.GetInstances(EnumerationOptions options)
at System.Management.ManagementClass.GetInstances()
Run Code Online (Sandbox Code Playgroud)
我去检查 Windows XP 上正在运行的服务,发现 Windows Management Instrumentation 服务的状态为“已启动”。我尝试重新启动服务,但这没有任何好处。然后我尝试使用 ServiceController 类从我正在运行的代码中获取此服务的状态:
ServiceController wpiService = new ServiceController();
wpiService.ServiceName = "Winmgmt";
string wmiStatus = wpiService.Status.ToString();
MessageBox.Show("WMI status= " + wmiStatus);
Run Code Online (Sandbox Code Playgroud)
wmiStatus 评估为“正在运行”。
我只在运行相同软件的多台机器中的一台上看到过这个错误。奇怪的是,机器运行了几个月,然后突然开始显示这个错误。
关于可能导致这种情况的任何线索?
我正在从Apache Axis 1.4 Java客户端调用Web服务.呼叫正确到达服务器,但客户端在大约几分钟后抛出此异常:
AxisFault
faultCode: {http://schemas.xmlsoap.org/soap/envelope/}Server.userException
faultSubcode:
faultString: org.xml.sax.SAXParseException: XML document structures must start and end within the same entity.
faultActor:
faultNode:
faultDetail:
Run Code Online (Sandbox Code Playgroud)
例外情况并不总是一样的.有时它会在响应中指定一个特定元素:
AxisFault
faultCode: {http://schemas.xmlsoap.org/soap/envelope/}Server.userException
faultSubcode:
faultString: org.xml.sax.SAXParseException: The element type "name" must be terminated by the matching end-tag "</name>".
faultActor:
faultNode:
faultDetail:
Run Code Online (Sandbox Code Playgroud)
我正在进行的Web服务调用返回大量数据.如果我将服务器配置为返回较少的数据,则呼叫成功完成.
注意:虽然我没有得到任何客户端超时异常,但我尝试将超时值增加到五分钟,但这没有任何效果.