Spark switches to hostname as resource after a restart

I found another bug:

I want my users to use the resource as their hostname.
I changed in spark-core-2.9.3.jar>default.properties

# Force using hostname or version as a resource (both are "false" by default; only one can be
# "true" at a time; if both are "true", then hostname will be used as a resource)
HOSTNAME_AS_RESOURCE = false
VERSION_AS_RESOURCE = true
USE_HOSTNAME_AS_RESOURCE = true
USE_VERSION_AS_RESOURCE = false

and change in the %AppData%\Roaming\Spark\spark.properties file:

useVersionAsResource=true
useHostnameAsResource=false

And on the first run I see that everything is working fine, but if you use the close and reopen Spark 2.9.3, then the hostname will be the name of the computer.
Screenshot_596

It is set by default to hostname in Client Control plugin. You can stop doing this in default.properties and do this in that plugin instead.

Also, i know this is related to default.properties, but this is a separate issues. So post in a new thread instead. Moving this out.

1 Like

Thank you very much for the quick answer, yes, through the Client Control plugin, I can forcefully change the resource name.
But I think you still need to register this as a bug, because in any case it should be saved without the plugin!

Plugin takes precedence in this case. Maybe this is possible to make them work together, but i would say this is by design. You should only use default.properties if there is no option in plugin for that. Or you remove the plugin and use only the default.properties.

I mean, without the plugin, I will still have the name of the resource, this is the name of the computer. Although I changed all the settings so that the name of the resource was the name of the version of Spark.

# Force using hostname or version as a resource (both are "false" by default; only one can be
# "true" at a time; if both are "true", then hostname will be used as a resource)
HOSTNAME_AS_RESOURCE = false
VERSION_AS_RESOURCE = true
USE_HOSTNAME_AS_RESOURCE = true
USE_VERSION_AS_RESOURCE = false

and change in the %AppData%\Roaming\Spark\spark.properties file:

useVersionAsResource=true
useHostnameAsResource=false

that’s why I think this is a bug, because without the Plugin I can’t change the resource name, the settings are saved and change after reconnection.

p.s I have never used a plugin for Spark before.

I just did this. Removed Client Control plugin and restarted Openfire. Stopped Spark. Edited default.properties in spark-core-2.9.4-SNAPSHOT.jar and changed:
HOSTNAME_AS_RESOURCE = false
to
HOSTNAME_AS_RESOURCE = true
no other changes. Don’t change USE_… entries, these are just defaults for Spark to use when starting. No need to change anything in spark.properties file either.
When i started Spark and went into Advanced settings, there was no selection to pick version or hostname. When i signed in, in Openfire it is showing my hostname as resource. Even if i relogin.

Also, it looks like default.properties have precedence over what plugin has. At least for this setting. I think because for this setting Spark has to login once to read what plugin is setting and store it for the next login. But when next login happens it reads setting from default.properties first and this overrides what was stored from plugin, so plugin setting is never applied.

It’s very strange that my settings change, but I can throw configuration files in a personal message?

Ok, this is not related to default.properties editing. I am able to reproduce this now. As i always use Client Control plugin, i haven’t noticed this issue. https://igniterealtime.atlassian.net/browse/SPARK-2182

1 Like