Oracle Application Server 10g: J2EE Deployment and Administration by Michael Wessler et al. Apress © 2004 (596 pages) ISBN:1590592352 Ideal for anyone wanting to stay ahead in the world of Oracle’s application servers, this focused, no-frills guide will help you get J2EE applications up and running on 10g. Table of Contents Oracle Application Server 10g—J2EE Deployment and Administration Chapter 1 - Overview of Features, Editions, and Releases Chapter 2 - Developing with Oracle 10g As Chapter 3 - OC4J Installation and Runtime Behavior Chapter 4 - General Server Configuration Chapter 5 - Configuring JNDI and JDBC Services Chapter 6 - Configuring Java Message Service Chapter 7 - Security Chapter 8 - Using JavaMail and Java APIs for XML Chapter 9 - J2EE Application Deployment Chapter 10 - Web Applications Chapter 11 - Enterprise JavaBeans Chapter 12 - J2EE Connectors Chapter 13 - Configuring Web Services Chapter 14 - Application Clients Chapter 15 - Architecture and Deployment Topologies Chapter 16 - Installation and Administration Chapter 17 - Configuring J2EE Services Chapter 18 - Deploying Applications Chapter 19 - Configuring Web Caching Chapter 20 - Configuring Enterprise Security Chapter 21 - Configuring Clustering and Failover Appendix A - Server Configuration Files and Document Type Declaration Appendix B - Deployment Descriptors and Document Type Declaration Appendix C - Command-Line Utility Usage Appendix D - Debugging Tips List of Figures List of Tables List of Sidebars Oracle Application Server 10g—J2EE Deployment and Administration MICHAEL WESSLER WITH ERIN MULDER, ROB HARROP, AND JAN MACHACEK Copyright © 2004 by Michael Wessler, Erin Mulder, Rob Harrop, and Jan Machacek All rights reserved. No part of this work may be reproduced or transmitted in any form or by any means, electronic or mechanical, including photocopying, recording, or by any information storage or retrieval system, without the prior written permission of the copyright owner and the publisher. ISBN (pbk): 1-59059-235-2 Printed and bound in the United States of America 9 8 7 6 5 4 3 2 1 Trademarked names may appear in this book. Rather than use a trademark symbol with every occurrence of a trademarked name, we use the names only in an editorial fashion and to the benefit of the trademark owner, with no intention of infringement of the trademark. Lead Editor: Tony Davis Technical Reviewers: Jeremy Smith and Jakob Hammer-Jakobsen Editorial Board: Steve Anglin, Dan Appleman, Ewan Buckingham, Gary Cornell, Tony Davis, Jason Gilmore, Chris Mills, Steve Rycroft, Dominic Shakeshaft, Jim Sumser, Gavin Wray Project Manager: Beth Christmas Copy Edit Manager: Nicole LeClerc Copy Editor: Mark Nigara Production Manager: Kari Brooks Production Editor: Kelly Winquist Compositor: Diana Van Winkle, Van Winkle Design Group Proofreaders: Linda Seifert, Katie Stence, Greg Teague Indexer: Valerie Perry Artist: Diana Van Winkle, Van Winkle Design Group Book Designer: Diana Van Winkle, Van Winkle Design Group Cover Designer: Kurt Krames Manufacturing Manager: Tom Debolski Distributed to the book trade in the United States by Springer-Verlag New York, Inc., 233 Spring Street, 6th Floor, New York, NY 10013 and outside the United States by Springer-Verlag GmbH & Co. KG, Tiergartenstr. 17, 69112 Heidelberg, Germany. In the United States: phone 1-800-SPRINGER (1-800-777-4643), fax 201-348-4505, e-mail [email protected], or visit http://www.springer-ny.com. Outside the United States: fax +49 6221 345229, e-mail [email protected], or visit http://www.springer.de. For information on translations, please contact Apress directly at 2560 Ninth Street, Suite 219, Berkeley, CA 94710. Phone 510-549-5930, fax 510-549-5939, e-mail [email protected], or visit http://www.apress.com. The information in this book is distributed on an "as is" basis, without warranty. Although every precaution has been taken in the preparation of this work, neither the author(s) nor Apress shall have any liability to any person or entity with respect to any loss or damage caused or alleged to be caused directly or indirectly by the information contained in this work. The source code for this book is available to readers at http://www.apress.com in the Downloads section. To my grandmother Alma Johnson; for always being incredibly supportive and loving. —Michael Wessler About the Authors MICHAEL WESSLER received his BS in computer technology from Purdue University in West Lafayette, IN. He is an Oracle Certified Database Administrator for Oracle 8 and 8i, an Oracle Certified Web Administrator for 9iAS, and a 10g Database Technician. He has administered Oracle databases on Windows NT, and various flavors of UNIX and Linux, including clustered Oracle Parallel Server (OPS) environments. He also performs database and SQL/PLSQL tuning for applications. Michael has worked in many IT shops ranging from small dot-com Internet startups to large governmental agencies and corporations. Michael, who is currently consulting at the Department of Defense, is a technical manager for Perpetual Technologies, Inc. In addition to Oracle DBA consulting, Michael has worked extensively as an Oracle 9iAS web application server administrator. Currently, he manages multiple web applications for the Department of Defense and consults at various government agencies and in the private sector. Michael also frequently lectures on 9iAS and teaches Oracle performance-tuning classes. Michael can be reached at [email protected] or via his website at http://mike.wessler.name. Michael is the author of Oracle DBA on Unix and Linux (SAMS, 2002). He has also coauthored Oracle Unleashed, Second Edition (SAMS, 1997), Unix Primer Plus, Third Edition (Waite Group Press, 2000), COBOL Unleashed (SAMS, 1998), and Unix Unleashed, Fourth edition (SAMS 2002). Michael Wessler authored Chapters 9, 15–21, and the appendixes. ERIN MULDER has been working with Java since the earliest releases. In recent years, she has helped deliver many successful Java and J2EE applications, including real-time energy usage visualization, network management for video-on-demand servers, financial market analysis, federal government accounting, and contracts management. She uses a combination of open source and commercial tools, and specializes in making them work well together. Erin has also been a technical editor for several publications and has made presentations on a variety of topics at Java User Groups and JavaOne conferences. She is a software architect with Chariot Solutions, a Java consulting company in Philadelphia. Erin Mulder authored Chapters 3 and 4 and contributed material to Chapters 1–14. ROB HARROP is the lead software architect of UK-based development house, Cake Solutions Limited (www.cakesolutions.net). At Cake Solutions, Rob leads a team of six developers who work on enterprise solutions for a variety of clients including the Department of Trade and Industry, the Metropolitan Police, and NUS Services Limited. Rob and Cake Solutions specialize in both .NET and J2EE-based development, and Rob has been involved with .NET since the alpha stages. Rob is the author of Pro Jakarta Velocity: From Professional to Expert (Apress, not yet published), and coauthor of Pro Jakarta Struts, Second Edition (Apress, 2004) and Pro Visual Studio .NET (Apress, not yet published). In his limited spare time, Rob enjoys playing with different technologies, his current favorites being Groovy and aspect-oriented programming. Rob is a committer on the open-source Spring project (www.springframework.org), a Java and .NET application framework built around the principle of Dependency Injection. When not sitting in front of the computer, Rob usually has his head buried in a book and prefers the fantasy parodies of Terry Pratchett's Discworld. Rob Harrop authored Chapters 6–8 and 13, and contributed material to Chapters 1, 2, and 5. JAN MACHACEK is lead programmer of UK-based software company Cake Solutions Limited, where he has helped design and implement enterprise-level applications for a variety of UK- and US-based clients. In his spare time, he enjoys exploring software architectures, nonprocedural and AI programming, and playing with computer hardware. As a proper computer geek, Jan loves the Star Wars and The Lord of the Rings series. Jan lives in Manchester in the UK and can be reached at [email protected]. Jan Machacek authored Chapter 12 and contributed material to Chapters 10, 13, and 14. About the Technical Reviewers JER SMITH entered the high-technology world in 1993 when a friend convinced him to install Linux .99 and OS/2 2.1 over Windows 3.1 on his Packard Bell computer. In Salt Lake City, UT, he owns Anagnosis (not-not-know) Consulting, a system integration and UNIX education company. He's currently working with the Department of Veteran's Affairs building's next generation Java- based clinical information systems. JAKOB HAMMER-JAKOBSEN (born 1965) holds an MA in economic and political science and an MA in computer science. As a student, Jakob was developing student administrative programs for the university in Oracle version 5 and 6. After finishing school Jakob joined the original European distributor of Oracle TPI International, and worked as a system programmer for five years at large-scale Danish and European Oracle installations. For three years Jakob was a member of Oracle Premium Services in Denmark, which was part of Cary Millsap's system performance group network, as a principal senior analyst. After leaving Oracle in 2001, he joined Miracle A/S where he has been working with system architecture, optimization, and programming for the last four years. Jakob also spent a year in Sydney, Australia, where he founded Miracle Australia Pty Limited. He is a member of the OakTable network. Acknowledgments I would like to thank the following people who have been a wonderful help in writing this book as well as in my career. Jim Burcham, for getting me involved in Oracle application server and 9iAS in the beginning (at least, I think I thank him for that!). His guidance and logical engineering approach frequently "saves the day" for multiple systems and helps me solve many problems. Tige Chastain for his invaluable help in the arena of operating systems and networking. He's always the guy I call first for help when I have tough Linux and UNIX questions. Dan Wilson for showing me how to look at problems at a deeper integrated systems level rather than just looking at problems on the surface. His ability to architect and size systems has made my life easier. Ryan Stevens, Ron Plew, and Chris Zeis from Perpetual Technologies for providing multiple opportunities in the technical consulting world. Thanks guys! My family, especially my parents Jon and Barb, for always being supportive of my education, career, and writing. Jamie Miller, for her remarkable support and assistance while I was writing this. To my good friends Erik and Kalynn (and now Luke!), John and Dana, Jeff and Lindsey, TC and Colleen, and Ben, for being understanding whenever I disappear for a few months to write. I also would like to thank the wonderful professionals I've been able to work with at Apress: Tony Davis, Beth Christmas, Mark Nigara, and Kelly Winquist. —Michael Wessler I would like to thank Mom, Dad, the folks at Chariot, and especially Aaron for all the support and encouragement. I would also like to thank Tony Davis, Mark Nigara, Kelly Winquist, and Beth Christmas. —Erin Mulder Chapter 1: Overview of Features, Editions, and Releases Overview So you're ready to start evaluating Oracle Application Server 10g, but find yourself lost in a sea of editions, releases, and non-J2EE features. In this chapter, we'll cut through the marketing hype and look at exactly what each version has to offer. In particular, we'll cover the following: (cid:131) How to choose between the Java, Standard, and Enterprise Editions (cid:131) How to make sense of the release numbers (cid:131) Which J2EE technologies are standard in all application servers (cid:131) Which features are specific to Oracle 10g AS (cid:131) Some of the non-J2EE features in 10g AS such as Oracle HTTP Server (OHS), Oracle Internet Directory (OID), Single Sign-On (SSO), Web Cache, and Clustering Choosing an Edition Like most web application servers, Oracle 10g AS is available in a number of different editions, ranging from a small development-only J2EE server, to the full-fledged Enterprise installation. All of these include the basic J2EE containers (called Oracle 10g AS Containers for J2EE or OC4J), which provide support for Servlets, JavaServer Pages (JSPs), Enterprise JavaBeans (EJBs) and other standard J2EE technologies. Other, larger and more expensive versions include additional non-J2EE features such as Oracle's modified Apache web server, longtime Oracle products such as Portal, Forms, Reports, and Discoverer, Oracle's Identity Management products such as Oracle Internet Directory and SSO, and advanced features for high-performance and high- availability sites such as Web Cache and Clustering. There's no one size fits all so it's important to tailor the edition to the needs of your application. Here's a list of the editions of 10g AS that are available: (cid:131) OC4J Standalone (Oracle Application Server Containers for J2EE). This pure-Java, development-oriented edition supports all of the J2EE technologies with very little overhead. Instead of formal management or monitoring tools, it relies on commandline and file-based configuration. Its small installation size and memory footprint make it ideal for developer workstations. However, it's not intended for use in production systems. If you do choose to use it in production, you still must purchase one of the three editions described in this list. This version of the product is the primary focus of the development and deployment chapters of this book (Chapters 2–14). (cid:131) Java Edition. This low-end commercial edition includes all of the OC4J Standalone features and adds a web-based management tool, a more robust HTTP server (based on the open-source Apache web server), support for non-J2EE object-relational mapping through TopLink, and five licenses for JDeveloper, a full-featured Java IDE. (cid:131) Standard Edition. This edition includes everything found in the Java edition and adds Portal, SSO, and Content Management capabilities. While the Java Edition is well suited for independent J2EE applications, these more advanced features allow you to link lots of different applications across an enterprise system, presenting one common view to users (often through an Enterprise Information Portal or EIP). (cid:131) Enterprise Edition. This high-end edition includes everything found in the Standard Edition and adds web caching (Oracle Web Cache), enterprise integration (including Oracle SSO), directory services (OID), data analysis and reporting (Business Intelligence through Oracle Reports and Discoverer), and Oracle Forms. Additionally, this version provides the ability to implement clustered J2EE instances fronted by Web Cache, which provides the maximum load-balancing and high-availability benefits. These features give you additional scalability, interoperability and real-time analysis while being the deployment vehicle for longtime Oracle products such as Forms, Reports, and Discoverer. This Enterprise Edition generally requires an infrastructure database (provided with the product installation) to support the advanced features. It's this product that is the focus of the administration chapters of this book (Chapters 15– 21). The following table gives you a quick comparison of the cost, size, and features of each edition, at the time of writing (June 2004). Each of the features listed will be described in more detail later in this chapter. Table 1-1: Comparison of Oracle 10g AS Editions Feature OC4J Java Standard Enterprise Standalone Edition Edition Edition List price Included with $5,000/CP $10,000/CPU $20,000/CPU each of the U other editions Download size 28 MB Over 500 Not Over 2 GB MB individually downloadable Configuration Manual Enterprise Enterprise Enterprise type Mgr Mgr Mgr J2EE Yes Yes Yes Yes containers HTTP server Yes Yes Yes JDeveloper Yes Yes Yes TopLink Yes Yes Yes Application Yes Yes Yes Server Control Portal Yes Yes Single Sign-On Yes Yes Content Yes Yes Management Web Caching Yes Integration Yes Oracle Internet Yes Directory Discoverer Yes Reports Service Yes Personalization Yes Table 1-1: Comparison of Oracle 10g AS Editions Feature OC4J Java Standard Enterprise Standalone Edition Edition Edition Wireless Yes Deciding Which Features You Need In the end, the Standard and Enterprise offerings are just convenient package deals on a number of extra, (non-J2EE) add-on products. Thus, when choosing an edition, your first step should be to decide which of these add-on products you actually need. Then you should compare the bundled Oracle options with competing products from other vendors to determine which are the most appropriate and cost effective for your needs. For example, if you'll be running a number of intranet applications within Oracle 10g AS and would like users to be able to use the same username and password for each of them, then you'll probably be interested in SSO functionality. In this case, one option is to purchase the Oracle 10g AS Standard Edition and use the built-in Oracle SSO features. However, if Oracle SSO doesn't meet your needs, then you can always stay with the Oracle 10g AS Java Edition and buy a third- party SSO integration product such as RSA ClearTrust. One important factor to consider is your overall commitment to the Oracle 10g AS platform. Pure J2EE applications are very portable, but as you begin integrating additional Oracle products, you may become "locked in" to Oracle 10g AS and find it harder to migrate to other application servers. If you think that you may eventually move to another vendor, like BEA or IBM, then it may be worthwhile to choose third-party add-on products that integrate well with multiple application servers. On the other hand, if you're sure that your applications will be running on Oracle for years to come, then the integrated management and discount pricing of the Oracle add-on products may save a lot of time and money. This is especially true for companies that already use Oracle for their database. One of the compelling arguments for choosing Oracle 10g AS, if you already use Oracle databases, is the tight integration of the database with the application server, and the performance and administrative benefits that this can bring. The following criteria in Table 1-2 may be helpful when making your decision. Table 1-2: Tips for Choosing an Oracle 10g AS Edition If You're Building and Deploying… Consider… One J2EE application Java Edition Several unrelated J2EE applications Java Edition Corporate intranet or portal Standard Edition (or third-party portal and SSO products) Applications that integrate with many Enterprise Edition (or third-party integration external systems or business partners products) Oracle PL/SQL Web Toolkit Standard or Enterprise Edition Oracle Portal Standard or Enterprise Edition Oracle Forms, Reports, Discoverer Enterprise Edition using Oracle Business Intelligence option High-traffic e-commerce sites Enterprise Edition using Oracle Web Cache
Description: