# jBoss 2.0 Server

## Description

This document contains general information about the usage and administration of the jBoss server.

## Documentation

### Directory structure

The jBoss distribution has the following directory structure.

- bin - Contains the run.jar bootstrap executable JAR, and various OS-specifc scripts that can be used to invoke it.
- conf - Contains the configuration files of jBoss and other components such as databases.
- db - A directory which may be used to store database files. Components wishing to use this directory should locate the "db.properties" resource, which is available on the classpath. If another directory is to be used then move this file to that directory, and add it to classpath
- deploy - Directory in which EJB-JAR files can be placed for deployment.
- docs - Contains the documentation for the jBoss server.
- docs/api - Contains the Javadoc documentation for the jBoss server.
- lib - Contains the JMX files used by the bootstrap JAR.
- lib/ext - Contains any additional JAR-files that should be used by the server. JAR's placed here are automatically added to the classpath of the server. No additional configuration steps are needed besides placing a JAR here.
- lib - A directory which may be used to store log files. Components wishing to use this directory should locate the "log.properties" resource, which is available on the classpath. If another directory is to be used then move this file to that directory, and add it to classpath
- tmp - A directory which may be used to store temporary files. Components wishing to use this directory should locate the "tmp.properties" resource, which is available on the classpath. If another directory is to be used then move this file to that directory, and add it to classpath

### JMX

jBoss 2.0 uses JMX (Java Management eXtension) for management of the server. All JMX documentation applies to the jBoss server. The server is created by using a JMX MLet, which loads the configuration from the /conf/jboss.conf file. For more information about the structure of this file, please see the JMX documentation.

#### Logging using JMX-notifications

jBoss uses the JMX Notification mechanism to perform logging. The org.jboss.logging.Logger component is used to publish these notifications. Log consumers that wishes to output log messages should subscribe to the logging component as is defined in the JMX specification. See the org.jboss.logging.FileLogging class for an example of this. Components wishing to log messages should use the org.jboss.logging.Log component to do this. Any messages sent to System.out or System.err will be redirected to this logging facility of the ConsoleLogging component is installed. See the various provided jBoss components for examples of how to use logging.

### Classpaths

Classpaths in jBoss are managed as defined by the JMX specification, i.e. by specifying which JAR-files that each component wishes to use in the MLet configuration file. However, it is possible to extend the classpath automatically by using the org.jboss.util.ClassPathExtension component. This adds either a single JAR, or all JAR's in a directory to the MLet classloader, allowing the components loaded by it to access these JAR's. The default jBoss configuration adds a ClassPathExtension component which adds all JAR's located in the /lib/ext directory. Placing a JAR there will hence add it to the server classpath.

### Configuration files

jBoss server configuration is loaded from the /conf directory. The jboss.conf file is used by the run.jar bootstrap to instantiate and configure JMX MBeans as defined by the MLet component in JMX. The jboss.properties file contains system properties which will be loaded by the run.jar bootstrap on startup. Add any additional system settings that you require to this file. It also contains the security policy of jBoss in the server.policy file, and the JNDI settings in the jndi.properties file. The /conf directory is added to the classpath so all files are available through the getResource mechanism in the Class and ClassLoader classes.