J Boss 7 Installation

J Boss 7 Installation

This is an introduction to the newest JBoss AS 7 which appeared in the download section for the first time in Nov 2010.

JBoss application server can be freely downloaded from the community site: http://www.jboss.org/jbossas/downloads/JBoss AS 7 does not come with an installer; it is simply a matter of extracting the compressed archive.

After you have installed JBoss, it is wise to perform a simple startup test to validate that there are no major problems with your Java VM/operating system combination. To test your installation, move to the bin directory of your JBOSS_HOME directory and issue the following command:

standalone.bat # Windows users
$ standalone.sh # Linux/Unix users

The above command starts up a JBoss standalone instance that’s equivalent of starting the application server with the run.bat/run.sh script used by earlier AS releases. You will notice how amazingly fast is starting the new release of the application server; this is due to the new modular architecture, which only starts up necessary parts of the application server container needed by loaded applications.

If you need to customize the startup properties of your application server, then you need to open the standalone.conf (or standalone.conf.bat for the Windows users) where the memory requirements of JBoss are declared. Here’s the Linux core section of it:

So, by default, the application server starts with a minimum memory requirement of 64MB of heap space and a maximum of 512MB. This will be just enough to get started, however, if you need to run a core Java EE application on it, you will likely require at least 1GB of heap space or 2GB or more depending on your application type. Generally speaking, 32-bit machines cannot execute a process whose space exceeds 2GB, however on 64 bit machines, there’s essentially no limit to process size.

You can verify that the server is reachable from the network by simply pointing your browser to the application server’s welcome page, which is reachable by default at the well-known address: http://localhost:8080

Connecting to the server with the command line interface

If you have been using previous releases of the application server you might have heard about the twiddle command -line utility that queried the MBeans installed on the application server. This utility has been replaced by a more sophisticated interface named the Command Line Interface (CLI), which can be found in the JBOSS_HOME/bin folder.

Just launch the jboss-cli.bat script (or jboss-admin.sh for Linux users) and you will be able to manage the application server via a shell interface. Now issue the connect [Ipaddress:port] command to connect to the management interface:

Inclined to build a profession as JBOSS Developer?
Then here is the blog post on JBOSS Training Program

JBoss AS 7 introduction

After you have installed JBoss, it is wise to perform a simple startup test to validate that there are no major problems with your Java VM/operating system combination. To test your installation, move to the bin directory of your JBOSS_HOME directory and issue the following command:

standalone.bat # Windows users
$ standalone.sh # Linux/Unix users

The above command starts up a JBoss standalone instance that’s equivalent of starting the application server with the run.bat/run.sh script used by earlier AS releases. You will notice how amazingly fast is starting the new release of the application server; this is due to the new modular architecture, which only starts up necessary parts of the application server container needed by loaded applications.

If you need to customize the startup properties of your application server, then you need to open the standalone.conf (or standalone.conf.bat for the Windows users) where the memory requirements of JBoss are declared. Here’s the Linux core section of it:

So, by default, the application server starts with a minimum memory requirement of 64MB of heap space and a maximum of 512MB. This will be just enough to get started, however, if you need to run a core Java EE application on it, you will likely require at least 1GB of heap space or 2GB or more depending on your application type. Generally speaking, 32-bit machines cannot execute a process whose space exceeds 2GB, however on 64 bit machines, there’s essentially no limit to process size. You can verify that the server is reachable from the network by simply pointing your browser to the application server’s welcome page, which is reachable by default at the well-known address: http://localhost:8080

Connecting to the server with the command line interface

If you have been using previous releases of the application server you might have heard about the twiddle command -line utility that queried the MBeans installed on the application server. This utility has been replaced by a more sophisticated interface named the Command Line Interface (CLI), which can be found in the JBOSS_HOME/bin folder.

Just launch the jboss-cli.bat script (or jboss-admin.sh for Linux users) and you will be able to manage the application server via a shell interface. Now issue the connect [Ipaddress:port] command to connect to the management interface:

[disconnected /] connect
Connected to localhost:9999

Connecting to a remote host

Starting from the 7.1.0 release there is security enabled by default on the AS 7.1 distribution for remote clients. Thus management interfaces are secured by default to prevent unauthorized remote access whilst still allowing access for local users for an easier out of the box experience.

If you are connecting to a remote host controller, then you need to provide your credentials:

Probably the easiest way to stop JBoss is by sending an interrupt signal with Ctrl+C. However, if your JBoss process was launched in the background or rather is running on another machine (see next), then you can use the CLI interface to issue an immediate shutdown command:

There is actually one more option to shutdown the application server, which is pretty useful if you need to shut down the server from within a script. This option consists of passing the –connect option to the admin shell, thereby switching off the interactive mode:

The command-line Interface contains a lot of useful commands. One of the most interesting options is the ability to reload all or parts of the AS configuration using the reload command . When issued on the root node path of the AS server, it is able to reload the services configuration:

The first thing you’ll notice when you browse through the application server folders is that its file system is basically divided into two core parts: the dichotomy reflects the distinction between standalone servers and domain servers.

A JBoss domain is used to manage and coordinate a set of application server instances.JBoss AS 7 in domain mode spawns multiple JVMs which build up the domain. Besides the AS instances, two more processes are created: the Domain Controller which acts as management control point of the domain and the Host Controller which interacts with the domain Controller to control the lifecycle of the AS instances.

Applications are deployed differently depending on the type of server. If you are deploying to a domain of servers then you need the Command Line Interface because the application server needs to be informed on which server group/s the deployment is targeted.

Ex. Deploy an application on all server groups:

deploy MyApp.war --all-server-groups

Ex. Deploy an application on one or more server groups (separated by a comma):

deploy application.ear –server-groups=main-server-group

If you are deploying to a standalone server then you can either use the CLI or drop the deployment unit into the server deployments folder.

As soon as the deployer HD scanner detects the application, the module is moved to the work folder of the application, leaving a placeholder Test.war.deployed file in the deployments folder.

“At TekSlate, we are trying to create high quality tutorials and articles, if you think any information is incorrect or want to add anything to the article, please feel free to get in touch with us at info@tekslate.com, we will update the article in 24 hours.”