Disable Hazelcast for payara-embedded-web-5.181.jar

192 views
Skip to first unread message

Kathleen O'Hara

unread,
Jan 30, 2021, 2:44:23 AM1/30/21
to Payara Forum
I am using Payara embedded bootstrapped from a Java app that is running as a Windows Service. Our security group is asking us to disable Hazelcast because we are not using its features in our app and they do not want to see our app listening on port 4900. Although we can close the port in the firewall they prefer us to disable Hazelcast.

I have tried a number of options such as setting it disabled in our custom domain.xml but the domain.xml regenerates when the service restarts and removes the customization. I tried disabling it from the Java app itself:

CommandRunner commandRunner = glassFish.getCommandRunner();
CommandResult commandResult = commandRunner.run(command, options);

using set-hazelcast-configuration and --enabled=false

This disabled the <hazelcast-config-specific-configuration> but the computer is still listening on port 4900 until I stop the app. I assume I need to disable the <hazelcast-runtime-configuration>? How can I achieve that as an embedded app?

Kathleen O'Hara

unread,
Feb 8, 2021, 2:54:14 PM2/8/21
to Payara Forum
For anyone with the same issue this was solved by adding --dynamic=true

String[] options = new String[2];
String command = "set-hazelcast-configuration";
options[0] = "--enabled=false";
options[1] = "--dynamic=true";
CommandRunner commandRunner = glassFish.getCommandRunner();
CommandResult commandResult = commandRunner.run(command, options);

As a result Hazelcast was disabled and the custom domain.xml regenerated without the  <hazelcast-runtime-configuration>.
Reply all
Reply to author
Forward
0 new messages