Aaron Lahman - MSFT

I'm attempting to start a service with an "initial state partner", in order to specify some start-time initialization parameters (such as serial port, baud rate, robot hardware configuration, etc.). When starting up, there are no errors appearing in either the console nor the "debug and trace messages" view in the browser. However, i notice the following debug output showing up in Visual Studio:

A first chance exception of type 'System.ArgumentOutOfRangeException' occurred in DssBase.dll

Code Snippet

* Manifest load complete [04/15/2007 13:06:01][http://devbox:50000/manifestloaderclient]

A first chance exception of type 'System.NullReferenceException' occurred in DssRuntime.dll

*** "TaskExecutionWorker:HandleException": Exception:System.NullReferenceException: Object reference not set to an instance of an object.

at Microsoft.Dss.Services.Forwarders.Dssp.DsspForwarder.CreateRequestForwarder(CreateDsspOperationForwarder msg)

at Microsoft.Ccr.Core.Task`1.Execute()

at Microsoft.Ccr.Core.TaskExecutionWorker.ExecuteTaskHelper(ITask currentTask)

at Microsoft.Ccr.Core.TaskExecutionWorker.ExecuteTask(ITask& currentTask, DispatcherQueue p)

at Microsoft.Ccr.Core.TaskExecutionWorker.ExecutionLoop()

The call stack for the ArgumentOutOfRangeException is:

Code Snippet
> DssBase.dll!Microsoft.Dss.Core.ServiceBase.ResolveUri(Microsoft.Dss.Core.ServiceEnvironment environment = {Microsoft.Dss.Core.ServiceEnvironment}, System.Uri uri = {file:///D:/User/msrs/robot1/MotorService/Manifests/Robot1.config.Motor.Left.xml}) + 0xd5 bytes
DssRuntime.dll!Microsoft.Dss.Services.Forwarders.Dssp.DsspForwarder.CreateRequestForwarder(Microsoft.Dss.Services.Forwarders.Dssp.CreateDsspOperationForwarder msg = {Microsoft.Dss.Services.Forwarders.Dssp.CreateDsspOperationForwarder}) + 0xb8 bytes
Ccr.Core.dll!Microsoft.Ccr.Core.Task.Execute() + 0x2e bytes
Ccr.Core.dll!Microsoft.Ccr.Core.TaskExecutionWorker.ExecuteTaskHelper(Microsoft.Ccr.Core.ITask currentTask = {Microsoft.Dss.Services.Forwarders.Dssp.DsspForwarder:CreateRequestForwarder}) + 0x8b bytes
Ccr.Core.dll!Microsoft.Ccr.Core.TaskExecutionWorker.ExecuteTask(ref Microsoft.Ccr.Core.ITask currentTask = {Microsoft.Dss.Services.Forwarders.Dssp.DsspForwarder:CreateRequestForwarder}, Microsoft.Ccr.Core.DispatcherQueue p = {Microsoft.Ccr.Core.DispatcherQueue}) + 0x5e bytes
Ccr.Core.dll!Microsoft.Ccr.Core.TaskExecutionWorker.ExecutionLoop() + 0xff bytes
mscorlib.dll!System.Threading.ThreadHelper.ThreadStart_Context(object state) + 0x3b bytes
mscorlib.dll!System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, object state) + 0x81 bytes
mscorlib.dll!System.Threading.ThreadHelper.ThreadStart() + 0x40 bytes


The call stack for the NullReferenceException is:

Code Snippet
> DssRuntime.dll!Microsoft.Dss.Services.Forwarders.Dssp.DsspForwarder.CreateRequestForwarder(Microsoft.Dss.Services.Forwarders.Dssp.CreateDsspOperationForwarder msg = {Microsoft.Dss.Services.Forwarders.Dssp.CreateDsspOperationForwarder}) + 0x1ab bytes
Ccr.Core.dll!Microsoft.Ccr.Core.Task.Execute() + 0x2e bytes
Ccr.Core.dll!Microsoft.Ccr.Core.TaskExecutionWorker.ExecuteTaskHelper(Microsoft.Ccr.Core.ITask currentTask = {Microsoft.Dss.Services.Forwarders.Dssp.DsspForwarder:CreateRequestForwarder}) + 0x8b bytes
Ccr.Core.dll!Microsoft.Ccr.Core.TaskExecutionWorker.ExecuteTask(ref Microsoft.Ccr.Core.ITask currentTask = {Microsoft.Dss.Services.Forwarders.Dssp.DsspForwarder:CreateRequestForwarder}, Microsoft.Ccr.Core.DispatcherQueue p = {Microsoft.Ccr.Core.DispatcherQueue}) + 0x5e bytes
Ccr.Core.dll!Microsoft.Ccr.Core.TaskExecutionWorker.ExecutionLoop() + 0xff bytes
mscorlib.dll!System.Threading.ThreadHelper.ThreadStart_Context(object state) + 0x3b bytes
mscorlib.dll!System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, object state) + 0x81 bytes
mscorlib.dll!System.Threading.ThreadHelper.ThreadStart() + 0x40 byte

s

The following is the current manifest I am using to launch my service:

Code Snippet

< xml version="1.0" encoding="utf-8" >
<Manifest
xmlns="http://schemas.microsoft.com/xw/2004/10/manifest.html"
xmlns:dssp="http://schemas.microsoft.com/xw/2004/10/dssp.html">
<CreateServiceList>
<ServiceRecordType>
<dssp:Contract>http://schemas.tempuri.org/2007/04/robot1/motor.html</dssp:Contract>
<dssp:PartnerList>
<dssp:Partner>
<dssp:Service>Robot1.config.Motor.Left.xml</dssp:Service>
<dssp:Name>dssp:StateService</dssp:Name>
</dssp:Partner>
</dssp:PartnerList>
<Name>LeftMotor</Name>
</ServiceRecordType>
</CreateServiceList>
</Manifest>

Thoughts

#aaron



Re: Microsoft Robotics - Decentralized Software Services (DSS) InitialStatePartner related errors

Aaron Lahman - MSFT

Some additional information:

Durring the call to ServiceBase.ResolveUri, environment.TransportTable only has two entries:

- _transportTable Count = 2 System.Collections.Generic.Dictionary<string,Microsoft.Ccr.Core.IPort>
+ [0] {[dssp.tcp, Microsoft.Dss.Services.Transports.TransportPort]} System.Collections.Generic.KeyValuePair<string,Microsoft.Ccr.Core.IPort>
+ [1] {[http, Microsoft.Dss.Services.Transports.TransportPort]} System.Collections.Generic.KeyValuePair<string,Microsoft.Ccr.Core.IPort>
+ Raw View

The entries appear for "dssp.tcp" string and "http" string. However, the uri.Scheme in this case is "file":

+ uri {file:///D:/User/msrs/robot1/MotorService/Manifests/Robot1.config.Motor.Left.xml} System.Uri

Is there perhaps something wrong with how the





Re: Microsoft Robotics - Decentralized Software Services (DSS) InitialStatePartner related errors

Aaron Lahman - MSFT

Answering my own question -- it appears that the same issue occurs with even the sample projects (Parallax.BoeBox.manifest.xml in this case). If you launch this manifest from samples\Config, no problem occurs.

However, if you copy the config folder to d:\tmp, you will get this error. Additionally, if you copy to c:\tmp (same drive as MSRS is installed to) you will not get an error appearing on the command prompt, but will get an error showing up under the debugger -- access violation (NullReferenceException), followed by some debug messages, as i had enumerated earlier.

To resolve this issue, i've found you can do one of the following:

1) remove the StateService partner from your manifest (ie, no initialization occuring)

2) migrate your project and build environment to be the MSRS program installation folder (ie, "C:\Microsoft Robotics Studio 1.5 (CTP April 2007)")

3) add a binplace step to your project to copy your manifests and config files to "C:\Microsoft Robotics Studio 1.5 (CTP April 2007)\bin\config", and modify your project's startup settings to reference the copy in this folder as a parameter to dsshost.exe.

I would encourage option 3: Getting the files to binplace here is easy in VS. Projects generated by dssnewservice.exe will binplace to c:\microsoft...\bin automatically. Just create a folder in your project titled "config", and place all your manifests and config files there. Then, for each file, modify its properties and change "do not copy" to "copy if newer". This should copy your manifests and config file to (output)\config -- in this case, c:\microsoft...\bin\config. Then, in project settings, change the command line parameters passed to dsshost.exe (see debug tab). Change the manifest path to "bin\config\[your manifest name].xml". But remember, the binplace settings has to be set on each config file, not just one.

I hope this assists anyone else who runs into this problem. Happy coding.

#aaron





Re: Microsoft Robotics - Decentralized Software Services (DSS) InitialStatePartner related errors

George Chrysanthakopoulos

this is (as usuall) more of a lack of documentation issue: We actually dont allow file loading from anywhere other than root directory (the parent of the \bin directory dsshost.exe runs from, not just our install) and all its child directories. This creates a sandbox. Your state files dont have to be in config, just somewhere under your install directory.

Also all URIs must be either DSSp.TCP or HTTP. Our MountPoint manager will take care of redirecting an HTTP uri to a file, if your URI is indeed a file. Furthermore, your URIs, dont have to be fully qualified.

You can just put relative URIs or just the filename as is, if its in the same directory as the manifest.

To Summarize:

1) Dss exposes all files as HTTP uris, they just have to be under the root directory (parent of bin\ where dsshost runs)

2) a uri of http://localhost/mountpoint/config/mystate.xml will point to (root install dir)\config\mystate.xml. Basically http://localhost/mountpoint, is the root directory, as an HTTP uri

3) Use relative URIs to the manifest. If your manifest is in \samples\config and your state file is in samples\config, all you need to do say in the partner is "mystate.xml"

4) Only use http:// schemes for your URIs, file:// is not supported

thanx

g