Tutorial Downloads .com

Home

Oracle Containers for J2EE Developers Guide

This Java tutorial covers the details of Oracle Containers for J2EE Developers Guide.This document provides detailed discussions on various facets of architecting, developing, and packaging a J2EE-compliant application for deployment into OracleContainers for J2EE (OC4J). It summarizes standard implementation but focuses primarily on Oracle implementation details and value-added features. As much as possible, the focus is on best practices and guidelines that Oracle recommends.

Contents
Preface .................................. ix
Intended Audience.................... ix
Documentation Accessibility ................................. ix
Related Documents ................... x
Conventions .................. xi
1 Getting Started with OC4J
Introduction to OC4J .............. 1-1
J2EE Support in OC4J ................................... 1-1
New Features in OC4J ................................... 1-2
Support for Web Services ...................... 1-2
Support for J2EE 1.4 Application Management and Deployment Specifications ............. 1-2
Support for Oracle Application Server TopLink.......................... 1-3
OracleAS Job Scheduler ......................... 1-3
Two-Phase Commit Transaction Coordinator Functionality .................. 1-3
Generic JMS Resource Adapter Enhancements............................ 1-3
Support for the Enterprise JavaBeans 3.0 ................ 1-3
Support for the Element................................ 1-4
Information in the OC4J Documentation Set .............. 1-4
OC4J Installation.................... 1-4
2 Developing Startup and Shutdown Classes
Developing Startup Classes ............................... 2-1
Developing Shutdown Classes.......................... 2-4
3 Utilizing the OC4J Class Loading Framework
Class Loading in OC4J .................. 3-1
Overview of Class Loading .......................... 3-1
Class Versioning with Shared Libraries in OC4J................................. 3-2
Shared Libraries That Applications Import by Default...................... 3-4
Configuring an Application to Import a Nondefault Version of a Shared Library .................... 3-5
Example: Importing an Earlier Version of the Oracle JDBC Driver .............. 3-5
Example: Configuring an Application to Use a DataDirect JDBC Driver ................................. 3-6
Removing or Replacing an Oracle Shared Library Imported by Default ............... 3-7
Example: Replacing the Oracle XML Parser with the Xerces Parser.................... 3-8
Example: Removing an Oracle Shared Library at Deployment Time.................. 3-9
Using a Packaged JAR Instead of an Oracle Shared Library................. 3-9
Configuring an Application to Use Its Own Shared Library.......................... 3-9
Specifying search-local-classes-first at Deployment Time .............. 3-10
Installing and Publishing a Shared Library in OC4J ........................... 3-10
When You Should Use a Shared Library.............. 3-11
Options for Installing and Publishing a Shared Library ................ 3-11
How a Shared Library Is Installed and Published in an OC4J Instance ................................. 3-12
Configuring an Application to Import a Shared Library .................... 3-14
Declaring Dependencies in an Application’s OC4J Deployment Descriptor......................... 3-14
Declaring Dependencies in an Application’s Manifest File ......................... 3-15
Configuring All Deployed Applications to Import a Specific Shared Library ...................... 3-15
Sharing Libraries Using the applib Directory ................. 3-16
Specifying a Library Directory in application.xml............................... 3-16
Best Practices for Class Loading..................... 3-17
Troubleshooting Class-Loading-Related Problems in OC4J .............. 3-17
Overview of Troubleshooting ................... 3-18
Class Loading Errors and Exceptions ................... 3-19
ClassNotFoundException ................... 3-19
NoClassDefFoundError ...................... 3-20
ClassFormatError................................ 3-22
LinkageError................. 3-22
ClassCastException............................. 3-22
Using Queries to Troubleshoot Class Loading Issues ..................... 3-24
Summary of Available Class Loader Queries............................ 3-24
Executing Queries at OC4J Startup ................ 3-32
Executing Queries at Runtime Through the ClassLoading MBean.................................. 3-33
Tracing Class Loading Events to Help Troubleshoot Issues ....................... 3-34
Using Filters to Manage Trace Output ................. 3-36
Setting Class Loader Log Levels ............... 3-38
4 Logging Implementation Guidelines
Overview of the Java and Oracle Logging Frameworks......................... 4-1
The Java Logging Framework ..................... 4-1
The Oracle Diagnostic Logging Framework .................. 4-1
How Java Logging and Oracle Diagnostic Logging Work Together ................... 4-2
Java Logging Guidelines.............. 4-2
Naming Java Loggers .............. 4-2
Setting Log Levels .................... 4-2
Adding Localization Support....................... 4-3
Configuring Java Loggers to Use the ODL Framework.......................... 4-3
5 Creating MBeans to Manage Your Applications
Overview of MBeans .............. 5-1
Types of MBeans Supported by OC4J...................... 5-2
Unsupported Methods in JMX MBeanServer and MBeanServerConnection Interfaces ......... 5-3
Packaging Your MBeans for Deployment .................... 5-4
Defining MBeans in orion-application.xml .................... 5-4
Initializing MBean Attributes....................... 5-5
Registering Your MBeans with the OC4J MBeanServer ........................ 5-6
Defining MBeans in an Application Descriptor .................................. 5-6
Defining MBeans in a Deployment Plan ................. 5-7
Programmatically Registering MBeans Through Application Code.................... 5-7
Providing Management Access to Application-Defined MBeans..................... 5-8
Prerequisite: Add User to Security Group .............. 5-9
Remote Management Using the JMX Remote API (JSR-160) ......................... 5-9
Connecting to the OC4J MBeanServer.................. 5-10
Connecting to an Application-Specific MBean Server .......................... 5-12
Connecting to a Specific Application’s JMX Domain............... 5-14
Setting the JMX Service URI for an OPMN-Managed OC4J Instance.............................. 5-14
Setting a Secure JMX Service URI for an OPMN-Managed OC4J Instance..................... 5-16
Setting the JMX Service URI for a Standalone OC4J Instance .............. 5-16
Setting a Secure JMX Service URI for a Standalone OC4J Instance.................................. 5-16
Setting a Locale............... 5-16
Enabling HTTP Tunneling.................. 5-17
Remote Management Using the Management EJB (JSR-77) ........................ 5-17
Accessing the MEJB from a J2EE Application Client................ 5-18
Accessing the MEJB from a Servlet or EJB ................................. 5-18
Sample MBean ..................... 5-19
UserManagerMBean Interface................... 5-19
UserManager Implementation Class..................... 5-19
Adding Localization Support to Your MBeans................ 5-21
Localization Support Provided by Oracle .................. 5-21
Using Resource Bundles to Localize MBean Metadata .................. 5-21
Adding Localization Support to Your MBeans ................................ 5-22
6 Working with Open Source Frameworks
Installing Open Source Libraries in OC4J ................... 6-1
Removing Imported Oracle Shared Libraries to Avoid Conflicts ..................... 6-2
Using Jakarta Struts ............... 6-3
Overview of Jakarta Struts............................ 6-3
Struts Support in Oracle JDeveloper ........................ 6-3
Accessing the Struts Binary Distribution................. 6-4
Using the Spring Framework............................. 6-4
Overview of the Spring Framework......................... 6-4
Oracle TopLink Support in Spring 1.2 ..................... 6-5
Downloading the Spring Framework Distribution............................. 6-5
Using Apache MyFaces ................. 6-5
Overview of MyFaces .............. 6-5
Accessing the MyFaces Distribution ........................ 6-5
Building JSPs Using MyFaces for Deployment into OC4J ................. 6-6
JDeveloper Support for MyFaces................. 6-6
Using Hibernate...................... 6-6
Accessing the Hibernate Binaries ................ 6-6
Using Hibernate with Applications in OC4J.................. 6-7
Using Apache Axis ................. 6-7
Accessing the Axis Distribution................... 6-7
Using the Xerces Parser XML Parser........................ 6-7
Using Oracle-Based and Axis-Based Web Services in OC4J.............. 6-7
Configuring and Using Jakarta log4j ............... 6-8
Overview of Jakarta log4j.............................. 6-8
Downloading the log4j Binary Distribution................... 6-8
Using log4j Configuration Files ................... 6-9
Using the Default Files for Automatic log4j Configuration..................... 6-9
Using Alternative Files for Automatic log4j Configuration .................... 6-9
Programmatically Specifying External Configuration Files ................. 6-10
Enabling log4j Debug Mode in OC4J .................... 6-11
7 Packaging an Application for Deployment into OC4J
Overview of J2EE Application Packaging.................... 7-1
J2EE Application Structure Within OC4J ................ 7-2
Application Module (EAR File and WAR File) Structures ................ 7-3
Sample EAR File................ 7-4
Sample WAR File .............. 7-4
Packaging Deployment Descriptors ................. 7-4
Deployment Descriptors Overview.......................... 7-4
Packaging a J2EE Standard Application Descriptor (application.xml)................ 7-7
Packaging an OC4J-Specific Application Descriptor (orion-application.xml).......................... 7-7
8 Using J2EE Best Practices
JavaServer Pages Best Practices ......................... 8-1
Beware of HTTP Sessions.............................. 8-1
Avoid Using HTTP Sessions ................. 8-1
Always Invalidate Sessions When No Longer in Use ................. 8-2
Pretranslate JSP Pages Using the ojspc Utility .............. 8-2
Unbuffer JSP Pages .................. 8-2
Forward to JSP Pages Instead of Using Redirects ............................... 8-2
Hide JSP Pages from Direct Invocation to Limit Access .................... 8-2
Use JSP-Timeout for Efficient Memory Utilization ............................ 8-3
Package JSP Files in an EAR File for Deployment ............................. 8-3
Class Loading Best Practices .............................. 8-3
Sessions Best Practices .................. 8-3
Persist Session State If Appropriate ......................... 8-4
Do Not Store Shared Resources in Sessions ................... 8-4
Set Session Timeout Appropriately.......................... 8-5
Monitor Session Memory Usage.................. 8-5
Use a Mix of Cookies and Sessions.............. 8-5
Use Coarse Objects Inside HTTP Sessions .............. 8-5
Use Transient Data in Sessions Whenever Appropriate .................... 8-5
Invalidate Sessions ................... 8-5
Miscellaneous Guidelines ............................. 8-6
Enterprise JavaBeans Best Practices.................. 8-6
Use Local, Remote, and Message-Driven EJBs When Appropriate............... 8-7
Use EJBs Judiciously ................ 8-7
Use a Service Locator Pattern....................... 8-7
Cluster Your EJBs .............. 8-7
Index Secondary Finder Methods................ 8-8
Understand the Lifecycle of EJBs................. 8-8
Use Deferred Database Constraints.......................... 8-8
Create a Cache with Read-Only EJBs ....................... 8-8
Pick an Appropriate Locking Strategy..................... 8-9
Understand and Leverage Patterns.......................... 8-9
When Using Entity Beans, Use Container-Managed Aged Persistence Whenever Possible .. 8-9
Entity Beans Using Local interfaces Only.................... 8-10
Use a Session Bean Facade for Entity Beans ............... 8-10
Enforce Primary Key Constraints at the Database Level ................ 8-10
Use a Foreign Key for 1-1 or 1-M Relationships ............................... 8-10
Avoid the findAll() Method on Entities Based on Large Tables ................. 8-10
Set prefetch-size to Reduce Round Trips to Database ..................... 8-10
Use Lazy Loading with Caution ............... 8-11
Avoid Performing O-R Mapping Manually................ 8-11
A OC4J-Specific Deployment Descriptors
Elements in the orion-application.xml File................. A-1
Elements in the orion-application-client.xml File .................................. A-8
B Third Party Licenses
ANTLR ....................... B-1
The ANTLR License............... B-1
Apache ........................ B-1
The Apache Software License ..................... B-2
Apache SOAP......................... B-6
Apache SOAP License .................................. B-7
DBI Module.......................... B-10
Perl Artistic License .............. B-10
Preamble.................. B-10
Definitions............... B-10
FastCGI..................... B-12
FastCGI Developer's Kit License............... B-12
Module mod_fastcgi License..................... B-13
Info-ZIP Unzip Package................................... B-13
The Info-ZIP Unzip Package License .................... B-14
JSR 110 ...................... B-14
Jaxen.......................... B-14
The Jaxen License .................. B-14
JGroups..................... B-15
The GNU License .................. B-15
mod_mm and mod_ssl................ B-22
OpenSSL .................. B-23
OpenSSL License ................... B-23
Perl............................. B-25
Perl Kit Readme.................... B-25
mod_perl 1.29 License ................................ B-26
mod_perl 1.99_16 License .......................... B-27
Perl Artistic License .............. B-30
Preamble.................. B-30
Definitions............... B-30
SAXPath ................... B-32
The SAXPath License.................................. B-32
W3C DOM ............... B-33
The W3C License.................. B-33.

Read more about Oracle Containers for J2EE Developers Guide


Resource: http://download.oracle.com/docs/cd/B31017_01/web.1013/b28952.pdf
Posted By : Luciana
On date : 07.15.08

Most used J2EE Tutorials

J2EE Tutorials ( Ebooks , PDF's )
Performance Tuning Essentials for Java and J2EE Web Application Architecture (based J2EE 1.4 Tutorial) WebObjects J2EE Programming Guide An Architects Guide Enterprise Application Integration J2EE and .net
JSP - Java Server Page (j2ee term)
JSP - Java Server Page (j2ee term) is a keyword/term used in JAVA - J2EE for Forms and Designer Developers
J2EE Interview Questions & Answers
What is "abstract schema, What is "access control, What is "ACID, What is "activation", What is "applet container", What is "application assembler" , What is "application component provider", What is "asant", What is backing bean , What is binding (JavaServer Faces technology) , What is business logic , What is CDATA , What is XSLTC , What is XSLT, What is XPath ... etc.. etc
OC4J - Oracle Containers for Java (j2ee term)
OC4J - Oracle Containers for Java (j2ee term) is a keyword/term used in JAVA - J2EE for Forms and Designer Developers
Java Programming Tutorial
This Java tutorial covers the details of Java Programming.The JAVA™ programming language is now being used to write distributed Internet applications. Unlike traditional languages, the JAVA™ language was designed to be used on a network.
Java/J2EE Job Interview Companion Book
Have you got the time to read 10 or more books and articles to add value prior to the interview? This book has been written mainly from the perspective of Java/J2EE job seekers and interviewers.
ADF BC – ADF Business Components (j2ee term)
ADF BC – ADF Business Components (j2ee term)is a keyword/term used in JAVA - J2EE for Forms and Designer Developers
Core J2EE Patterns tutorial Best Practices and Design Strategies
Core J2EE Patterns is the gospel that should accompany every J2EE application server...Built upon the in-the-trenches expertise of its veteran architect authors, this volume unites the platform's many technologies and APIs in a way that application architects can use, and provides insightful answers to the whys, whens, and hows of the J2EE platform
Struts 2 in Action tutorial book
The original Struts project revolutionized Java web development and its rapid adoption resulted in the thousands of Struts-based applications deployed worldwide. Keeping pace with new ideas and trends, Apache Struts 2 has emerged as the product of a merger between the Apache Struts and OpenSymphony WebWork projects, united in their goal to develop an easy-to-use yet feature-rich framework.
Servlets and JSP Passing the Sun Certified Web Component Developer Exam tutorial
Isn't it time you learned the latest (J2EE 1.4) versions of Servlets & JSPs? This book will get you way up to speed on the technology you'll know it so well, in fact, that you can pass the Sun Certified Web Component Developer (SCWCD) 1.4 exam.
MVC - Model View Controller (j2ee term)
MVC - Model View Controller (j2ee term) is a keyword/term used in JAVA - J2EE for Forms and Designer Developers
Oracle Application Server Containers for J2EE Services Guide
This Java tutorial covers the details of Oracle Application Server Containers for J2EE Services Guide.
Oracle Containers for J2EE Security Guide
This Java tutorial covers the details of Oracle Containers for J2EE Security Guide.This manual discusses Oracle Containers for J2EE (OC4J) security features. This preface contains these topics:
JVM - Java Virtual Machine (j2ee term)
JVM - Java Virtual Machine (j2ee term) is a keyword/term used in JAVA - J2EE for Forms and Designer Developers
JSF - Java Server Faces (j2ee term)
JSF - Java Server Faces (j2ee term) is a keyword/term used in JAVA - J2EE for Forms and Designer Developers

Latest added J2EE Tutorials

Servlets and JSP Passing the Sun Certified Web Component Developer Exam tutorial
Isn't it time you learned the latest (J2EE 1.4) versions of Servlets & JSPs? This book will get you way up to speed on the technology you'll know it so well, in fact, that you can pass the Sun Certified Web Component Developer (SCWCD) 1.4 exam.
Struts 2 in Action tutorial book
The original Struts project revolutionized Java web development and its rapid adoption resulted in the thousands of Struts-based applications deployed worldwide. Keeping pace with new ideas and trends, Apache Struts 2 has emerged as the product of a merger between the Apache Struts and OpenSymphony WebWork projects, united in their goal to develop an easy-to-use yet feature-rich framework.
Core J2EE Patterns tutorial Best Practices and Design Strategies
Core J2EE Patterns is the gospel that should accompany every J2EE application server...Built upon the in-the-trenches expertise of its veteran architect authors, this volume unites the platform's many technologies and APIs in a way that application architects can use, and provides insightful answers to the whys, whens, and hows of the J2EE platform
Enterprise JavaBeans 3 Tutorial Book
If you're up on the latest Java technologies, then you know that Enterprise JavaBeans (EJB) 3.0 is the hottest news in Java this year. In fact, EJB 3.0 is being hailed as the new standard of server-side business logic programming.
Java/J2EE Job Interview Companion Book
Have you got the time to read 10 or more books and articles to add value prior to the interview? This book has been written mainly from the perspective of Java/J2EE job seekers and interviewers.
The J2EE Tutorial for the Sun ONE Platform
THIS tutorial is a beginner’s guide to developing J2EE applications for the Sun™ Open Networking Environment (Sun ONE) platform. Here we cover all the things you need to know to make the best use of this tutorial.This tutorial is intended for programmers interested in developing J2EE applications using the Sun ONE platform. Specifically, it uses the Sun ONE Studio 4, Enterprise Edition for Java to develop J2EE applications and deploy them on Sun ONE Application Server 7.
Java Programming Tutorial
This Java tutorial covers the details of Java Programming.The JAVA™ programming language is now being used to write distributed Internet applications. Unlike traditional languages, the JAVA™ language was designed to be used on a network.
Oracle Application Server Containers for J2EE Security Guide
This Java tutorial covers the details of Oracle Application Server Containers for J2EE Security Guide.This manual discusses how to make effective use of the Oracle Application Server Containers for J2EE (OC4J) security features.
Designing Enterprise Applications
This Java tutorial covers the details of Designing Enterprise Applications.SINCE its introduction more than two years ago, the Java 2 Platform, Enterprise Edition (J2EE), has rapidly established a new model for developing distributed applications.
Sun ONE Application Server 7 Developer’s Guide to J2EE Features
This Java tutorial covers the details of Sun ONE Application Server 7 Developer’s Guide to J2EE Features.This guide describes how to create and run Java™ 2 Platform, Enterprise Edition (J2EE™ platform) applications that follow the new open Java standards model for the Java™Database Connectivity (JDBC™), transaction, Java Naming and Directory Interface™ (JNDI), Java™ Message Service (JMS), and JavaMail™ APIs, on the Sun™ Open Net Environment (Sun ONE) Application Server 7.