Introduction To JBoss Application Server

Scott Marlow

Consulting Software Engineer

Novell, Inc.

Matthew Quinlan

Manager of Systems Engineering

JBoss Inc.

Who is JBoss Inc. ?

The founder of the JBoss Application Server open-source project and innovator of Professional Open Source business model.

Professional Open Source

Full-time paid core development staff

Zero license revenue (LGPL)

Legal indemnification

Accountability

Revenue comes from optional services

Professional Support (24x7x365 : 2hr response)

Training

Consulting

What is the JBoss Application Server ?

JBoss AS is the first J2EE 1.4 certified open-source application server on the market, delivering a high-performance, reliable platform of services.

JBoss Microkernel

JBoss

App

Server

Tomcat

Hibernate

JBoss

Cache

JBoss

jBPM

JBoss

Portal

Custom

Middleware

Service

Business Applications

Java Virtual Machine

JBoss Application Server installation

Installation – get it

Download JBoss AS binary from jboss.com website

http://www.jboss.com/downloads/index

Select latest release (jboss-4.0.1)

Automatically redirected to SourceForge.com

to download jboss-4.0.1sp1.tar.gz

Installation – run it

Install (or verify) JDK 1.4.2 or above

java -version

Install “ready to run” archive

Extract contents of JBoss archive (tar xvzf)

cd jboss/bin - open shell to run folder

./run.sh – start the JBoss server

view admin console http://localhost:8080/web-console

Installation Demonstration

Installation – Directory Structure

$JBOSS_HOME (installation directory)

/bin (scripts to start/stop, twiddle for JMX)

/client (JARs for remote Java clients : jbossall-client.jar)

/docs (datasource samples, config DTDs, portmapping, …)

/lib (startup JARs used by JBoss AS, do not modify)

/server (parent directory for “configurations”)

/minimal (microkernel, JNDI, main deployer)

/default (standalone basic J2EE server)

/all (clusterable J2EE server + IIOP + etc.)

/mycustomconfig (copy of minimal, default, or all)

Installation – Directory Structure

$JBOSS_HOME (installation directory)

/server (parent directory for “configurations”)

/mycustomconfig (customizable configuration)

/conf (main XML configuration files)

/lib (jars loaded statically during configuration boot)

/deploy (local hot-deployment for jars,wars,ears,..)

/farm (cluster-wide hot-deployment)

/deploy-hasingleton (cluster-wide singleton deployments)

/data (default location for Hypersonic database data)

/log (Apache Log4J logs)

/tmp (renamed versions of deployed jars, wars, ears, …)

/work (JSP compilation artifacts & serialized objects)

directories dynamically created at runtime

Jboss Application Server configuration

JBoss Application Server Configuration

Configuration – Commandline Options

Choose a server configuration

cp -r jboss/server/all jboss/server/mycustomconfig

Make all of your modifications to the copy

Select configuration on commandline

run.sh –c mycustomconfig

Choose IP address to bind (default = all)

Used to run multiple instances on same machine

Each instance requires separate configuration directory

run.sh –b <ip-address>

Configuration – shared Java classes

Issue: You need to use utility Java class jars

Put jars in the server/mycustomconfig/lib folder

They will be on the classpath

Will be loaded before application classes

Issue: You need to use database connectivity jars

Put JDBC driver jar in server/mycustomconfig/lib folder

Issue: Classes used by JBoss AS are also in application

Remove jars from application that conflict with container

Configuration – database connections

Configure connectivity to your database server

Sample connection pools are in $JBOSS_HOME/docs/examples/jca

Copy connection pool sample to $JBOSS_HOME/server/mycustomconfig/deploy

Update connection pool definition

Connection pool will be created at server start time and can be hot-deployed if changes are necessary

NOTE: Hypersonic RDBMS is included in the JBoss AS distribution for development purposes ONLY!

Not intended for production use.

Configuration – ports

Port assignments defined in multiple ways:

1. service binding configuration files

service-binding.xml

jboss-service.xml (references service-binding.xml)

2. override with environment variables & commandline args

export JAVA_OPTS="-server -Xmx100M Dhttp.port=8080 -Djndi.port=1700 -Duil2.port=1000"

Configuration – TCP-IP IPV6

Issue: Suse Linux uses IPV6 for the protocol stack which leads to error starting JBoss application server in cluster

Update /etc/modprobe.conf as follows:
Change line:
alias net-pf-10 ipv6
To:
alias net-pf-10 off

Configuration - demo

Demonstration of the JBoss Web Console

Change configuration settings

Invoke management operations

View status of running applications

View server status

Start and stop services

JBoss security

Security – JAAS

Declarative security via Pluggable Authentication

LDAP based

File based

Database based

Role mapping

Security – secure it

Basic security : lock down the server

Secure the JMX/WEB console

Secure or remove Remote JMX connector

Secure or remove Hypersonic database

Enhanced security : network infrastructure

Firewall should only allow 1-way traffic (incoming)

Firewall should open only necessary ports

Consider using Apache in a DMZ to “front” JBoss AS

JBoss Application Server deployment

Deployment – application archive

Deployment Scanner:

mycustomconfig/deploy (deploy locally)

mycustomconfig/farm (deploy cluster-wide)

customized locations (filesystem, URL, WebDav)

Copy jar, war, ear to scanned folder for hot-deployment

Delete file for hot-undeployment

Issue: JBoss includes different version of jar than your application requires in server/all/lib folder

Solution: Remove the conflicting jar from JBoss

Solution: Or set java2ParentDelegaton=false

JBoss JEMS features

Operating System (Windows, Unix = Linux, Solaris, AIX, etc.)

Java Virtual Machine (Sun JVM, BEA JRocket, IBM VM, etc.)

JBoss Application Server 4.x (JMX Container : JBossMX)

Custom Mbeans

services beyond J2EE

Persistence (Hibernate*)

JBoss Mail Services

Clustering

Caching (JBossCache*)

Workflow (jBPM**)

JBoss AOP*

Native Applications

Java Applications

Java Applications (EARs, WARs, JARs, JSPs, Servlets)

--- J2EE 1.4 Services implemented as JMX Mbeans ---

JSP/Servlet (Tomcat*)

JNDI (JBoss NS)

JAAS (JBossSX)

JDBC

JMS (JBoss MQ)

EJB (JBoss CMP)

JTA (JBossJTA)

JACC

JavaMail

JCA (JBossJCA)

RMI-IIOP (jacORB)

JAXP (Xerces)

JAX-RPC

Deployment API

JAF

SAAJ

Management API

JBoss JEMS Architecture

JBoss IDE

J2EE 1.4 Certified

EJB 2.1

JSP 2.0

Servlet 2.4

JMS 1.1

JTA 1.0.1B

JNDI 1.2.1

JCA 1.5

JAAS 1.0

JMX 1.2

JAXP 1.2

JAF 1.0

JavaMail 1.3

JACC 1.0

Management API 1.0

Deployment API 1.1

Corba 2.3.1

JAXR 1.0

JAX-RPC 1.1

SAAJ 1.2

WS4EE 1.1

SOAP 1.1

WSDL 1.1

WS-I Basic Profile 1.0

Aspect Oriented Programming support

JBoss AOP allows developers to inject aspect-oriented behaviors into POJOs (plain old Java objects)

@remote

@asynchronous

@logging

@transactional

Etc.

Injection can be specified via annotations, Xdoclet, or XML pointcut expressions.

AOP

J2EE a la carte via AOP

JBoss Cache

Distributed Transactional Caching

Caches POJOs

No interfaces to implement!

No superclasses to sub-class!

Synchronous or asynchronous replication

Transactional changes across group

Automatic fine-grained replication via TreeCache AOP

Superset of jCache (JSR-107) standard

Hibernate

Object-Relational Mapping & Persistence Framework

Basis for EJB3.0 entity beans (EJB3 spec not yet final)

EJB3 has 15% of the functionality available in Hibernate3

Database Independence

Dynamically generates vendor-specific SQL

Supports most databases (Oracle, MS-SQL, DB2, Sybase, etc.)

Transparent Persistence

Any POJO can be a persistent class

No interfaces have to be implemented

No persistent superclass has to be extended

Support for “detached objects”

JBoss Application Server clustering

Clustering - defined

Cluster is a network of nodes working together to provide common services while maintaining scalability and fault-tolerance

Clustering

JBoss AS features

Dynamic cluster definition

NetBoot

Farm deploy

Fail-over and load balancing

State replication

four

five

one

one

Clustering – Dynamic Cluster

All nodes in a JBoss cluster a peers. There is no central director of the cluster, which eliminates any single point of failure.

To add a node to the cluster simply duplicate a drive of an existing node, give the node a unique name/IP, and connect it to the network.

five

Now all of the nodes in the cluster and all client proxies are aware of the new cluster member. Node five is now included in all state replication operations as well.

If any node fails, the cluster will identify the failure and remove that node from the cluster definition of every node and all client proxies.

Cluster Definition

one

two

three

four

Cluster Definition

one

two

three

four

five

Cluster Definition

two

three

four

five

two

four

three

Clustering – Fail over + load balancing

RMI, EJB, JNDI support fail over and load balancing

HTTP requires external support

Dedicated hardware (BigIP, F5, Cisco LD, etc.)

Software (e.g. Apache + mod_jk)

Clustering

Demo

Farm deployment

Fail-over

References for future learning

Wiki wiki is Hawaiian for quick

JBoss Wiki http://www.jboss.org/wiki/Wiki.jsp

JBoss Installation HOWTO

JBoss Installation on a Mainframe

JBoss Frequently Asked Questions (FAQ)

JBoss Admin Guide

JBoss Configuration

Class Loading Configuration

Advanced Class Loading

Secure JBoss

JBoss Release Notes

Preparing an Enterprise-Ready JBoss Installation

Message forums

JBoss message forums http://www.jboss.org/index.html?module=bb

Questions/Answers and general information

Beginners Corner

Installation & Configuration

EJB/JBoss

HTTPD, Servlets & JSP

Security & JAAS/JBoss

Performance Tuning

J2EE Design Patterns

Much more...

Other online references

Register yourself on www.jboss.org http://www.jboss.org/index.html?op=checkage&module=user

Gain access to documentation

You can post questions in the message forum

Watch Jboss webinars http://www.jboss.com/services/online_education

Roadmap

JBossIDE

Clustering

Migrating to JBoss

Others...

Read http://www.myj2ee.com/Members/Firedragon/jbosstuning for quick reference on configuring/optimizing the JBoss server

Clustering slides are based on JBoss Clustering webinar https://jboss.webex.com/jboss/onstage/tool/record/viewrecording1.php?EventID=316291951

2003-12-08T12:43:39

Scott Marlow