More Books
JBoss 4.0 The Official Guide
JBoss® 4.0 The Official Guide
Table of Contents
Copyright
About the Authors
We Want to Hear from You!
Introduction
What This Book Covers
About JBoss
About Open Source
About Professional Open Source
What's New in JBoss 4.0
Chapter 1.  Installing and Building the JBoss Server
Getting the Binary Files
Installing the Binary Package
Basic Installation Testing
Booting from a Network Server
Building the Server from Source Code
Chapter 2.  The JBoss JMX Microkernel
JMX
The JBoss JMX Implementation Architecture
Connecting to the JMX Server
Using JMX as a Microkernel
The JBoss Deployer Architecture
Exposing MBean Events via SNMP
Remote Access to Services, Detached Invokers
Chapter 3.  Naming on JBoss
An Overview of JNDI
The JBossNS Architecture
Chapter 4.  Transactions on JBoss
Transaction and JTA Overview
JBoss Transaction Internals
Chapter 5.  EJBs on JBoss
The EJB Client-Side View
The EJB Server-Side View
The EJB Container
Entity Bean Locking and Deadlock Detection
Chapter 6.  Messaging on JBoss
JMS Examples
JBossMQ Overview
JBossMQ Configuration and MBeans
Specifying the MDB JMS Provider
Chapter 7.  Connectors on JBoss
JCA Overview
An Overview of the JBossCX Architecture
Configuring JDBC Datasources
Configuring Generic JCA Adaptors
Chapter 8.  Security on JBoss
J2EE Declarative Security Overview
An Introduction to JAAS
The JBoss Security Model
The JBossSX Architecture
The Secure Remote Password (SRP) Protocol
Running JBoss with a Java 2 Security Manager
Using SSL with JBoss and JSSE
Configuring JBoss for Use Behind a Firewall
Securing the JBoss Server
Chapter 9.  Web Applications
The Tomcat Service
The Tomcat server.xml File
The Engine Element
The Host Element
Using SSL with the JBoss/Tomcat Bundle
Setting the Context Root of a Web Application
Setting Up Virtual Hosts
Serving Static Content
Using Apache with Tomcat
Using Clustering
Integrating Third-Party Servlet Containers
Chapter 10.  MBean Services Miscellany
System Properties Management
Property Editor Management
Services Binding Management
Scheduling Tasks
The Log4j Service MBean
RMI Dynamic Class Loading
Chapter 11.  The CMP Engine
Example Code
The jbosscmp-jdbc Structure
Entity Beans
CMP Fields
Container-Managed Relationships
Declaring Queries
Optimized Loading
The Loading Process
Transactions
Optimistic Locking
Entity Commands and Primary Key Generation
JBoss Global Defaults
Datasource Customization
Chapter 12.  Web Services
JAX-RPC Service Endpoints
Enterprise JavaBean Endpoints
Web Services ClientsA JAX-RPC Client
Service References
Chapter 13.  Hibernate
The Hibernate MBean
Hibernate Archives
Using Hibernate Objects
Using a HAR File Inside an EAR File
The HAR Deployer
Chapter 14.  Aspect-Oriented Programming (AOP) Support
JBoss AOP: EJB-Style Services for Plain Java Objects
Why AOP?
Basic Concepts of AOP
Building JBoss AOP Applications
The JBoss AOP Deployer
Packaging and Deploying AOP Applications to JBoss
Appendix A.  The GNU Lesser General Public License (LGPL)
GNU General Public License
Appendix B.  Example Installation
Index
SYMBOL
A
B
C
D
E
F
G
H
I
J
K
L
M
N
O
P
Q
R
S
T
U
V
W
X

Basic Installation Testing

After you have installed the JBoss distribution, 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 JBOSS_DIST/bin directory and execute the run.bat or run.sh script, as appropriate for your operating system. Your output should be similar to the following, and it should contain no error or exception messages:


[bin]$ sh run.sh
=========================================================================

  JBoss Bootstrap Environment

  JBOSS_HOME: /tmp/jboss-4.0.1
  
  JAVA: /System/Library/Frameworks/JavaVM.framework/Home//bin/java

  JAVA_OPTS: -server -Xms128m -Xmx128m -Dprogram.name=run.sh

  CLASSPATH: /tmp/jboss-4.0.1/bin/run.jar:/System/Library/Frameworks/JavaVM.framework/Home
//lib/tools.jar

=========================================================================

17:29:04,702 INFO  [Server] Starting JBoss (MX MicroKernel)...
17:29:04,715 INFO  [Server] Release ID: JBoss [Zion] 4.0.1RC2 (build:
 CVSTag=JBoss_4_0_1_RC2 date=200411302349)
17:29:04,746 INFO  [Server] Home Dir: /private/tmp/jboss-4.0.1
17:29:04,748 INFO  [Server] Home URL: file:/private/tmp/jboss-4.0.1/
17:29:04,751 INFO  [Server] Library URL: file:/private/tmp/jboss-4.0.1/lib/
17:29:04,756 INFO  [Server] Patch URL: null
17:29:04,759 INFO  [Server] Server Name: default
17:29:04,776 INFO  [Server] Server Home Dir: /private/tmp/jboss-4.0.1/server/default
17:29:04,778 INFO  [Server] Server Home URL: file:/private/tmp/jboss-4.0.1/server/default/
17:29:04,781 INFO  [Server] Server Data Dir: /private/tmp/jboss-4.0.1/server/
default/data
17:29:04,784 INFO  [Server] Server Temp Dir: /private/tmp/jboss-4.0.1/server/
default/tmp
17:29:04,787 INFO  [Server] Server Config URL: file:/private/tmp/jboss-4.0.1/server
/default/conf/
17:29:04,789 INFO  [Server] Server Library URL: file:/private/tmp/jboss-4.0.1/server
/default/lib/
17:29:04,791 INFO  [Server] Root Deployment Filename: jboss-service.xml
17:29:04,833 INFO  [Server] Starting General Purpose Architecture (GPA)...
17:29:06,121 INFO  [ServerInfo] Java version: 1.4.2_05,Apple Computer, Inc.
17:29:06,124 INFO  [ServerInfo] Java VM: Java HotSpot(TM) Client VM 1.4.2-38,
"Apple Computer, Inc."
17:29:06,127 INFO  [ServerInfo] OS-System: Mac OS X 10.3.6,ppc
17:29:07,236 INFO  [Server] Core system initialized
...
17:29:49,550 INFO  [Server] JBoss (MX MicroKernel) [4.0.1RC2 (build: CVSTag=
JBoss_4_0_1_RC2 date=200411302349)] Started in 44s:3ms

If your output is similar to this (accounting for installation directory differences), you should now be ready to use JBoss. To shut down the server, you simply issue a Ctrl+C sequence in the console in which JBoss was started. Alternatively, you can use the shutdown.sh command:

[bin]$ ./shutdown.sh

A JMX client to shutdown (exit or halt) a remote JBoss server.

usage: shutdown [options] <operation>

options:
    -h, --help                Show this help message
    -D<name>[=<value>]        Set a system property
    --                        Stop processing options
    -s, --server=<url>        Specify the JNDI URL of the remote server
    -n, --serverName=<url>    Specify the JMX name of the ServerImpl
    -a, --adapter=<name>      Specify JNDI name of the RMI adapter to use
    -u, --user=<name>         Specify the username for authentication[not implemented yet]

    -p, --password=<name>     Specify the password for authentication[not implemented yet]

operations: 
    -S, --shutdown            Shutdown the server (default)
    -e, --exit=<code>         Force the VM to exit with a status code
    -H, --halt=<code>         Force the VM to halt with a status code

Using run.sh without any arguments starts the server, using the default server configuration file set. To start with an alternate configuration file set, you pass in the name of the directory under JBOSS_DIST/server that you wish to use as the value to the -c command-line option. For example, to start with the minimal configuration file set, you would specify this:

[bin]$ ./run.sh -c minimal
...
17:40:41,092 INFO  [Server] JBoss (MX MicroKernel) [4.0.1RC2 (build: CVSTag=
JBoss_4_0_1_RC2 date=200411302349)] Started in 4s:920ms

To view all the supported command-line options for the JBoss server bootstrap class, you issue the run-h command, and the output looks like this:

usage: run.sh [options]

options:
    -h, --help                    Show this help message
    -V, --version                 Show version information
    --                            Stop processing options
    -D<name>[=<value>]            Set a system property
    -p, --patchdir=<dir>          Set the patch directory; Must be absolute
    -n, --netboot=<url>           Boot from net with the given url as base
    -c, --configuration=<name>    Set the server configuration name
    -j, --jaxp=<type>             Set the JAXP impl type (ie. crimson)
    -B, --bootlib=<filename>      Add an extra library to the front bootclasspth
    -L, --library=<filename>      Add an extra library to the loaders classpath
    -C, --classpath=<url>         Add an extra url to the loaders classpath
    -P, --properties=<url>        Load system properties from the given url
    -b, --host=<host or ip>       Bind address for all JBoss services