Table Of ContentJBoss in Action
JBoss in Action
C JB A S
ONFIGURING THE OSS PPLICATION ERVER
JAVID JAMAE
PETER JOHNSON
MANNING
Greenwich
(74° w. long.)
For online information and ordering of this and other Manning books, please visit
www.manning.com. The publisher offers discounts on this book when ordered in quantity.
For more information, please contact
Special Sales Department
Manning Publications Co.
Sound View Court 3B fax: (609) 877-8256
Greenwich, CT 06830 email: [email protected]
©2009 by Manning Publications Co. All rights reserved.
No part of this publication may be reproduced, stored in a retrieval system, or transmitted, in
any form or by means electronic, mechanical, photocopying, or otherwise, without prior written
permission of the publisher.
Many of the designations used by manufacturers and sellers to distinguish their products are
claimed as trademarks. Where those designations appear in the book, and Manning
Publications was aware of a trademark claim, the designations have been printed in initial caps
or all caps.
Recognizing the importance of preserving what has been written, it is Manning’s policy to have
the books we publish printed on acid-free paper, and we exert our best efforts to that end.
Recognizing also our responsibility to conserve the resources of our planet, Manning books are
printed on paper that is at least 15% recycled and processed without the use of elemental chlorine.
Development Editor Nermina Miller
Manning Publications Co. Copyeditor: Andrea Kaucher
Sound View Court 3B Typesetter: Gordan Salinovic
Greenwich, CT 06830 Cover designer: Leslie Haimes
ISBN 978-1-933988-02-3
Printed in the United States of America
1 2 3 4 5 6 7 8 9 10 – MAL – 14 13 12 11 10 09
brief contents
P 1 T JB A S ...........................................1
ART HE OSS PPLICATION ERVER
1 ■ Vote for JBoss 3
2 ■ Managing the JBoss Application Server 28
3 ■ Deploying applications 47
4 ■ Securing applications 73
P 2 A .................................................... 107
ART PPLICATION SERVICES
5 ■ Configuring JBoss Web Server 109
6 ■ Securing web applications 135
7 ■ Configuring enterprise applications 161
8 ■ JBoss Messaging 201
9 ■ Configuring Web Services 235
P 3 JB P ............................................................... 261
ART OSS ORTAL
10 ■ The JBoss Portal and portlets 263
11 ■ Configuring the JBoss Portal 289
v
vi BRIEF CONTENTS
P 4 G .................................................. 319
ART OING TO PRODUCTION
12 ■ Understanding clustering 321
13 ■ Clustering JBoss AS services 353
14 ■ Tuning the JBoss Application Server 374
15 ■ Going to production 408
contents
preface xvii
acknowledgments xx
about this book xxii
about the cover illustration xxix
P 1 T JB A S .......................... 1
ART HE OSS PPLICATION ERVER
1 Vote for JBoss 3
1.1 Introducing JBoss 4
What is JBoss? 4 ■ Exploring the JEMS lineup 6 ■ Why is JBoss AS
so popular? 7
1.2 Installing JBoss Application Server 9
Preparing for the installation 10 ■ Installing from the binary
distribution 11 ■ Using the JEMS Installer 11
1.3 Exploring the installation 13
The bin directory 13 ■ The client directory 14 ■ The docs directory 15
The lib directory 15 ■ The server directory 15 ■ Understanding server
configurations 16 ■ Exploring the configuration structure 17
Customizing your configuration 19
vii
viii CONTENTS
1.4 Starting and stopping the server 20
Starting the server 20 ■ Starting an alternative configuration 21
Verifying that the server is running 22 ■ Stopping the server 23
1.5 Deploying to the server 23
Creating the application 24 ■ Deploying the application 25
Undeploying the application 26
1.6 Summary 27
1.7 References 27
2 Managing the JBoss Application Server 28
2.1 Examining the JBoss Application Server architecture 29
Understanding the microcontainer 29 ■ Understanding JMX 31
2.2 Configuring the application server 33
Configuring logging 34 ■ Configuring directory locations 37
Defining system properties 39
2.3 Exploring the management tools 40
Using the JMX Console 40 ■ Using the twiddle utility 42
2.4 Examining interesting MBeans 43
Viewing system properties 44 ■ Viewing the JNDI namespaces 44
Changing the logging levels 45 ■ Increasing the thread pool size 46
Obtaining application server information 46
2.5 Summary 46
2.6 References 46
3 Deploying applications 47
3.1 Understanding deployment 48
Deploying an application 48 ■ Understanding application packaging 49
Understanding application types 50 ■ Understanding deployment order-
ing 52 ■ Deployment configuration options 52
3.2 Understanding class loading 55
Understanding multiple class loaders 55 ■ Scoping classes 56
Understanding loader repositories 57
3.3 Fixing common deployment errors 58
Class not found exception 58 ■ Duplicate JAR files 59 ■ Zip file
errors 60 ■ Class cast exception 60
3.4 Deploying miscellaneous applications 61
Deploying data sources 61 ■ Deploying a Hibernate archive 67
CONTENTS ix
3.5 Summary 72
3.6 References 72
4 Securing applications 73
4.1 Understanding security 74
Understanding application security 75 ■ Understanding authentica-
tion 76 ■ Understanding authorization 77 ■ Configuring security 78
Dynamic login configuration 80 ■ Logging security on the server 81
4.2 Using secure communication 82
Understanding symmetric and asymmetric encryption 82
Understanding certificates and source authentication 84
Creating and signing certificates 85 ■ Modifying the cacerts file 87
Understanding certificate-based client authentication 87
Configuring an SSL-aware security domain 90
4.3 Configuring login modules 91
Using the file-based login module 92 ■ Using the database login
module 94 ■ Using the LDAP login module 95 ■ Using the identity
login module 102 ■ Stacking login modules 102 ■ Using the client
certificate login module 104
4.4 Summary 105
4.5 References 105
P 2 A ..................................... 107
ART PPLICATION SERVICES
5 Configuring JBoss Web Server 109
5.1 Understanding web applications 110
Understanding the web application structure 110 ■ Understanding
web application configuration 111
5.2 Configuring JBoss Web Server 115
Locating key directories 115 ■ Exploring JBoss Web Server Configura-
tion 116 ■ Exploring the WAR deployer configuration file 119
5.3 Configuring URL paths 120
Enabling virtual hosts 121 ■ Configuring context paths 123
Changing the root context path 125
5.4 Configuring connectors 126
Understanding connector configuration 128 ■ Configuring
concurrency 129 ■ Configuring timeouts 129 ■ Configuring a
proxy hostname and port 129