Previous section: Unpacking JBoss and Initial Setup

JBoss Server Configuration

Let's take a quick tour of part of the JBoss directory structure. Underneath the root directory—I mean the root level of the JBoss package—there should be a directory called "server". Let's take a look at its contents.

julius:/Library/JBoss/4.0.0 murray$ cd server
julius:/Library/JBoss/4.0.0/server murray$ ls
all             default         minimal         standard
julius:/Library/JBoss/4.0.0/server murray$

There are four directories here. (In previous versions there was no "standard" directory. This seems to be new as of version 4.0.0.) Each directory contains a different "JBoss server configuration". As its name implies, minimal has a minimal configuration—the bare minimum needed to start up JBoss. On the opposite side of the spectrum, the all configuration is set up to launch every single component, including the kitchen sink! Smack dab in the middle, default has most of the services you are likely to need in order to deploy a J2EE EJB application. Also, as its name implies, the default configuration is the one that launches by default. What I mean is, if you execute (from the package's root directory) bin/ it will launch the default configuration.

In order to launch the server with one of the other configurations, you simply add the "-c configuration" flag at the end. For example, if we want to launch the minimal configuration:

julius:/Library/JBoss/4.0.0 murray$ bin/ -c minimal

  JBoss Bootstrap Environment

  JBOSS_HOME: /Library/JBoss/4.0.0

  JAVA: java

  JAVA_OPTS: -server -Xms128m -Xmx512m

  CLASSPATH: /Library/JBoss/4.0.0/bin/run.jar:/lib/tools.jar


15:12:35,901 INFO  [Server] Starting JBoss (MX MicroKernel)...
15:12:35,907 INFO  [Server] Release ID: JBoss [Zion] 4.0.0 (build: CVSTag=JBoss_4_0_0 date=200409200418)
15:12:35,910 INFO  [Server] Home Dir: /Library/JBoss/4.0.0
15:12:35,911 INFO  [Server] Home URL: file:/Library/JBoss/4.0.0/
15:12:35,913 INFO  [Server] Library URL: file:/Library/JBoss/4.0.0/lib/
15:12:35,916 INFO  [Server] Patch URL: null
15:12:35,918 INFO  [Server] Server Name: minimal
15:12:35,938 INFO  [Server] Server Home Dir: /Library/JBoss/4.0.0/server/minimal
15:12:35,940 INFO  [Server] Server Home URL: file:/Library/JBoss/4.0.0/server/minimal/
15:12:35,941 INFO  [Server] Server Data Dir: /Library/JBoss/4.0.0/server/minimal/data
15:12:35,958 INFO  [Server] Server Temp Dir: /Library/JBoss/4.0.0/server/minimal/tmp
15:12:35,959 INFO  [Server] Server Config URL: file:/Library/JBoss/4.0.0/server/minimal/conf/
15:12:35,961 INFO  [Server] Server Library URL: file:/Library/JBoss/4.0.0/server/minimal/lib/
15:12:35,962 INFO  [Server] Root Deployment Filename: jboss-service.xml
15:12:35,970 INFO  [Server] Starting General Purpose Architecture (GPA)...
15:12:36,711 INFO  [ServerInfo] Java version: 1.4.2_05,Apple Computer, Inc.
15:12:36,712 INFO  [ServerInfo] Java VM: Java HotSpot(TM) Client VM 1.4.2-38,"Apple Computer, Inc."
15:12:36,713 INFO  [ServerInfo] OS-System: Mac OS X 10.3.5,ppc
15:12:37,104 INFO  [Server] Core system initialized
15:12:37,720 INFO  [Log4jService$URLWatchTimerTask] Configuring from URL: resource:log4j.xml
15:12:38,250 INFO  [NamingService] Started jnpPort=1099, rmiPort=1098, backlog=50, bindAddress=/, 
Client SocketFactory=null, Server
15:12:38,312 INFO  [Server] JBoss (MX MicroKernel) [4.0.0 (build: CVSTag=JBoss_4_0_0 date=200409200418)]
Started in 2s:341ms

Go ahead and try launching JBoss with the all configuration. I'm not going to put the output here. Suffice to say it would be much longer.

What's nice about this setup is that you can easily create one or many additional configurations. In a large, elaborate system, you might want to create a configuration that only manages JMS Messaging so you can debug some specific portions of your code without constantly redeploying the 500 Pound Gorrila that is your entire application. Also, if you are interested in learning more about Aspect Oriented Programming, I would encourage you to create a configuration that only sported the JBoss AOP and use that for your development.

A New "Minimal" Configuration

Before we go onto the next sections, let's create our own custom JBoss configuration. This is really a one-line no brainer: just copy the "minimal" directory into a new directory. For this example we'll call our new configuration "custom".

julius:/Library/JBoss/4.0.0 murray$ cd server 
julius:/Library/JBoss/4.0.0/server murray$ ls
all             default         minimal         standard
julius:/Library/JBoss/4.0.0/server murray$ cp -R minimal custom
julius:/Library/JBoss/4.0.0/server murray$ ls
all             custom          default         minimal         standard

Now we're ready to build our custom configuration.

Next section: Adding Our Tomcat Service


Written material copyright © 2004 by Murray Todd Williams

Page last modified 02/03/2005 8:39