- Discover with BMC Discovery
This product can be discovered by any edition of BMC Discovery. Download our free Community Edition to try it out, or [see what else it can discover] !
- What is this?
- This is a product information page, containing details of the information that BMC Discovery gathers about a product and how it is obtained.
- Product Name
- Publisher Page
- Red Hat
- Application Server Software Platforms
- TKU 2017-Sep-1
- Change History
- Red Hat JBoss Application Server - Change History
- Reports & Attributes
- Red Hat JBoss Application Server - Reports & Attributes
- Publisher Link
Extended Discovery pattern which allows to model J2EE Applications, JDBS Resources and Java Mail Resources for JBoss Application Server or WildFly SI is available for this product.
Starting from version 8.0 JBoss Application Server becomes WildFly. JBoss.tplpre pattern was updated for September TKU to support this change.
Starting from September TKU onward we differentiate between JBoss EAP versions and JBoss AS versions in particular. For this purposes we've added platform_version attribute to the JBoss Application Server (WildFly) SI for the cases when it is a part of Enterprise Platform.
JBoss (pronounced Jay Boss) Application Server or WildFly(since v.8.0) is an open source Java EE-based application server implemented in Java.
Because it is Java based, JBoss Application Server can be run on any platform that has a working Java Virtual Machine implementation, including Windows, most flavours of Unix and Linux, though those platforms that do not use the standard Sun JVM implementation may experience issues.
Other JBoss related projects include Hibernate, Tomcat, JBoss ESB, jBPM, JBoss Rules (formerly Drools), JBoss Cache, JGroups, JBoss Portal, SEAM, JBoss Transactions, JBoss Messaging and are marketed under the JBoss Enterprise Middleware Suite (JEMS) brand.
Software Pattern Summary
|Product Component||OS Type||Versioning||Pattern Depth|
|Application Server||Unix||Active, Path, Package||Instance-based or Grouped (data dependent)|
Platforms Supported by the Pattern
The pattern has been created in a manner that allows it to support Windows, Linux and Unix platforms from the same module, a Software Instance is created for each unique server running on a host.
There are two possible triggers:
- A java process with org.jboss.as.host-controller in the arguments. If the pattern has this trigger and can find details of the domain controller it creates a Red Hat JBoss Host Controller software instance. If it has this trigger but can't find details of the domain controller it creates a Red Hat JBoss Host Controller with domain_controller attribute software instance
- A java process with org.jboss.as.standalone, org.jboss.as.server or org.jboss.main in the arguments. If the pattern has this trigger it creates a Red Hat JBoss Application Server or WildFly software instance
Simple Identification Mappings
The following components/processes are identified using the simple identity mappings.
|regex '(?i)\bjava(?:\.exe)?$'||regex "org\.jboss\.(?:Main|as\.(?:standalone|server))"|
|regex '\bjava(?:\.\S+)$'||regex "org\.jboss\.(?:Main|as\.(?:standalone|server))"|
|regex '(?i)\bjava(?:\.exe)?$'||regex "org\.jboss\.(?:Main|as\.(?:standalone|server))"|
|Red Hat JBoss Application Server Host Controller||regex '(?i)\bjava(?:\.exe)?$'||regex 'org\.jboss\.as\.host-controller'|
Version information for the product is currently collected using one of three possible methods.
The methods are tried in an order of precedence based on likely success and/or accuracy of the information that can be gathered. Once a result is obtained, the methods lower in precedence are not attempted. In order of precedence the methods are:
- Active Command - File Versioning
- Active Versioning (if enabled)
- Path Versioning
- Package Versioning
JAVA_HOME environment variable should be set for Unix systems prior to running versioning active command and active command for edition extraction. The regular expression used for extracting JAVA_HOME for Unix systems is as follows:
- regex '^(/.*)/bin/java$'
Obtaining installation path
Active Command (file) and Active Versioning methods depend on the pattern successfully obtaining the installation path of the JBoss Application Server (WildFly).
The installation path is obtained as follows:
JBoss Application Server 7.0 and later, the trigger process arguments contain the parameter -Djboss.home.dir and the value of the parameter is parsed as follows:
If the trigger process arguments contain quotes, the regular expressions attempted are: (?i)"-Djboss\.home\.dir=(\w:[\\/][^"]+)"
If the trigger process arguments do not contain quotes the regular expression used is: (?i)-Djboss\.home\.dir=(\w:.+?)\sor
- UNIX platforms
If the trigger process arguments contain quotes the regular expression used is: '-Djboss\.home\.dir="(.+?)"
If the trigger process arguments do not contain quotes the regular expression used is: -Djboss\.home\.dir=(/\S+)
If the above fails, a similar regular expression (possibly for older versions of the product) is used: -Djboss\.home\.url=file:(/\S+)
JBoss Application Server versions prior to 7.0 - the installation path is obtained from the classpath in the trigger process arguments.
The pattern first parses the trigger process arguments to pull out the classpath using the following regular expressions:
If the classpath is within quotes (contains spaces in the paths): (?i)-(?:cp|classpath)\s+"(.+?)"
If the classpath is not within quotes: (?i)-(?:cp|classpath)\s+(\S+)\s
- UNIX platforms
If the classpath is within quotes (contains spaces in the paths): -(?:cp|classpath)\s+"(.+?)"
If the classpath is not within quotes: -(?:cp|classpath)\s+(\S+)\s
The classpath has also the path separator characters normalized for the platform type
The pattern then parses the classpath section by section (sections are separated by ':' on UNIX platforms and ';' on the Windows platform) to obtain the installation path using the following regular expressions:
If the installation path still isn't obtained the pattern will attempt to parse it from trigger process arguments using the following regular expressions:
(?ix)\b(?:cp|classpath) \s "? (?:[^";]*?;)* (\w:\\.*?jboss[^;"]*?) \\(?:bin|lib)\\\w+\.jar
Active Command - File Versioning
If the installation path is retrieved, the pattern gets line from the file named jar-versions.xml using the following command:
grep "jboss-main.jar" "<installation_path>/jar-versions.xml"
cmd /c findstr /C:"jboss-main.jar" "<installation_path>\\jar-versions.xml"
cmd /c findstr /C:"jboss.jar" "<installation_path>\\jar-versions.xml"
In case the line is successfully read, and depending on the output pattern tries to extract version or platform_version by parsing it with the following regular expression:
This method disabled by default since it (run.sh -V) could cause jboss crashes or core dumps when jboss is running in debug mode
This method (if enabled in pattern configuration) also requires that the installation path has been determined.
For versions of JBoss AS starting from 7.0 the pattern also needs to determine the mode which server was started in from trigger process arguments. Using all this information the shell or batch file that instigated the instance is ran with a -V argument, which results in the version number being returned.
For JBoss Application Server prior to 7.x.x the Version Command results in a shell script being run in the bin directory that the main run.jar file is being run from, for newer releases of program shell or batch file name is equal to mode in which it was started.
The pattern extracts the active platform_version using following regular expression :
- "JBoss(?: Application Server)?(?: AS)? EAP\s+(\d+(?:\.\d)*)"
And if the command output matches regex "JBoss(?: Application Server)?(?: AS)?\s+\d+" then pattern extracts full version by means of regex:
- "JBoss(?: Application Server)?(?: AS)?\s+(\d+(?:\.\d)*)"
This is needed only for JBoss AS of 7.0.0 or newer.
The pattern obtains the mode under which server was started from trigger process' argument list by matching:
- org.jboss.as.standalone - Mode is standalone
- org.jboss.as.server OR org.jboss.as.process-controller OR org.jboss.as.host-controller OR jboss.domain.config.dir OR jboss.domain.master.address - Mode is domain
If we are able to acquire the installation path and mode if needed then the pattern will attempt to run one of the following version commands:
- For version <7.0.0 on Windows the pattern executes (cd /d <base_dir> && echo "" | run -V)
- For version ≥7.0.0 on Windows the pattern executes (cd /d <base_dir> && echo "" | <mode> -V)
- For version <7.0.0 on UNIX the pattern executes (cd <base_dir>; echo "" | ./run.sh -V | grep build)
- For version ≥7.0.0 on UNIX the pattern executes (cd <base_dir>; echo "" | ./<mode>.sh -V | grep build)
The regular expression for the JBoss EAP platform_version: "JBoss(?: Application Server)?(?: AS)? EAP\s+(\d+(?:\.\d)*)"
The regular expression for the full_version :
- "JBoss(?: Application Server)?(?: AS)?\s+(\d+(?:\.\d)*)"
If the Active Version Command does not return any version information then we parse the process arguments against a regex to see if it contains some version information specific to the installation.
As the JBoss application server command is actually a Java VM instance there is no point applying a regex to the commands path, in this case we apply a regex to the arguments to see if there is a version number that can be used.
The regular expressions used to extract JBoss EAP platform_version:
- regex "(?i)EnterprisePlatform[_\\/\.-]?(?:\w+-)*?(\d+(?:[_\.-]\d+)*)",
- regex "(?i)jboss-eap[_\\/\.-]?(?:base)?[_\\/\.-]?(?:\w+-)*?[_\\/\.-]?(\d+(?:[_\.-]\d+)*)"
The regular expressions used to extract full_version :
- regex "(?i)jboss[_\\/\.-]?(?:\w+-)*?(\d+(?:[_\.-]\d+)*)",
- regex "(?i)jboss[_\\/\.-]?(?:base)?[_\\/\.-]?(?:\w+-)*?[_\\/\.-]?(\d+(?:[_\.-]\d+)*)",
- regex "(?:)/jboss/as(\d+)_",
- regex "(?i)wildfly-(\d+(?:\.\d)*)"
The result of this regex is then parsed against a function that converts all underscores and hyphens to periods - to ensure that the version number for this product is consistent throughout the environment.The Regex looks for the word "jboss" somewhere in the classpath and following that a string of digits separated by either underscores, hyphens or periods - this results in a accurate version number that can catch a number of different formats without being open to erroneous inputs.
The version number returned using this method is dependent on the deployment pattern used to install the product, usually it will be to two levels, i.e. x.x, but we have seen a few instances where the depth can is three levels, i.e. x.x.x.
Using a sample command line argument of "/opt/jboss-3.2.6/bin/run.jar" and the above Regex, the version output would be "3.2.6".
If the Active or Path Versioning techniques do not return any version information then we check the installed packages to see if we can extract version information from one of them using the regex, (?i)jboss.
As there is only one package specified in the query then the version number will be assigned if that package exists on the host.
A Jboss package is not registered as standard and identification has been successful on a case-by-case basis, it is dependent on the environment setup.
Package querying is the lowest preference way in which versioning can be achieved - as such the JBoss has been added, despite it not always being present, as a last resort if the other two methods fail.
The main risk of package versioning is that if more than one version of JBoss Application Server (WildFly) is installed then the version information may not be mapped to the correct instance that has been identified.
Alternative Versioning Approach
At the current time we do not know of any further techniques that could be used to version JBoss.
Starting from version 6.0 of Jboss edition can be obtained by running the following command:
- <installation path>/bin/appclient.sh
This command exists only for Enterprise Edition. Edition is set to Enterprise if command result has subword "JBoss EAP".
If edition was not set based on command output, pattern checks the following file:
- <installation path>/version.txt
If it's content matches 'JBoss\s+Enterprise', edition will be set to Enterprise.
If edition was not set by previous two methods pattern checks if appclient.sh exists by obtaining information about the following files:
- <installation path>/bin/appclient.sh
Edition can be obtained from the log directory
Regex to obtain log directory from process arguments:
Command to obtain Edition:
For Windows hosts:
- 'cmd /c findstr /C:"JBoss EAP" "%server_log%"'
For Unix hosts:
- 'PRIV_CAT %server_log% |grep "JBoss EAP"'
If pattern fails to obtain both files and obtaining edition from log file fails - assume there is an access problem, edition cannot be defined
If Product version < 6.0
Edition can be obtained from <installation path>\readme.html file, by parsing its content with a the following regexs:
- "<title>JBoss Enterprise Application Platform" -for Enterprise
- "<title>JBoss\s+\d+(?:\.\d+)*?" -for Community
If edition was not obtained, the pattern checks whether installation path has subword 'EnterprisePlatform' or 'EAP'. if subword is found set edition to Enterprise. For all other cases edition will be set to empty string.
If version was not obtained pattern uses all of the described methods to get edition information.
If neither run.bat or mode.bat is found, it indicates a permission problem rather than the absence of the files.
Obtaining Server name
For JBoss of version 7.0.0 or newer server name can be retrieved only if server was started in domain mode. The value can be parsed using one of the following regular expressions against trigger process's arguments:
For older versions of JBoss the pattern tries in order two following regular expressions against trigger process's arguments:
Note that in last regex the value which is parsed more correctly should be called profile name.
On the UNIX platform, the server base is discovered from the trigger process' command line arguments via use of one of the following regular expressions:
On the UNIX platform, the server home is discovered from the trigger process' command line arguments via use of one of the following regular expressions:
If mode "standalone" then pattern extracts this multicast_socket attribute from standalone-ha.xml or standalone-full-ha.xml files else from domain.xml file.
Pattern will use xpaths to extract multicast-address and port infomation:
Application Model Produced by Software Pattern
JBoss Application Server or WildFly is run independently from a folder, it is only dependent on a valid java virtual machine being installed on the system and referenced correctly in the PATH or JAVA_HOME environment variables.
It is usually started by the running of a shell script or batch file called run.sh or run.bat (depending on Operating System), when ran this script starts the Java VM and passes all the relevant variables to it to start the JBoss Application Server or WildFly - depending on the version.
By default JBoss can be run once on each host, with further installation in separate directories and some changes being made to the configuration file you can run two or more instances of JBoss relatively easily.
Software Pattern Model
One pattern has been created with the JBoss Application Server(WildFly) and JBoss Application Server (daemon) or WildFly(daemon) as its trigger processes. The pattern triggers only where the process cmd matches a java executable (java or java.exe) followed by one of the JBoss arguments:
There is a configuration option for this product which allows to enable active versioning method.
To enable this option user just needs to set "True" to active_versioning_enabled variable.
Although the pattern in general produces instance-based Software Instance based primarily on installation path the approaches in particular are all different for older and newer versions of JBoss and for latter it also depends on mode of server.
SI Depth for Standalone mode
This approach is only for JBoss AS version 7.0 or newer started in 'standalone' mode.
If installation path was successfully discovered then the key is based on it and host's key, else the pattern uses key group based on trigger process's argument list.
SI Depth for Domain mode
This approach is only for JBoss AS version 7.0 or newer started in 'domain' mode.
If installation path and server name were successfully discovered then the key is based on them and host's key, else if only installation path was found the pattern uses key group based on it, or alternatively based on classpath. In other cases the pattern doesn't set key letting BMC Discovery manage found instances automatically.
SI Depth for older versions
This approach is only for JBoss AS version older than 7.0.
If installation path and/or server name were successfully discovered the pattern creates the key based on them and host's key, else it creates key group based on either the installation path (if obtained) or parsed from process's arguments java classpath.
Extended J2EE Discovery
Starting from version 8.3, Atrium Discovery is able to perform extended (J2EE) JBoss Application Server discovery via additional patterns . The approach used by these patterns is based on analyzing different configuration files of JBoss Application Server or WildFly.
Under normal circumstances the Application Server SI creates a client server link to the Host Controller on the same host (the Application Server is the client). However, sometimes there isn't a Host Controller on the host because the Host Controller acts as Domain Controller . In this situation the Application Server creates a client server link to such Host Controller which is identified as Domain Controller by having domain_controller attribute set to TRUE.
The Host Controller SI creates a client server link to the Domain Controller. It finds the domain controller by parsing the trigger process arguments. If that fails it parses the file <installation root>/domain/configuration/host.xml
So an installation might look like the following
For BMC Discovery 11.0 and later JBoss Server Groups are modelled as a cluster. Every time a Red Hat JBoss Application Server or WildFly SI is created the pattern created searches the host.xml for details of the group it belongs to. If it finds this group information it links it to the relevant JBoss Server Group Cluster.
App Server's Software Components are contained within Red Hat JBoss Server Groups.
The pattern also creates a management relationship between the JBoss Cluster and the Host Controller which serves as Domain Controller:
Note that legacy versions of BMC Discovery (10.2 and earlier) model JBoss Server Groups as software instances that have client server links to various application servers (the Server Group is the server). These models will be upgraded to a full cluster model when you upgrade to a modern version of BMC Discovery.
For Standalone mode if the instances are clustered, JBoss Standalone Cluster will be created. Every time a Red Hat JBoss Application Server or WildFly SI is created and it has standalone mode the pattern created searches for multicast_socket attribute and create Red Hat JBoss Standalone Cluster. After that it will search for the Red Hat JBoss Application Server or WildFly SIs with the identical multicast_socket attribute and add it to the cluster.
App Server's Software Components are contained within Red Hat JBoss Standalone Cluster.
Subject Matter Expertise
SME feedback would be appreciated in identifying any other possible commands or files that could be used to version an instance of the product.
Further information on known packages and their reliability would help improve the overall scope and depth of versioning for this product.
The pattern has been tested against Live installations of the product on Linux and Windows.