BEA Weblogic(R) Server Bible
Joe Zuffoletto, John Wiley & Sons ISBN:0764548549, Edition: 1st, 2002-02-21 Price: $49.99
Table of Contents
BEA WebLogic Server Bible ~ 1
Part I: Preparing Your Enterprise for WebLogic ~ 5
In This Part ~ 5
Chapter 1: A Quick Tour of WebLogic Server ~ 6
Introducing WebLogic Server ~ 6
Taking WebLogic for a Spin ~ 8
Spotting WebLogic in the Real World ~ 10
Sparks.com ~ 12
Surveying WebLogic's Features, Services, and Architecture ~ 12
HTTP server ~ 12
J2EE containers ~ 13
Gateway to the J2EE APIs ~ 13
Web Services ~ 14
J2EE Connector Architecture ~ 14
CORBA support ~ 14
Security services ~ 15
Clustering services ~ 16
Management and monitoring tools ~ 16
Understanding WebLogic's Role in the Enterprise ~ 17
Is WebLogic Right for Your Project? ~ 18
Summary ~ 18
Chapter 2: Assembling and Managing a WebLogic Development Team ~ 20
What WebLogic Developers Need to Know ~ 20
Object-oriented programming in Java ~ 20
J2EE ~ 21
Object-Oriented Analysis and Design ~ 21
HTML and JavaScript ~ 22
XML ~ 22
TCP/IP networking and distributed systems ~ 22
Relational databases and SQL ~ 23
Legacy systems ~ 23
Collaborative discipline ~ 24
Project Team Roles and Responsibilities ~ 26
Project manager ~ 26
Application architect ~ 27
Database designer/database administrator ~ 27
User Interface (UI) designer ~ 28
Java/J2EE developer ~ 28
Quality Assurance (QA) team ~ 29
Documentation team ~ 30
WebLogic administrator ~ 30
Project Management Strategies ~ 31
Gathering requirements ~ 31
Designing the solution ~ 32
Managing development ~ 32
Planning the rollout ~ 33
Keeping morale high ~ 34
Summary ~ 35
Chapter 3: Designing WebLogic Applications ~ 36
Overview ~ 36
Understanding Multitier Applications ~ 36
How J2EE separates applications into tiers ~ 36
The Model-View-Controller design pattern ~ 37
Model-View-Controller in action: An ATM machine ~ 38
Model-View-Controller as a methodology for designing multitier applications ~ 38
Building Multitier Applications with J2EE: Containers and Components ~ 39
Containers ~ 39
Components ~ 40
Organizing Components into Applications ~ 41
Model tier patterns ~ 42
View tier patterns ~ 43
Controller tier patterns ~ 44
Deploying Components in WebLogic's Containers ~ 46
Designing an Example Application: WebLogic Online Brokerage ~ 47
Identifying requirements ~ 47
Organizing requirements by user role ~ 49
Expressing requirements in use case diagrams ~ 51
Exploding use cases into activity diagrams ~ 52
Mapping functionality to MVC with swimlanes ~ 53
Selecting appropriate J2EE components and modeling their interactions ~ 55
Other considerations ~ 56
Summary ~ 58
Chapter 4: Creating a WebLogic Environment ~ 59
Overview ~ 59
Configuring a Computer for Development ~ 59
Obtaining a Copy of WebLogic Server ~ 60
Installing WebLogic Server ~ 60
Running the installer ~ 61
Starting WebLogic Server ~ 65
Running the WebLogic Console ~ 66
Shutting down WebLogic Server ~ 66
Optimizing the WebLogic Server startup process for development ~ 67
Examining the environment ~ 68
Adding domains for testing and production ~ 70
Installing JDBC Drivers ~ 73
Selecting an IDE to use with WebLogic Server ~ 74
Summary ~ 74
Part II: WebLogic and the J2EE APIs ~ 75
In This Part ~ 75
Chapter 5: Working with WebLogic JDBC ~ 76
Overview ~ 76
Understanding JDBC ~ 76
JDBC versions and packages ~ 76
JDBC architecture ~ 77
Understanding WebLogic JDBC ~ 83
WebLogic and third-party drivers ~ 83
MultiPools ~ 85
DataSources ~ 86
Clustered JDBC ~ 87
Configuring WebLogic JDBC ~ 87
Configuring connection pools ~ 87
Configuring MultiPools ~ 93
Configuring DataSources ~ 95
Configuring Tx DataSources ~ 97
Programming WebLogic JDBC ~ 97
Obtaining connections ~ 98
Using Connections to execute Statements and process Results ~ 101
Closing connections ~ 102
Summary ~ 103
Chapter 6: Working with WebLogic JTA ~ 104
Overview ~ 104
Understanding Transactions ~ 104
What is a transaction? ~ 104
Transactions and the ACID test ~ 105
Resources and resource managers ~ 105
Local and distributed transactions ~ 105
Transaction isolation levels ~ 106
Transaction demarcation ~ 108
Two-phase commit and the XA interface ~ 109
Understanding JTA ~ 109
JTA versions and packages ~ 110
JTA architecture ~ 110
Transaction-aware resource managers ~ 110
Configuring WebLogic JTA ~ 112
Programming WebLogic JTA ~ 113
Programming a local transaction with the WebLogic JTS driver ~ 113
Programming a distributed transaction with the Oracle XA driver ~ 116
Summary ~ 120
Chapter 7: Working with WebLogic JNDI ~ 121
Overview ~ 121
Understanding JNDI ~ 121
JNDI versions and packages ~ 121
JNDI architecture ~ 122
Programming WebLogic JNDI ~ 125
Obtaining a reference to WebLogic's context ~ 125
Binding objects to the WebLogic JNDI tree ~ 127
Using subcontexts to organize the JNDI tree ~ 127
Performing lookups on objects bound to the WebLogic JNDI tree ~ 128
Performing lookups against an LDAP directory ~ 129
Using WebLogic JNDI to Deploy Objects in a Clustered Environment ~ 133
Write an RMI proxy for the custom object ~ 134
Pin the custom object to one server ~ 134
Deploy the custom object separately to all servers ~ 134
Summary ~ 135
Chapter 8: Working with WebLogic RMI ~ 136
Overview ~ 136
Understanding RMI ~ 136
RMI versions and packages ~ 136
RMI architecture ~ 138
Comparing WebLogic RMI to JavaSoft RMI ~ 140
Ease-of-use ~ 141
Performance and scalability ~ 141
Writing Your First WebLogic RMI Application ~ 144
Write the remote interface ~ 145
Write the server ~ 145
Compile the remote interface and the server ~ 146
Generate stubs and skeletons for the server ~ 147
Write a client that remotely calls the server ~ 147
Compile the client ~ 148
Configure the RMI server as a WebLogic startup class ~ 148
Stop and restart WebLogic Server ~ 150
Verify correct deployment of the RMI server ~ 150
Run the client and test the server ~ 151
Using WebLogic RMI with JNDI and Multiple Clients ~ 152
Building a server ~ 152
Building the clients ~ 155
Invoking Client Methods from RMI Servers ~ 161
Calling EJBs from RMI Servers ~ 166
Summary ~ 168
Chapter 9: Working with WebLogic JMS ~ 169
Understanding JMS ~ 169
JMS versions and packages ~ 169
JMS architecture ~ 169
Configuring WebLogic JMS ~ 173
Creating a connection factory ~ 174
Defining a file backing store ~ 176
Defining a JDBC backing store ~ 177
Defining destination keys ~ 178
Defining templates ~ 179
Defining a JMS server ~ 180
Creating a message queue ~ 181
Creating a message topic ~ 182
Programming WebLogic JMS ~ 183
Sending messages ~ 183
Receiving messages synchronously ~ 191
Receiving messages asynchronously ~ 196
Receiving messages concurrently using session pools ~ 202
Filtering incoming messages ~ 205
Browsing messages in a queue ~ 207
Creating durable subscribers to topics ~ 208
Working with Transactions ~ 210
Working with JMS transacted sessions ~ 210
Working with JTA transactions ~ 211
Summary ~ 219
Chapter 10: Working with WebLogic JavaMail ~ 221
Understanding JavaMail ~ 221
JavaMail versions and packages ~ 221
JavaMail architecture ~ 221
Configuring WebLogic JavaMail ~ 226
Creating a mail session ~ 226
Adding POP3 to WebLogic ~ 227
Sending Messages with WebLogic JavaMail ~ 228
Obtaining a mail session via JNDI ~ 228
Sending a simple message ~ 229
Deployment descriptor for the examples ~ 229
Example: Send Mail servlet ~ 230
Overriding mail session properties ~ 232
Authenticating a mail session ~ 233
Sending an enclosure using a MimeMultipart ~ 234
Example: Send Mail servlet 2 ~ 234
Sending a message to multiple recipients (bulk mail) ~ 237
Navigating stores ~ 238
Retrieving and Displaying Messages with WebLogic JavaMail ~ 241
Listing messages ~ 242
Example: Display messages ~ 242
Analyzing message flags ~ 246
Deleting a message ~ 247
Expunging messages ~ 247
Example: Displaying message details ~ 248
Summary ~ 253
Part III: Developing Web Components ~ 254
In This Part ~ 254
Chapter 11: Developing Servlets ~ 255
Overview ~ 255
Understanding Servlets ~ 256
The servlet API: Versions and packages ~ 256
The Web container and Web applications ~ 257
How servlets work ~ 259
When to use servlets ~ 261
The servlet life cycle ~ 261
Programming Servlets ~ 262
Creating a simple Web application ~ 262
Writing a simple servlet ~ 264
Deploying and testing the servlet ~ 266
Advanced Servlet Programming Techniques ~ 267
Working with sessions ~ 267
Working with the servlet context ~ 272
Dispatching requests to other resources ~ 273
Securing your application ~ 274
Building an Advanced Application with Servlets ~ 277
Gathering the requirements ~ 277
Brainstorming a design ~ 278
Building the application ~ 278
Deploying the application as a WAR file ~ 294
Summary ~ 295
Chapter 12: Developing JavaServer Pages ~ 296
Overview ~ 296
Understanding JavaServer Pages ~ 296
Product of evolution ~ 296
How JSPs work ~ 297
Model-View-Controller ~ 298
Configuring WebLogic Server for JSPs ~ 299
The JSP compiler ~ 299
Configuring the WebLogic Application Extension Deployment Descriptor ~ 300
Deploying your first JSP in WebLogic Server ~ 307
Support for JSP 1.2 ~ 310
Programming JavaServer Pages ~ 310
Tag conventions ~ 311
Directives ~ 311
Scripting ~ 314
Comments ~ 317
Implicit objects ~ 318
Actions ~ 320
JSP example ~ 322
Error handling ~ 329
Debugging ~ 330
Programming JSPs with JavaBeans ~ 332
Deploying your first JavaBean ~ 332
JSP bean tags ~ 334
JSP and JavaBean example ~ 339
Using servlets to handle requests ~ 341
Summary ~ 345
Chapter 13: Developing Tag Libraries ~ 346
Understanding Tag Libraries ~ 346
Tag handler lifecycle ~ 346
Tag handlers and the Tag Extension API ~ 349
Main interfaces ~ 349
Convenience classes ~ 350
Supporting interfaces and classes ~ 354
Programming and Using a Tag Extension ~ 357
Programming a tag handler class ~ 357
Defining a Tag Library Descriptor ~ 360
Configuring the WebLogic Web application deployment descriptor ~ 364
Using a tag extension within a JSP ~ 365
Resolving a tag extension ~ 369
Programming a TagExtraInfo Class ~ 370
WebLogic Tag Libraries ~ 373
WebLogic JSP form validation tags ~ 373
WebLogic custom JSP tags ~ 375
WebLogic EJB-to-JSP Integration Tool ~ 375
Summary ~ 376
Part IV: Developing EJB Components ~ 377
In This Part ~ 377
Chapter 14: Understanding Enterprise JavaBeans ~ 378
Overview ~ 378
EJB Architecture ~ 379
EJB Types ~ 379
Session beans ~ 379
Entity beans ~ 380
Message-driven beans ~ 380
EJB Client-Access Models ~ 381
EJB Components ~ 381
Home interface ~ 382
Remote interface ~ 383
Implementation class ~ 384
Deployment descriptors ~ 386
WebLogic's EJB Container Services ~ 389
Lifecycle management ~ 389
Transaction support ~ 389
Persistence ~ 391
Clustering support ~ 391
Security ~ 392
EJB 1.1 versus 2.0 ~ 392
New: Message-driven beans ~ 392
Improved: CMP for entity beans ~ 392
Summary ~ 394
Chapter 15: Developing Session Beans ~ 395
Overview ~ 395
Common session bean uses ~ 396
Using session EJBs to model workflow ~ 396
Client-server architecture ~ 396
EJB Container functionality ~ 396
No synchronization issues ~ 396
Inherently reusable ~ 396
Scalability ~ 397
Comparing Stateless and Stateful Beans ~ 397
Programming Session Beans ~ 399
Home interfaces ~ 399
Session EJB interfaces ~ 400
Implementation class ~ 401
Stateful EJB example-AnalyzePortfolio ~ 413
Clustering Session Beans ~ 419
Programming Transactions in Session Beans ~ 420
Summary ~ 420
Chapter 16: Developing Entity Beans ~ 421
Overview ~ 421
Understanding Entity Beans ~ 421
Entity beans and persistence ~ 421
Types of entity beans ~ 421
Entity bean lifecycle ~ 421
EJB 2.0 ~ 422
CMP relationships ~ 422
Local interfaces ~ 423
CMP abstract persistence schema ~ 423
EJB QL ~ 423
Entity Bean Component Files ~ 424
Programming BMP ~ 424
Define the home interface ~ 424
Define the local home interface ~ 425
Define the remote interface ~ 425
Define the local interface ~ 426
Create the bean ~ 426
Create the primary key class (optional) ~ 434
Create value object class (optional) ~ 434
Create the deployment descriptors ~ 436
Notes ~ 438
Programming CMP ~ 438
Create the Department bean ~ 438
Define the Course bean ~ 443
Create the deployment descriptors ~ 447
Deployment to WebLogic ~ 458
Advanced WebLogic Features for Entity Beans ~ 458
Concurrency and locking ~ 458
Automatic table creation ~ 460
CMP, BMP, and Other Options ~ 460
Trade-offs between BMP and CMP ~ 460
Session beans ~ 461
Java Data Objects ~ 461
Third-Party Tools ~ 461
WebGain Studio ~ 461
JBuilder ~ 461
Cocobase Enterprise O/R ~ 462
TogetherSoft Control Center ~ 462
Summary ~ 462
Chapter 17: Developing Message-Driven Beans ~ 463
Overview ~ 463
Understanding Message-Driven Beans ~ 463
Versions and packages ~ 463
How message-driven beans differ from other EJBs ~ 463
Deciding whether to write a message-driven bean or a JMS client ~ 464
Programming Message-Driven Beans ~ 465
The MessageDrivenBean interface-javax.ejb.MessageDrivenBean ~ 465
The message-driven bean context ~ 465
Implementing business logic ~ 466
Deploying Message-Driven Beans in WebLogic Server ~ 467
Deployment descriptors ~ 467
Transaction attributes ~ 468
Deploying message-driven beans using WebLogic Console ~ 469
Building an Application Using Message-Driven Beans and XML ~ 470
The business problem: Sending medical prescriptions over a wireless network ~ 470
Application design issues ~ 470
Source code ~ 471
Deploying the message-driven bean ~ 476
Summary ~ 478
Part V: Deploying and Testing Enterprise Applications ~ 479
In This Part ~ 479
Chapter 18: Assembling and Deploying WebLogic Applications ~ 480
Packaging J2EE Applications ~ 480
Deployment descriptors ~ 480
JAR-Java archive format ~ 481
Web Applications Structure and Packaging ~ 482
Steps to create a Web application ~ 482
Web application directory structure ~ 483
Configuring your Web application ~ 484
Packaging Enterprise JavaBeans ~ 494
Packaging Enterprise Applications ~ 494
Classloading in Enterprise Applications and WebLogic Server ~ 496
Third-Party and Utility Classes ~ 497
Root classloader ~ 497
Put it everywhere ~ 497
The JAR manifest file class-path header ~ 497
Summary ~ 498
Chapter 19: Testing and Tuning WebLogic Applications ~ 499
Understanding Performance Tuning ~ 499
Determining performance goals ~ 499
Load testing ~ 500
Areas of performance tuning ~ 504
WebLogic Server Performance Monitoring ~ 505
Monitoring WebLogic Servers with the console ~ 505
Monitoring performance graphs from the console ~ 505
Monitoring active queues, connections, and sockets ~ 506
Monitoring CPU utilization ~ 507
JVM options for performance monitoring ~ 508
Tuning WebLogic Server ~ 509
Basic server configuration ~ 509
JDBC tuning considerations ~ 512
EJB tuning considerations ~ 513
Tuning the WebLogic Server's JVM ~ 513
Heap sizes ~ 513
Garbage collection ~ 514
Client/Server JVM options ~ 514
Tuning WebLogic Server Applications ~ 514
Tuning JDBC modules within your application ~ 514
EJB considerations ~ 515
Asynchronous components ~ 515
Singletons ~ 516
Transaction considerations ~ 516
Logging considerations ~ 516
Compiler settings ~ 516
Nonsynchronized collections ~ 516
Placing objects in sessions ~ 516
WebLogic Server clustering overview ~ 517
Tuning Process Example ~ 518
Define performance goals ~ 518
The application tuning process ~ 518
Load testing ~ 519
Summary ~ 521
Part VI: Implementing Security ~ 522
In This Part ~ 522
Chapter 20: Understanding Security Fundamentals ~ 523
Overview ~ 523
Security Layers ~ 523
Authentication layer ~ 525
Authorization layer ~ 526
Integrity layer ~ 533
Auditing layer ~ 537
Security Perimeters ~ 537
Security Attacks ~ 539
IP spoofing ~ 539
DNS spoofing ~ 539
Trapdoors ~ 540
Logic bombs ~ 540
Worms ~ 540
Trojan horses ~ 540
Ciphers, Keys, and Secure Sockets ~ 541
Summary ~ 544
Chapter 21: Understanding WebLogic's Security Architecture ~ 545
Introduction to WebLogic Security Architecture ~ 545
Understanding JAAS ~ 546
Pluggable Authentication Modules ~ 546
LoginContext ~ 547
Security realms ~ 548
WebLogic Service Provider Interface ~ 550
WebLogic Enterprise Connectivity ~ 550
Authentication layer ~ 551
Authorization layer ~ 554
Summary ~ 555
Chapter 22: Securing a WebLogic Application ~ 556
Introduction to JAAS Programming ~ 556
Writing and configuring the LoginContext ~ 557
Writing a LoginModule ~ 560
Writing the CallbackHandler ~ 562
Writing JAAS for WebLogic Server ~ 564
Authorization and the Security Realm ~ 570
Building a Custom RDBMS Security Realm ~ 571
Define the data store ~ 571
Define the custom classes ~ 571
Authenticate users ~ 578
Determining if the user belongs to a group ~ 579
Get users and groups from security store ~ 579
Auditing in WebLogic Server ~ 581
Summary ~ 582
Part VII: WebLogic Server Administration ~ 583
In This Part ~ 583
Chapter 23: Working with WebLogic's Administration Tools ~ 584
Overview ~ 584
Administering WebLogic Server Using the WebLogic Console ~ 584
Console ~ 585
Domain information ~ 586
Servers ~ 594
Clusters ~ 614
Machines ~ 615
Deployments ~ 616
Services ~ 616
Security ~ 628
Domain log filters ~ 628
Administering WebLogic Using Command-Line Tools ~ 629
Summary ~ 630
Chapter 24: Working with WebLogic Clusters ~ 631
Overview ~ 631
Building a Simple Cluster ~ 632
Designing the cluster topology ~ 632
Creating the cluster ~ 633
Accessing a Cluster through an HTTP Proxy ~ 637
Deploying a Web Application to the Cluster ~ 639
Testing a Clustered Web Application ~ 643
Session State Persistence Strategies ~ 645
Clusters and J2EE Services ~ 646
Cluster-wide JNDI tree ~ 646
Load balancing JDBC connections ~ 646
Load balancing JMS connection factories ~ 647
Clustering of RMI Objects and EJBs ~ 648
Summary ~ 648
Chapter 25: Managing WebLogic Security ~ 649
Overview ~ 649
Configuring the File Realm ~ 649
Configuring the NT Realm ~ 654
Configuring the Unix Realm ~ 655
Configuring the LDAP Realm ~ 655
Configuring the RDBMS realm ~ 661
Configuring the Secure Socket Layers (SSL) protocol ~ 665
Configuring the connection filter ~ 667
Summary ~ 669
Part VIII: Enterprise Application Integration ~ 671
In This Part ~ 671
Chapter 26: Working with Web Services, SOAP, and WSDL ~ 672
Web Services and Java Data Type Restrictions ~ 672
How Web Services Work in WebLogic ~ 674
XML ~ 674
HTTP ~ 674
SOAP ~ 675
WSDL ~ 675
Jakarta Ant ~ 675
Building Web Services ~ 676
Types of Web services ~ 676
Getting the Client.jar file and the WSDL ~ 678
Creating a Remote Procedure Call Web service ~ 679
Creating a Consumer Message-Style Web service ~ 684
Building a Message-Style producer Web service ~ 688
Other Web-Service Technologies ~ 692
Jakarta Ant ~ 693
UDDI ~ 698
Future J2EE and IDE support ~ 698
Summary ~ 698
Chapter 27: Working with WebLogic and the J2EE Connector Architecture ~ 699
Overview ~ 699
Understanding the J2EE Connector Architecture ~ 700
Key concepts ~ 700
System contracts ~ 703
Security Management contract ~ 707
Common Client Interface ~ 708
Using the J2EE Connector Architecture in WebLogic ~ 712
Configuration ~ 714
Development ~ 715
Logging ~ 715
Deployment ~ 715
Summary ~ 717
Appendix: Upgrading to WebLogic Server 6.1 from Earlier Versions ~ 719
Upgrading WebLogic Server ~ 719
Upgrading the WebLogic license file ~ 719
Converting the weblogic.properties file ~ 720
Upgrading WebLogic Applications ~ 726
Migrating J2EE Web applications ~ 726
Migrating EJB applications ~ 728
Migrating EJBs from 1.1 to 2.0 ~ 728
Removed and Deprecated Features ~ 729
Removed APIs and features ~ 729
Deprecated APIs ~ 730
Where to Find More Information ~ 730
|