Welcome to MSDN Blogs Sign in | Join | Help

Jakub@Work

Programming with System Center Service Manager and Operations Manager
MMS Demo - Discovery and operational data insertion via SDK

I put together and presented a short demostration on the SDK at MMS on Monday. I think it went over well and was a short glimspe on some of the power of the SDK. I wanted to make my demo available so here it is. Let me know if there are any issues with it.

Posted: Wednesday, March 28, 2007 7:23 PM by JakubOleksy

Attachment(s): MMS2007.Demo.zip

Comments

stevewang said:

I have ran into some problems. I have my sdk client (remote to RMS) running for several times. Then I disconnected from the network before shutting down the client. Then everytime when I run the client again, it cause the ServerDisconnectedException

->The client has been disconnected from the server. Please call ManagementGroup.Reconnect() to reestablish the connection.

Through the stack trace, it points to this function:

ManagementGroup^ mg = gcnew ManagementGroup(host);

Question: How can I call reconnect without creating the ManagementGroup first?

How can I solve or get around the problem?

Thanks.

Steve

# April 5, 2007 6:36 PM

JakubOleksy said:

I am not sure I fully understand. If you client completely shuts down, upon restart creating a new ManagementGroup object fails? If this is the case, any errors in the event log on the RMS?

If you mean that while running your client begins to get these exceptions, then you need to call Reconnect on the ManagementGroup instance.

# April 5, 2007 6:44 PM

stevewang said:

The client is completely shut down, and the first call to new ManagementGroup fails. No event log errors on either RMS or client computer. I reinstalled RMS (delete DB), and the problem still exists. There must be something cached ... Here is the complete Exception.

Line 780 is where I first call new  ManagementGroup

ServerDisconnectedException->The cl

ient has been disconnected from the server. Please call ManagementGroup.Reconnec

t() to reestablish the connection.

    at Microsoft.EnterpriseManagement.DataAbstractionLayer.SdkDataAbstract

ionLayer.HandleIndigoExceptions(Exception ex)

  at Microsoft.EnterpriseManagement.DataAbstractionLayer.SdkDataAbstractionLaye

r.CreateChannel(TieredManagementGroupConnectionSettings managementGroupTier)

  at Microsoft.EnterpriseManagement.DataAbstractionLayer.SdkDataAbstractionLaye

r..ctor(DuplexChannelFactory`1 channelFactory, TieredManagementGroupConnectionSe

ttings managementGroupTier, IClientDataAccess callback, CacheMode cacheMode)

  at Microsoft.EnterpriseManagement.DataAbstractionLayer.SdkDataAbstractionLaye

r.CreateEndpoint(ManagementGroupConnectionSettings connectionSettings, IClientDa

taAccess clientCallback)

  at Microsoft.EnterpriseManagement.DataAbstractionLayer.SdkDataAbstractionLaye

r.Connect(ManagementGroupConnectionSettings connectionSettings)

  at Microsoft.EnterpriseManagement.ManagementGroup..ctor(String serverName)

  at Seamless.Connector.BmcScomConn.SCOMSDK_InitOne(Int32 index) in d:\sti\mom-

sim\product\2007\iiscomlib\iiscomlib.h:line 780

  at Seamless.Connector.BmcScomConn.SCOMSDK_Init() in d:\sti\mom-sim\product\20

07\iiscomlib\iiscomlib.h:line 821

# April 5, 2007 8:45 PM

JakubOleksy said:

Can you open the UI from this machine?

When you say you deleted the db, you just mean you uninstalled, deleted db and reinstalled, correct?

# April 5, 2007 9:29 PM

stevewang said:

The UI Console generates the same exception.

# April 5, 2007 10:07 PM

stevewang said:

I move my app to RMS, it runs ok there. There must be some cache on client computer.

# April 5, 2007 10:08 PM

stevewang said:

Uninstall/reinstall UI console on this computer does not solve the problem.

Yes uninstall RMS, delete directory, delete db, reinstall.

# April 5, 2007 10:14 PM

stevewang said:

Here is the exception from UI:

==========================================

Date: 4/5/2007 9:18:43 PM

Application: System Center Operations Manager 2007

Application Version: 6.0.5000.0

Severity: Error

Message: Failed to connect to server 'mom2sim2007'

Microsoft.EnterpriseManagement.Common.ServerDisconnectedException: The client has been disconnected from the server. Please call ManagementGroup.Reconnect() to reestablish the connection. ---> System.ServiceModel.CommunicationException: The server did not provide a meaningful reply; this might be caused by a contract mismatch, a premature session shutdown or an internal server error.

Server stack trace:

  at System.ServiceModel.Channels.ServiceChannel.Call(String action, Boolean oneway, ProxyOperationRuntime operation, Object[] ins, Object[] outs, TimeSpan timeout)

  at System.ServiceModel.Channels.ServiceChannel.Call(String action, Boolean oneway, ProxyOperationRuntime operation, Object[] ins, Object[] outs)

  at System.ServiceModel.Channels.ServiceChannelProxy.InvokeService(IMethodCallMessage methodCall, ProxyOperationRuntime operation)

  at System.ServiceModel.Channels.ServiceChannelProxy.Invoke(IMessage message)

Exception rethrown at [0]:

  at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg)

  at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type)

  at Microsoft.EnterpriseManagement.Common.ISessionManager.Connect(Boolean useCache)

  at Microsoft.EnterpriseManagement.DataAbstractionLayer.SdkDataAbstractionLayer.CreateChannel(TieredManagementGroupConnectionSettings managementGroupTier)

  --- End of inner exception stack trace ---

  at Microsoft.EnterpriseManagement.DataAbstractionLayer.SdkDataAbstractionLayer.HandleIndigoExceptions(Exception ex)

  at Microsoft.EnterpriseManagement.DataAbstractionLayer.SdkDataAbstractionLayer.CreateChannel(TieredManagementGroupConnectionSettings managementGroupTier)

  at Microsoft.EnterpriseManagement.DataAbstractionLayer.SdkDataAbstractionLayer..ctor(DuplexChannelFactory`1 channelFactory, TieredManagementGroupConnectionSettings managementGroupTier, IClientDataAccess callback, CacheMode cacheMode)

  at Microsoft.EnterpriseManagement.DataAbstractionLayer.SdkDataAbstractionLayer.CreateEndpoint(ManagementGroupConnectionSettings connectionSettings, IClientDataAccess clientCallback)

  at Microsoft.EnterpriseManagement.DataAbstractionLayer.SdkDataAbstractionLayer.Connect(ManagementGroupConnectionSettings connectionSettings)

  at Microsoft.EnterpriseManagement.ManagementGroup..ctor(ManagementGroupConnectionSettings connectionSettings)

  at Microsoft.EnterpriseManagement.ManagementGroup.Connect(ManagementGroupConnectionSettings connectionSettings)

  at Microsoft.EnterpriseManagement.Mom.Internal.UI.Common.ManagementGroupSessionManager.Connect(String server, String username, SecureString password, String domain)

  at Microsoft.EnterpriseManagement.Mom.Internal.UI.Console.ConsoleWindowBase.ConnectWithCredentials(Exception ex, ConsoleJobEventArgs args)

System.ServiceModel.CommunicationException: The server did not provide a meaningful reply; this might be caused by a contract mismatch, a premature session shutdown or an internal server error.

Server stack trace:

  at System.ServiceModel.Channels.ServiceChannel.Call(String action, Boolean oneway, ProxyOperationRuntime operation, Object[] ins, Object[] outs, TimeSpan timeout)

  at System.ServiceModel.Channels.ServiceChannel.Call(String action, Boolean oneway, ProxyOperationRuntime operation, Object[] ins, Object[] outs)

  at System.ServiceModel.Channels.ServiceChannelProxy.InvokeService(IMethodCallMessage methodCall, ProxyOperationRuntime operation)

  at System.ServiceModel.Channels.ServiceChannelProxy.Invoke(IMessage message)

Exception rethrown at [0]:

  at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg)

  at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type)

  at Microsoft.EnterpriseManagement.Common.ISessionManager.Connect(Boolean useCache)

  at Microsoft.EnterpriseManagement.DataAbstractionLayer.SdkDataAbstractionLayer.CreateChannel(TieredManagementGroupConnectionSettings managementGroupTier)

# April 5, 2007 10:21 PM

JakubOleksy said:

The only thing I can think of is that perhaps the UI is a different version than the server. Is everything RTM?

Also, have you tried this from another remote machine?

# April 6, 2007 3:34 AM

stevewang said:

I am using the eval version of SCOM (MMS2007).

The exception says "this might be caused by a contract mismatch, a premature session shutdown or an internal server error." I believe "a premature session shutdown" is the reason. But how come it becomes to a fatal error? I will try to find another machine to install UI. But I believe it will run OK.

# April 6, 2007 9:10 AM

JakubOleksy said:

How comfortable are you with debugging? =)

The problem here is that somewhere on the WCF stack we are getting an exception that is termintating the channel. This is happening either on the server or the client, but it is happening outside of any code that we own and thus is manifesting itself as a ServerDisconnectedException. Since we can't connect, it is effectively a fatal error.

# April 6, 2007 12:18 PM

dennis.rietvink said:

Hi,

We had the same problem. It turned out to be a corrupted DNS server in the environment that was causing an authentication failure.

Regards,

Dennis

# November 3, 2007 6:14 AM
Anonymous comments are disabled
Page view tracker