Skip Headers
Oracle® Containers for J2EE Developer's Guide
10
g
(10.1.3.5.0)
Part Number E13979-01
Home
Book List
Index
Contact Us
Next
View PDF
Contents
List of Examples
List of Figures
List of Tables
Title and Copyright Information
Preface
Intended Audience
Documentation Accessibility
Related Documents
Conventions
1
Getting Started with OC4J
Introduction to OC4J
J2EE Support in OC4J
New Features in OC4J
Support for Web Services
Support for J2EE 1.4 Application Management and Deployment Specifications
Support for Oracle Application Server TopLink
Oracle Job Scheduler
Two-Phase Commit Transaction Coordinator Functionality
Generic JMS Resource Adapter Enhancements
Support for the Enterprise JavaBeans 3.0
Support for the <library-directory> Element
Information in the OC4J Documentation Set
OC4J Installation
2
Developing Startup and Shutdown Classes
Developing Startup Classes
Developing Shutdown Classes
3
Utilizing the OC4J Class-Loading Framework
Class Loading in OC4J
Overview of Class Loading
Peek Utility for Debugging Class Loaders
Class Versioning with Shared Libraries in OC4J
Shared Libraries That Applications Import by Default
Configuring an Application to Import a Nondefault Version of a Shared Library
Example: Importing an Earlier Version of the Oracle JDBC Driver
Example: Configuring an Application to Use a DataDirect JDBC Driver
Removing or Replacing an Oracle Shared Library Imported by Default
Example: Replacing the Oracle XML Parser with the Xerces Parser
Example: Removing an Oracle Shared Library at Deployment Time
Using a Packaged JAR Instead of an Oracle Shared Library
Configuring an Application to Use Its Own Shared Library
Specifying search-local-classes-first at Deployment Time
Installing and Publishing a Shared Library in OC4J
When You Should Use a Shared Library
Options for Installing and Publishing a Shared Library
How a Shared Library Is Installed and Published in an OC4J Instance
Configuring an Application to Import a Shared Library
Declaring Dependencies in an Application's OC4J Deployment Descriptor
Declaring Dependencies in an Application's Manifest File
Configuring All Deployed Applications to Import a Specific Shared Library
Sharing Libraries Using the applib Directory
Specifying a Library Directory in application.xml
Using Best Practices for Class Loading
Troubleshooting Class-Loading Problems in OC4J
Specifying a Built-In Query
Specifying a Query in Peek
Specifying a Query in a Startup Property
Specifying Queries at Runtime Through the ClassLoading MBean
Auditing Class Loaders
How to Audit Class Loaders with Peek
What Happens When You Audit Class Loaders
What You May Need to Know About AuditLoader
Finding Classes That Call a Method
How to Find Classes That Call a Method with the Callers Query
What You May Need to Know About Callers
Monitoring Metrics for Class Loaders
How to Monitor Metrics for Class Loaders with the ClassLoadMetrics Query
What You May Need to Know About ClassLoadMetrics
Listing Code Sources in Use
Determining the Dependencies of a Class
Determining Dependent Classes
Finding Duplicate Classes
Finding Duplicate Code Sources
Exiting a Query Process
Finding a Resource in Code Sources
How to Use the FindResource Query in Peek
How to Find a Resource with No Package
What You May Need to Know About FindResource
Getting Resources Used by a Class Loader
Monitoring HTTP Sessions for Deployed Applications
Detecting Class-Loader Leaks
Listing Classes Available from a Class Loader
How to List Classes Available from a Class Loader
What You May Need to Know About ListClasses
Listing Queries
How to List Queries
What You May Need to Know About ListQueries
Loading a Class
How to Use the loadClass Query in Peek
What Happens When You Use the loadClass Query in Peek
What You May Need to Know About loadClass
Listing Loaded Classes
How to Use the LoadedClasses Query in Peek
What You May Need to Know About LoadedClasses
Listing the Contents of a Class-Loader Tree
How to List the Contents of a Class-Loader Tree with the LoaderTree Query
What You May Need to Know About LoaderTree
Viewing a Class-Loader Tree with Peek
Listing Packages in Code Sources
Monitoring Replication Statistics
Listing Installed Shared Libraries and Their Class Loaders
Listing and Setting System Properties
Listing Thread-Pool Information
Listing Thread Information
Finding Unused Code Sources
Determining the Uptime for an OC4J Instance
Monitoring JVM Statistics
Resolving Class-Loading Exceptions
ClassNotFoundException
NoClassDefFoundError
ClassFormatError
LinkageError
ClassCastException
Tracing Class-Loading Events to Help Troubleshoot Issues
Using Filters to Manage Trace Output
Setting Class-Loader Log Levels
4
Logging Implementation Guidelines
Overview of the Java and Oracle Logging Frameworks
The Java Logging Framework
The Oracle Diagnostic Logging Framework
How Java Logging and Oracle Diagnostic Logging Work Together
Java Logging Guidelines
Naming Java Loggers
Setting Log Levels
Adding Localization Support
Configuring Java Loggers to Use the ODL Framework
Using Oracle HTTPClient Logging
Enabling HTTPClient Logging with the ODL Framework
Enabling HTTPClient Logging for Standalone OC4J or a Client-Side Application with a System Property
Enabling HTTPClient Logging for an OC4J Instance or Group in Oracle Application Server with a System Property
5
Using MBeans for Management
Overview of MBeans
Accessing MBeans from Within Application Server Control
Accessing OC4J MBeans Using the System MBean Browser
Accessing Cluster MBeans Using the Cluster MBean Browser
Accessing Application-Specific MBeans
Accessing MBeans From a Client Application
Prerequisite: Add User to Security Group
Remote Management Using the JMX Remote API (JSR-160)
Connecting to the OC4J MBeanServer
Connecting to an Application-Specific MBean Server
Connecting to a Specific Application's JMX Domain
Setting the JMX Service URI for an OPMN-Managed OC4J Instance
Setting a Secure JMX Service URI for an OPMN-Managed OC4J Instance
Setting the JMX Service URI for a Standalone OC4J Instance
Setting a Secure JMX Service URI for a Standalone OC4J Instance
Setting a Locale
Enabling HTTP Tunneling
Remote Management Using the Management EJB (JSR-77)
Accessing the MEJB from a J2EE Application Client
Accessing the MEJB from a Servlet or EJB
MBean Usage Examples
Prerequisites
Standalone OC4J Examples
Changing Thread Pool Properties
Stopping an OC4J Server
Adding a Managed Data Source
Updating Data Source Connection Pool Properties
Group-Based Examples
Listing the J2EE Servers that are Part of a Group
Adding a Managed Data Source to a Group of OC4J Instances
Provisioning Users to a Group of OC4J Instances
Providing Application-Specific MBeans
Writing an Application-Specific MBean
Types of MBeans Supported by OC4J
Unsupported Methods in JMX MBeanServer and MBeanServerConnection Interfaces
Sample MBean
Packaging Your MBeans for Deployment
Defining MBeans in orion-application.xml
Initializing MBean Attributes
Registering Your MBeans with the OC4J MBeanServer
Defining MBeans in an Application Descriptor
Defining MBeans in a Deployment Plan
Programmatically Registering MBeans Through Application Code
Adding Localization Support to MBeans
Localization Support Provided by Oracle
Using Resource Bundles to Localize MBean Metadata
Adding Localization Support to Your MBeans
6
Working with Open Source Frameworks
Installing Open Source Libraries in OC4J
Removing Imported Oracle Shared Libraries to Avoid Conflicts
Using Jakarta Struts
Overview of Jakarta Struts
Struts Support in Oracle JDeveloper
Access to the Struts Binary Distribution
Using the Spring Framework
Overview of the Spring Framework
Oracle TopLink Support in Spring 1.2
The Spring Framework Distribution
Using Apache MyFaces
Overview of MyFaces
Accessing the MyFaces Distribution
Building JSPs Using MyFaces for Deployment to OC4J
JDeveloper Support for MyFaces
Using Hibernate
Accessing the Hibernate Binaries
Using Hibernate with Applications in OC4J
Using Apache Axis
Accessing the Axis Distribution
Using the Xerces XML Parser
Using Oracle-Based and Axis-Based Web Services in OC4J
Configuring and Using Jakarta log4j
Overview of Jakarta log4j
Downloading the log4j Binary Distribution
Using log4j Configuration Files
Using the Default Files for Automatic log4j Configuration
Using Alternative Files for Automatic log4j Configuration
Programmatically Specifying External Configuration Files
Enabling log4j Debug Mode in OC4J
Using JAX-WS RI
Downloading the JAX-WS RI Package
Publishing JAX-WS RI Files to OC4J As a Shared Library
Importing the JAX-WS RI Shared Library into an Application
7
Packaging and Testing Applications
Overview of J2EE Application Packaging
J2EE Application Structure Within OC4J
Application Module (EAR File and WAR File) Structures
Sample EAR File
Sample WAR File
Packaging Deployment Descriptors
Deployment Descriptors Overview
Packaging a J2EE Standard Application Descriptor (application.xml)
Packaging an OC4J-Specific Application Descriptor (orion-application.xml)
8
Using J2EE Best Practices
JavaServer Pages Best Practices
Beware of HTTP Sessions
Avoid Using HTTP Sessions
Always Invalidate Sessions When No Longer in Use
Pretranslate JSP Pages Using the ojspc Utility
Unbuffer JSP Pages
Forward to JSP Pages Instead of Using Redirects
Hide JSP Pages from Direct Invocation to Limit Access
Use JSP-Timeout for Efficient Memory Utilization
Package JSP Files in an EAR File for Deployment
Class-Loading Best Practices
Sessions Best Practices
Persist Session State If Appropriate
Do Not Store Shared Resources in Sessions
Set Session Timeout Appropriately
Monitor Session Memory Usage
Use a Mix of Cookies and Sessions
Use Coarse Objects Inside HTTP Sessions
Use Transient Data in Sessions Whenever Appropriate
Invalidate Sessions
Miscellaneous Guidelines
Enterprise JavaBeans Best Practices
Use Local, Remote, and Message-Driven EJB Modules When Appropriate
Use EJB modules Judiciously
Use a Service Locator Pattern
Cluster Your EJB modules
Index Secondary Finder Methods
Understand the Life Cycle of an EJB Modules
Use Deferred Database Constraints
Create a Cache with Read-Only EJB Modules
Pick an Appropriate Locking Strategy
Understand and Leverage Patterns
When Using Entity Beans, Use Container-Managed Aged Persistence Whenever Possible
Entity Beans Using Local interfaces Only
Use a Session Bean Facade for Entity Beans
Enforce Primary Key Constraints at the Database Level
Use a Foreign Key for 1-1 or 1-M Relationships
Avoid the findAll() Method on Entities Based on Large Tables
Set prefetch-size to Reduce Round Trips to Database
Use Lazy Loading with Caution
Avoid Performing O-R Mapping Manually
A
OC4J-Specific Deployment Descriptors
Elements in the orion-application.xml File
Elements in the orion-application-client.xml File
B
Third Party Licenses
ANTLR
The ANTLR License
Apache
The Apache Software License
Apache SOAP
Apache SOAP License
DBI Module
Perl Artistic License
Preamble
Definitions
FastCGI
FastCGI Developer's Kit License
Module mod_fastcgi License
Info-ZIP Unzip Package
The Info-ZIP Unzip Package License
JSR 110
Jaxen
The Jaxen License
JGroups
The GNU License
mod_mm and mod_ssl
OpenSSL
OpenSSL License
Perl
Perl Kit Readme
mod_perl 1.29 License
mod_perl 1.99_16 License
Perl Artistic License
Preamble
Definitions
SAXPath
The SAXPath License
W3C DOM
The W3C License
Index