Configuration Guide

Configuration Guide

JBoss Enterprise Application Platform

Red Hat Documentation Group

Legal Notice

June, 2007

Abstract

This book is a guide to configuring the JBoss Application Server for JBoss Enterprise Application Platform.


What this Book Covers
About JBoss
About Open Source
About Professional Open Source
1. Feedback
I. Java EE 5 Application Configuration
2. Enterprise Applications with EJB3 Services
2.1. Session Beans
2.2. Entity Beans (a.k.a. Java Persistence API)
2.2.1. The persistence.xml file
2.2.2. Use Alternative Databases
2.2.3. Default Hibernate options
2.3. Message Driven Beans
2.4. Package and Deploy EJB3 Services
2.4.1. Deploy the EJB3 JAR
2.4.2. Deploy EAR with EJB3 JAR
3. Deployment
3.1. Deployable Application Types
3.2. Standard Server Configurations
3.2.1. The production Configuration
3.2.2. Further Tuning from the production Configuration
II. JBoss AS Infrastructure
4. The JBoss JMX Microkernel
4.1. An Introduction to JMX
4.1.1. Instrumentation Level
4.1.2. Agent Level
4.1.3. Distributed Services Level
4.1.4. JMX Component Overview
4.2. JBoss JMX Implementation Architecture
4.2.1. The JBoss ClassLoader Architecture
4.2.2. Class Loading and Types in Java
4.2.3. JBoss XMBeans
4.3. Connecting to the JMX Server
4.3.1. Inspecting the Server - the JMX Console Web Application
4.3.2. Connecting to JMX Using RMI
4.3.3. Command Line Access to JMX
4.3.4. Connecting to JMX Using Any Protocol
4.4. Using JMX as a Microkernel
4.4.1. The Startup Process
4.4.2. JBoss MBean Services
4.4.3. Writing JBoss MBean Services
4.4.4. Deployment Ordering and Dependencies
4.5. JBoss Deployer Architecture
4.5.1. Deployers and ClassLoaders
4.6. Remote Access to Services, Detached Invokers
4.6.1. A Detached Invoker Example, the MBeanServer Invoker Adaptor Service
4.6.2. Detached Invoker Reference
5. Naming on JBoss
5.1. An Overview of JNDI
5.1.1. Names
5.1.2. Contexts
5.2. The JBossNS Architecture
5.3. The Naming InitialContext Factories
5.3.1. The standard naming context factory
5.3.2. The org.jboss.naming.NamingContextFactory
5.3.3. Naming Discovery in Clustered Environments
5.3.4. The HTTP InitialContext Factory Implementation
5.3.5. The Login InitialContext Factory Implementation
5.3.6. The ORBInitialContextFactory
5.4. JNDI over HTTP
5.4.1. Accessing JNDI over HTTP
5.4.2. Accessing JNDI over HTTPS
5.4.3. Securing Access to JNDI over HTTP
5.4.4. Securing Access to JNDI with a Read-Only Unsecured Context
5.5. Additional Naming MBeans
5.5.1. JNDI Binding Manager
5.5.2. The org.jboss.naming.NamingAlias MBean
5.5.3. org.jboss.naming.ExternalContext MBean
5.5.4. The org.jboss.naming.JNDIView MBean
5.6. J2EE and JNDI - The Application Component Environment
5.6.1. ENC Usage Conventions
6. Connectors on JBoss
6.1. JCA Overview
6.2. An Overview of the JBossCX Architecture
6.2.1. BaseConnectionManager2 MBean
6.2.2. RARDeployment MBean
6.2.3. JBossManagedConnectionPool MBean
6.2.4. CachedConnectionManager MBean
6.2.5. A Sample Skeleton JCA Resource Adaptor
6.3. Configuring JDBC DataSources
6.4. Configuring Generic JCA Adaptors
7. Transactions on JBoss
7.1. Transaction/JTA Overview
7.1.1. Pessimistic and optimistic locking
7.1.2. The components of a distributed transaction
7.1.3. The two-phase XA protocol
7.1.4. Heuristic exceptions
7.1.5. Transaction IDs and branches
7.2. JTS support
7.3. Web Services Transactions
7.4. Configuring JBoss Transactions
7.5. Local versus distributed transactions
8. Messaging on JBoss
8.1. JMS Examples
8.1.1. A Point-To-Point Example
8.1.2. A Pub-Sub Example
8.1.3. A Pub-Sub With Durable Topic Example
8.1.4. A Point-To-Point With MDB Example
8.2. JBoss MQ Overview
8.2.1. Invocation Layer
8.2.2. Security Manager
8.2.3. Destination Manager
8.2.4. Message Cache
8.2.5. State Manager
8.2.6. Persistence Manager
8.2.7. Destinations
8.3. JBoss MQ Configuration and MBeans
8.3.1. org.jboss.mq.il.jvm.JVMServerILService
8.3.2. org.jboss.mq.il.uil2.UILServerILService
8.3.3. org.jboss.mq.il.http.HTTPServerILService
8.3.4. org.jboss.mq.server.jmx.Invoker
8.3.5. org.jboss.mq.server.jmx.InterceptorLoader
8.3.6. org.jboss.mq.sm.jdbc.JDBCStateManager
8.3.7. org.jboss.mq.security.SecurityManager
8.3.8. org.jboss.mq.server.jmx.DestinationManager
8.3.9. org.jboss.mq.server.MessageCache
8.3.10. org.jboss.mq.pm.jdbc2.PersistenceManager
8.3.11. Destination MBeans
8.4. Specifying the MDB JMS Provider
8.4.1. org.jboss.jms.jndi.JMSProviderLoader MBean
8.4.2. org.jboss.jms.asf.ServerSessionPoolLoader MBean
8.4.3. Integrating non-JBoss JMS Providers
9. Security on JBoss
9.1. J2EE Declarative Security Overview
9.1.1. Security References
9.1.2. Security Identity
9.1.3. Security roles
9.1.4. EJB method permissions
9.1.5. Web Content Security Constraints
9.1.6. Enabling Declarative Security in JBoss
9.2. An Introduction to JAAS
9.2.1. What is JAAS?
9.3. The JBoss Security Model
9.3.1. Enabling Declarative Security in JBoss Revisited
9.4. The JBoss Security Extension Architecture
9.4.1. How the JaasSecurityManager Uses JAAS
9.4.2. The JaasSecurityManagerService MBean
9.4.3. The JaasSecurityDomain MBean
9.5. Defining Security Domains
9.5.1. Loading Security Domains
9.5.2. The DynamicLoginConfig service
9.5.3. Using JBoss Login Modules
9.5.4. Writing Custom Login Modules
9.6. The Secure Remote Password (SRP) Protocol
9.6.1. Providing Password Information for SRP
9.6.2. Inside of the SRP algorithm
9.7. Running JBoss with a Java 2 security manager
9.8. Using SSL with JBoss
9.8.1. Adding SSL to EJB3
9.8.2. Adding SSL to EJB 2.1 calls
9.9. Configuring JBoss for use Behind a Firewall
9.10. How to Secure the JBoss Server
9.10.1. The JMX Console
9.10.2. The Web Console
9.10.3. The HTTP Invokers
9.10.4. The JMX Invoker
10. Web Services
10.1. JAX-RPC Service Endpoints
10.2. EJB Endpoints
10.3. Web Services Clients
10.3.1. A JAX-RPC client
10.3.2. Service references
11. Additional Services
11.1. Memory and Thread Monitoring
11.2. The Log4j Service
11.3. System Properties Management
11.4. Property Editor Management
11.5. Services Binding Management
11.5.1. AttributeMappingDelegate
11.5.2. XSLTConfigDelegate
11.5.3. XSLTFileDelegate
11.5.4. The Sample Bindings File
11.6. RMI Dynamic Class Loading
11.7. Scheduling Tasks
11.7.1. org.jboss.varia.scheduler.Scheduler
11.8. The Timer Service
11.9. The BarrierController Service
11.10. Exposing MBean Events via SNMP
III. Clustering Configuration
12. Quick Tutorial to Setup a Clustered Web Application
12.1. Setup the simple web cluster
12.1.1. Setup the load balancer
12.1.2. Configure JBoss AS nodes
12.1.3. Shared Database
12.2. Optional improvements to the simple cluster
12.2.1. Failover support
12.2.2. Database cache
12.3. Basic optimization
13. JBossCache and JGroups Services
13.1. JGroups Configuration
13.1.1. Transport Protocols
13.1.2. Discovery Protocols
13.1.3. Failure Detection Protocols
13.1.4. Reliable Delivery Protocols
13.1.5. Other Configuration Options
13.2. JBossCache Configuration
14. Clustering
14.1. Introduction
14.1.1. Cluster Definition
14.1.2. Service Architectures
14.1.3. Load-Balancing Policies
14.1.4. Farming Deployment
14.1.5. Distributed state replication services
14.2. Clustered JNDI Services
14.2.1. How it works
14.2.2. Client configuration
14.2.3. JBoss configuration
14.3. Clustered Session EJBs
14.3.1. Stateless Session Bean in EJB 2.x
14.3.2. Stateful Session Bean in EJB 2.x
14.3.3. Stateless Session Bean in EJB 3.0
14.3.4. Stateful Session Bean in EJB 3.0
14.4. Clustered Entity EJBs
14.4.1. Entity Bean in EJB 2.x
14.4.2. Entity Bean in EJB 3.0
14.5. HTTP Services
14.5.1. Download the software
14.5.2. Configure Apache to load mod_jk
14.5.3. Configure worker nodes in mod_jk
14.5.4. Configure JBoss
14.5.5. Configure HTTP session state replication
14.5.6. Enabling session replication in your application
14.5.7. Use FIELD level replication
14.5.8. Monitoring session replication
14.5.9. Using Single Sign On
14.6. Clustered JMS Services
14.6.1. High Availability Singleton Fail-over
IV. Legacy EJB Support
15. EJBs on JBoss
15.1. The EJB Client Side View
15.1.1. Specifying the EJB Proxy Configuration
15.2. The EJB Server Side View
15.2.1. Detached Invokers - The Transport Middlemen
15.2.2. The HA JRMPInvoker - Clustered RMI/JRMP Transport
15.2.3. The HA HttpInvoker - Clustered RMI/HTTP Transport
15.3. The EJB Container
15.3.1. EJBDeployer MBean
15.3.2. Container Plug-in Framework
15.4. Entity Bean Locking and Deadlock Detection
15.4.1. Why JBoss Needs Locking
15.4.2. Entity Bean Lifecycle
15.4.3. Default Locking Behavior
15.4.4. Pluggable Interceptors and Locking Policy
15.4.5. Deadlock
15.4.6. Advanced Configurations and Optimizations
15.4.7. Running Within a Cluster
15.4.8. Troubleshooting
15.5. EJB Timer Configuration
16. The CMP Engine
16.1. Example Code
16.1.1. Enabling CMP Debug Logging
16.1.2. Running the examples
16.2. The jbosscmp-jdbc Structure
16.3. Entity Beans
16.3.1. Entity Mapping
16.4. CMP Fields
16.4.1. CMP Field Declaration
16.4.2. CMP Field Column Mapping
16.4.3. Read-only Fields
16.4.4. Auditing Entity Access
16.4.5. Dependent Value Classes (DVCs)
16.5. Container Managed Relationships
16.5.1. CMR-Field Abstract Accessors
16.5.2. Relationship Declaration
16.5.3. Relationship Mapping
16.6. Queries
16.6.1. Finder and select Declaration
16.6.2. EJB-QL Declaration
16.6.3. Overriding the EJB-QL to SQL Mapping
16.6.4. JBossQL
16.6.5. DynamicQL
16.6.6. DeclaredSQL
16.6.7. EJBQL 2.1 and SQL92 queries
16.6.8. BMP Custom Finders
16.7. Optimized Loading
16.7.1. Loading Scenario
16.7.2. Load Groups
16.7.3. Read-ahead
16.8. Loading Process
16.8.1. Commit Options
16.8.2. Eager-loading Process
16.8.3. Lazy loading Process
16.8.4. Lazy loading result sets
16.9. Transactions
16.10. Optimistic Locking
16.11. Entity Commands and Primary Key Generation
16.11.1. Existing Entity Commands
16.12. Defaults
16.12.1. A sample jbosscmp-jdbc.xml defaults declaration
16.13. Datasource Customization
16.13.1. Type Mapping
16.13.2. Function Mapping
16.13.3. Mapping
16.13.4. User Type Mappings
A. Book Example Installation
B. Use Alternative Databases with JBoss AS
B.1. How to Use Alternative Databases
B.2. Install JDBC Drivers
B.2.1. Special notes on Sybase
B.3. Creating a DataSource for the External Database
B.4. Change Database for the JMS Services
B.5. Support Foreign Keys in CMP Services
B.6. Specify Database Dialect for Java Persistence API
B.7. Change Other JBoss AS Services to Use the External Database
B.7.1. The Easy Way
B.7.2. The More Flexible Way
B.8. A Special Note About Oracle DataBases