Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to start WildFly as a service with standalone-full.xml?

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?

like image 746
fatdevelops Avatar asked Mar 04 '15 12:03

fatdevelops


4 Answers

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"
like image 63
Sevan Avatar answered Sep 19 '22 14:09

Sevan


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

like image 31
Bjørn Stenfeldt Avatar answered Sep 19 '22 14:09

Bjørn Stenfeldt


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.

like image 23
nihal Avatar answered Sep 17 '22 14:09

nihal


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.

like image 21
Yves Martin Avatar answered Sep 18 '22 14:09

Yves Martin