Wednesday, June 4, 2014

Check Important information like Product-name, Version, codename etc in Jboss EAP 6 or Wildfly 8 using CLI.

Sometimes, we need some information about the product we are using. Suppose, we want to know about the product version, name, codename or running mode in Jboss AS 7, Jboss EAP 6 or Wildfly-8.[0-1]. We can do all this easily using built in CLI utility.

Below are the steps :
1.) Start your Application Server Instance in any mode(standalone/domain). Here, we are doing all this in standalone mode.

root@lubuntu1:/data/wildfly-8.1.0.Final/bin# ./

  JBoss Bootstrap Environment

  JBOSS_HOME: /data/wildfly-8.1.0.Final

  JAVA: java

  JAVA_OPTS:  -server -Xms64m -Xmx512m -XX:MaxPermSize=256m -Djboss.modules.system.pkgs=org.jboss.byteman -Djava.awt.headless=true


12:32:02,587 INFO  [org.jboss.modules] (main) JBoss Modules version 1.3.3.Final
12:32:06,242 INFO  [org.jboss.msc] (main) JBoss MSC version 1.2.2.Final
12:32:07,582 INFO  [] (MSC service thread 1-2) JBAS015899: WildFly 8.1.0.Final "Kenny" starting
12:32:20,281 INFO  [] (Controller Boot Thread) JBAS015888: Creating http management service using socket-binding (management-http)
12:32:20,494 INFO  [org.xnio] (MSC service thread 1-2) XNIO version 3.2.2.Final
   2.) Create a new Management user using|bat
root@lubuntu1:/data/wildfly-8.1.0.Final/bin# ./

What type of user do you wish to add?
 a) Management User (
 b) Application User (

Enter the details of the new user to add.
Using realm 'ManagementRealm' as discovered from the existing property files.
Username : admin
User 'admin' already exists and is disabled, would you like to...
 a) Update the existing user password and roles
 b) Enable the existing user
 c) Type a new username
Password recommendations are listed below. To modify these restrictions edit the configuration file.
 - The password should not be one of the following restricted values {root, admin, administrator}
 - The password should contain at least 8 characters, 1 alphabetic character(s), 1 digit(s), 1 non-alphanumeric symbol(s)
 - The password should be different from the username
Password :
Re-enter Password :

 3.) Connect to controller using ./|bat script present in $JBOSS_HOME/bin directory.
lubuntu@lubuntu1:/data/wildfly-8.1.0.Final/bin$ ./ -c --controller=
Authenticating against security realm: ManagementRealm
Username: admin
[standalone@ /]

4.) Check all required Information :
     a.) Using 'ls -l'  command.
[standalone@ /] ls -l
ATTRIBUTE                VALUE       TYPE  
launch-type              STANDALONE  STRING
management-major-version 2           INT   
management-micro-version 0           INT   
management-minor-version 1           INT   
name                     lubuntu1    STRING
namespaces               []          OBJECT
process-type             Server      STRING
product-name             undefined   STRING
product-version          undefined   STRING
profile-name             undefined   STRING
release-codename         Kenny       STRING
release-version          8.1.0.Final STRING
running-mode             NORMAL      STRING
schema-locations         []          OBJECT
server-state             running     STRING

core-service         n/a        n/a       
deployment           n/a        n/a       
deployment-overlay   n/a        n/a       
extension            n/a        n/a       
interface            n/a        n/a       
path                 n/a        n/a       
socket-binding-group n/a        n/a       
subsystem            n/a        n/a       
system-property      n/a        n/a

In EAP 6.*
[standalone@ /] ls -l
ATTRIBUTE                VALUE                 TYPE  
launch-type              STANDALONE            STRING
management-major-version 1                     INT   
management-micro-version 0                     INT   
management-minor-version 5                     INT   
name                     lubuntu1              STRING
namespaces               []                    OBJECT
process-type             Server                STRING
product-name             EAP                   STRING
product-version          6.2.0.GA              STRING
profile-name             undefined             STRING
release-codename         Janus                 STRING
release-version          7.3.0.Final-redhat-14 STRING
running-mode             NORMAL                STRING
schema-locations         []                    OBJECT
server-state             running               STRING 
     b.) Using read-attribute :

[standalone@ /] read-attribute --name=product-version
[standalone@ /] read-attribute --name=product-name
[standalone@ /] read-attribute --name=launch-type
[standalone@ /] read-attribute --name=release-codename
[standalone@ /] read-attribute --name=release-version
[standalone@ /] read-attribute --name=running-mode
[standalone@ /] read-attribute --name=name

[standalone@ /] :read-attribute(name=product-version)
    "outcome" => "success",
    "result" => "6.2.0.GA"
[standalone@ /] :read-attribute(name=product-name)
    "outcome" => "success",
    "result" => "EAP"
[standalone@ /] :read-attribute(name=release-codename)
    "outcome" => "success",
    "result" => "Janus"
[standalone@ /] :read-attribute(name=release-version)
    "outcome" => "success",
    "result" => "7.3.0.Final-redhat-14"
[standalone@ /] 

Happy Learning :) !!