-
1. Re: Detecting Server Type
claudio4j Aug 3, 2017 11:23 AM (in response to mithel)You can try using a system property or detect a loaded class
1) detect a system property, example: jboss.home.dir
2) detect a loaded class, example: org.jboss.logmanager.Logger
-
2. Re: Detecting Server Type
mithel Aug 3, 2017 12:40 PM (in response to claudio4j)I've already tried jboss.bind.address but that's not working on the server that is running Wildfly as a service. I could try jboss.home.dir but would that be any more reliable?
-
3. Re: Detecting Server Type
ctomc Aug 3, 2017 1:17 PM (in response to mithel)do you need to know only if you are on WildFly or more details like exact version, etc
as testing if you are on WildFly itself should be simple by checking presence of few system properties, but for exact version you would need to look into jars, or load "Version" class from org.jboss.as.version module.
-
4. Re: Detecting Server Type
mithel Aug 3, 2017 1:51 PM (in response to ctomc)Most important is to know that it is Wildfly. Bonus points for knowing which version (at least major version). This is handy for apps to report this when running in an environment with thousands of servers.
-
5. Re: Detecting Server Type
mayerw01 Aug 4, 2017 7:25 AM (in response to mithel)You can get these details via cli like:
/jboss-cli.sh --connect --controller={hostname} --user={username} --command='version'
If you need to catch this information in your program you may use the Advanced CLI scripting (Advanced CLI scripting with Groovy, Rhino, Jython, etc. )