0

I am running a jar file that access a COM interface using a batch file. When I run the jar directly using the batch file it works fine. But when I use NSSM to setup a service using that batch file, I cannot call functions on that COM interface. The jar still loads when I start the service and does other stuff, including loading the DLL that's calling the COM interface. However when the actual COM calls are made then the jar freezes. Any idea why? Could it be a permissions issue? The service was created under Admin account, and it is running under the same account as well.

Thanks!

highflyer
  • 303
  • 2
  • 5
  • 14
  • There are certain restrictions when running as a Windows Service. The first one that comes to mind is displaying UI. If you display UI, you will hang your service. Why not attach a debugger to the service and set breakpoints in the COM object? If you have Visual Studio, use it to debug. If not, you can download WinDbg or probably the community edition of Visual Studio to debug. – Joseph Willcoxson Feb 06 '15 at 20:27
  • @JoeWillcoxson I don't have a UI here. As for the DLL being loaded by my jar, I don't have the source for that. Will see if I can get hold of that and debug through Visual Studio. But if I can't get that, since I didn't write that myself, I was wondering if there were any limitations to what a windows service can do. – highflyer Feb 06 '15 at 20:38

1 Answers1

0

Even though they are run with the same credentials, your application and COM server are probably running in different sessions. Try launching the the COM server in Session 0 and see if that helps.

CoreTech
  • 2,345
  • 2
  • 17
  • 24