17

WildFly provides a service.bat in %WILDFLY_HOME%\bin\service. Calling the batch file with the install parameter installs WildFly as a service on Windows.

I have made changes to the standalone.conf and need to use the standalone-full.xml in my setup. Hence, I would like to start the WildFly service with these parameters on Windows. Is it possible? How do I do it?

Sevan
  • 510
  • 1
  • 4
  • 17
fatdevelops
  • 425
  • 1
  • 6
  • 17
  • 1
    Just to mention that starting from 10th it is located in `\wildfly-11.0.0.Final\docs\contrib\scripts\service` – Dima Fomin Dec 05 '18 at 09:02

4 Answers4

12

Yes, It is possible. You should only change SERVER_OPTS variable on standalone.bat file. In addition, you do not have to make changes on standalone.conf.

Put below line and try again.

set "SERVER_OPTS=--server-config=standalone-full.xml"
Sevan
  • 510
  • 1
  • 4
  • 17
4

Just create the service with the command service.bat install /config standalone-full.xml

Bjørn Stenfeldt
  • 1,170
  • 1
  • 15
  • 21
  • In WildFly 10 this option is no longer available: `ERROR: Unrecognised option: /config` – mjn42 May 26 '17 at 11:26
  • 1
    It is. I used the above while upgrading from Wildfly 8 to 10. Just now I checked service.bat and the /config command is still in there. There must be another problem. – Bjørn Stenfeldt May 29 '17 at 06:38
  • 1
    Solved: my WildFly 10.1 download was corrupt, it works now with NetBeans 10.1. Many thanks for the hint! – mjn42 May 29 '17 at 12:28
  • Not available in WildFly 8.2.1 – Grim Dec 11 '18 at 12:31
1

When running WildFly standalone server as a Windows service, service install registers start command standalone.bat with no option.

By default, standalone.bat loads standalone.conf.bat, and not standalone.conf which is designed to Unix platforms.

It is possible to load a specific standalone.conf.bat file setting environment variable STANDALONE_CONF with its path. There, it is possible to set JAVA_OPTS options but not server options.

To avoid to edit WildFly release standalone.bat file, I recommend to create a copy of bin/service/service.bat as bin/service/service-myproject.bat where you can adapt start parameters and add --server-config:

set STARTPARAM="/c \"set NOPAUSE=Y ^^^&^^^&
    standalone.bat --server-config=standalone-full.xml\""

At the same time, this specific service-myproject.bat allows you to tune your service installation with SHORTNAME, DISPLAYNAME and DESCRIPTION variables.

Do not forget to invoke service-myproject.bat with both /user and /password options so that the service is allowed to cleanly stop your instance with granted administrative user.

Yves Martin
  • 9,755
  • 2
  • 32
  • 74
1

If you are using a Windows machine and have set Environment variable for Wildfly, goto command prompt and type the following command.

standalone.bat -c standalone-full.xml

This should start wildfly in the standalone-full configuration.