SomeRandom
SomeRandom

Reputation: 21

Cannot locate .xml file using WinSW to start windows service

I am trying to use Winsw to make my jar file run as a windows service. I rely on the documentation in order to do so.

To install a service, it is specified that the command winsw install myapp.xml should be used. The problem is that when I do that I get the error :

> Winsw.exe install myapp.xml
2022-11-15 12:24:46,791 FATAL - Unhandled exception
System.IO.FileNotFoundException: Unable to locate Winsw.[xml|yml] file within executable directory
   at WinSW.Program.LoadConfigAndInitLoggers(Boolean inConsoleMode)
   at WinSW.Program.Run(String[] argsArray, IServiceConfig config)
   at WinSW.Program.Main(String[] args)

it expects the XML/YML to have the same name, when I rename the XML file it works fine, but I do not want to rename it as I want to use the same .exe file in order to start multiple services.

I tried to launch the different commands of install/uninstall, they all react the same.

Any Ideas ?

Upvotes: 2

Views: 1211

Answers (1)

bruaba
bruaba

Reputation: 1

I had the same problem to solve it, your WinSW.exe and the xml file have to go to the name (so name it WinSW.xml) and they have to be in the same folder too. Reference: Based on official documentation https://github.com/winsw/winsw/blob/master/doc/installation.md And this GitHub post https://github.com/winsw/winsw/issues/970

Upvotes: 0

Related Questions