XData Windows Service

I am having trouble getting my XData Service running as a Windows Service. I am also unable to get one of the demo apps running as a Service. Acting on Wagner Landgrafs advice I added Sparkle.App as the first line in the XDataMultiModel demo app. I also removed TMainForm, then compiled as RELEASE. The app did install as a service but when trying to start it immediately stops. When running as a standard windows app I get an error telling me that the registration to http.sys has been duplicated. This does then run but obviously there is something wrong here.

I am new with XData and suspect that I am missing something basic?


Maybe you could reduce your project to a minimum or send a minimum project so we can try to guess what is going on?
When using a service, keep in mind that it runs under a different Windows user thus might have more restrictions (to file system, for example) and less permissions. So it really depends on what your code does.

Hopefully you received my emails, included the small demo project?

I really could do with some help here please. Maybe some hints for things I could check. I get the impression that running xdata as a Windows service is normally. So I am possibly missing something simple.

Any demo xdata Windows service project?

No, we haven't receive any project. Maybe you can attach it here? If you don't want it to be public, just add it as a private message:

I had emailed support. Never mind...

MultiModel.zip (56.0 KB)

Attached is the TMS MultiModel demo with my small changes. I have added Sparkle.App and removed references to frmMain. I installed as a service by running a cmd window as admin and using the /inslall parameter. The service appears in Services but when I try to start it I get a message saying the service has started and then stopped.

I checked the Event Log and found this

Service failed on start: Could not add the following Url to the server. Be sure that you have reserved the Url in Http.Sys with proper permissions. Url: http://+:2001/tms/default Error: Cannot create a file when that file already exists

I am unclear on the http.sys reservation and why this appears to be happening twice. Any assistance would be appreciated

1 Like

Remove the TSparkleHttpSysDispatcher component from your data module. When you use Sparkle.App unit, it already has its own dispatcher and starts it automatically. All you need in your app are the TXDataServer components.

Thanks for the response. The service is working well for me now.

1 Like

This topic was automatically closed 60 minutes after the last reply. New replies are no longer allowed.