Skip Headers
Oracle® Containers for J2EE Services Guide
10
g
(10.1.3.1.0)
Part Number B28958-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
Introduction to OC4J Services
Java Naming and Directory Interface (JNDI)
Java Message Service (JMS)
Data Sources
OC4J Transaction Support
Using Remote Method Invocation in OC4J
Java Object Cache
XML Query Service
Using the Application Client Container
Third-Party Licenses
2
Using JNDI
JNDI Primer
Creating and Using the Initial Context
Constructing a JNDI Context
Enabling Global JNDI Lookups
Environment and Constructors
Example: Looking Up An EJB
JNDI Contexts and Threads
Browsing the JNDI Context
Looking Up Objects from J2EE Application Components
Looking Up Objects In the Same Application
Example: Servlet Looking Up a Data Source
Looking Up Objects in Another Application
RMIInitialContextFactory
IIOPInitial ContextFactory
Looking Up Objects from J2EE Application Clients
Environment Properties
Load Balancing
Example: Application Client Looking Up an EJB
Example: Application Client Looking Up an EJB Using IIOP
JNDI State Replication
What Is JNDI State Replication
Enabling JNDI State Replication
Limitations of JNDI State Replication
Propagating Changes Across the Cluster
Binding a Remote Object
3
OC4J Transaction Support
Introduction to OC4J Transaction Support
Programming Models - Container-Managed and Bean-Managed Transactions
Demarcating Transactions
Demarcating Container-Managed Transactions
Demarcating Bean-Managed Transactions
Configuring a Transaction Coordinator
Defining the Transaction Coordinator
Setting Coordinator Attributes
General Attributes
File Store Log Attributes
Database Store Attributes
Configuring Supporting Resources
Server
Data Source
Resource Adapter
In-Database Transaction Coordinator Considerations
Managing the OC4J Transaction Manager
Manual Commit and Rollback Operations
Monitoring the OC4J Transaction Manager
OC4J Transaction Support Statistics
Subscribing to Event Notifications
Managing OC4J Transaction Manager Recovery
Recovery Management
Logs
Transaction Propagation between OC4J Processes over ORMI
Configuring Transaction Propagation
Transaction Propagation Constraints
Backwards Compatibility
EJB Failover
Debugging and Troubleshooting
4
Using Oracle Enterprise Messaging Service
About JMS
JMS How-To Documents and Demo Sets
JMS Configuration Overview
JMS Configuration Sequence
Developing and Assembling the Application
Configuring the Resource Provider
Configuring the JMS Connector
Additional Information and Examples
JMS Configuration File Structure
Bypassing the JMS Connector for Application Clients
Resource Providers
Declaring Resource Provider References
OEMS JMS In-Memory and File-Based Persistence
Configuring Destination Objects and Connection Factories
Configuring in the Application Server Control Console
Configuration Elements
Configuration Using jms.xml
Configuring Ports
Sending and Receiving JMS Messages
Using the JMS Utility
Using JMS MBeans
Configuring File-Based Persistence
Abnormal Termination
Predefined Exception Queue
Message Paging
JMS Configuration Properties
Resource Naming for OEMS JMS In-Memory and File-Based
Required Class Path for Application Clients Using Direct OEMS JMS In-Memory and File-Based Lookup
OEMS JMS Database Persistence
Using the OEMS JMS Database Option
Using OEMS JMS Database with the Oracle Application Server and the Oracle Database
Using Third-Party JMS Providers
Declaring an IBM WebSphere MQ Resource Provider Reference
Declaring a TIBCO Enterprise Message Service Resource Provider Reference
Declaring a SonicMQ Resource Provider Reference
JMS Connector
Modifying the JMS Connector
Configuring the JMS Connector
Connection Factories and Destinations
JMS Connector Settings
Configuring the JMS Connector in the XML Files
Using Message-Driven Beans
Fine Tuning MDB Endpoints
Using Logical Names to Reference Resources
How to Declare Logical Names
Mapping Logical Names to Explicit JNDI Locations
JNDI Naming Property Setup for Java Application Clients
Client Sends JMS Message Using Logical Names
Required Class Path for Application Clients Using JMS Connector Lookup
Using High Availability and Clustering for OEMS JMS
Configuring OEMS JMS In-Memory and File-Based High Availability
Terminology
Distributed Destinations
Cold Failover Cluster
Dedicated JMS Server
Custom Topologies
Configuring OEMS JMS Database High Availability
Failover Scenarios When Using a RAC Database
Sample Code for Connection Recovery
J2CA Configuration for Connection Recovery
Clustering Best Practices
JMS Router
JMS Providers
Configuration
Router Jobs
Global Router Parameter(s)
Subscription
Log Queues and Exception Queues
Configuring the JMS Router and Its Objects
Managing the Router
Router Logging
JMS Router Status Information
Error Handling
Pausing and Resuming a Job
Running In a Clustered OC4J Environment
Routing with Remote Destinations
Routing to Remote Destinations with OEMS JMS HTTP Tunneling
Configuring the JMS HTTP Tunnel Provider
Additional HTTP-Tunnel Examples
JMS HTTP Tunneling with SSL
Configuring Connection Factories
Connection Factory Configuration Examples
Resolving Host-Name Conflicts
Configuring Logging for JMS
Standard JMS
JMS Provider
JMS Connector
Message Endpoint
5
Data Sources
Data Source Types
Managed Data Sources
Native Data Sources
Defining Data Sources
Defining a Connection Pool
Defining a Managed Data Source
Defining a Native Data Source
Defining Fatal Error Codes
Using Password Indirection
Removing the Example Data Source
Connections
Establishing a Connection
Using Connection Pools for Managed Data Sources
Using Connection Proxies with Managed Data Sources
Getting a Connection From a DataSource
Retry
Proxy-Authentication with Oracle JDBC Native Data Sources
Statements
Statement Caching with Managed Data Sources
Setting the JDBC Statement Cache Size in Data Sources
Statement Proxies with Managed Data Sources
Transactions
Local Transactions
Local Transaction Management
Global Transactions (XA)
XA Recovery
Emulating XA
Configuring Data Source Objects
Managed Data Sources
Native Data Source
Connection Pools and Connection Factories
Connection Factories
Connection Properties
Connection Pools
Configuration Examples
Syntax of the data-sources.xml File
Examples: Configuring Data Sources
Example: Native Data Source
Example: Managed Data Source Using an XADataSource Connection Factory
Example: Managed Data Source Using a DataSource Connection Factory
Example: Managed Data Source Using a Driver Connection Factory
Example: Defining Proxy Interfaces
Example: Defining XA Recovery
Example: Connection Properties
Examples: Configuring Transaction Level
Examples: Configuring Fast Connection Failover
Using High Availability and Fast Connection Failover
Using JDBC Drivers
Oracle JDBC Drivers
OCI
Thin
Notes on Oracle JDBC-OCI driver upgrade in the Oracle Application Server
JDBC Drivers for non-Oracle Databases
Using DataDirect JDBC Drivers
Example DataDirect Data Source Entries
Additional Data Source Configuration Examples
Legacy Configuration
Converting Existing Data Sources
6
Using Remote Method Invocation
What Is RMI?
Choosing RMI/ORMI or RMI/IIOP
Using Oracle Remote Method Invocation (RMI/ORMI)
Introducing RMI/ORMI
Features of ORMI
Configuring RMI in a Standalone OC4J Installation
Access Restrictions
Client-Side Requirements to Use RMI/ORMI
Configuring RMI in an Oracle Application Server Environment
Remote Object Lookup Using RMI/ORMI
Setting JNDI Properties for RMI
Setting the Java Naming Provider URL
Specifying the Context Factory
Configuring ORMI Request Load Balancing
Example Lookups Using ORMI
Standalone OC4J
OC4J in Oracle Application Server
OC4J in Previous Oracle Application Server Releases
Configuring ORMI Tunneling through HTTP
Using ORMI/SSL (ORMIS) in OC4J
Using J2EE Interoperability (RMI/IIOP)
Introduction to RMI/IIOP
Transport
Naming
Security
Transactions
The rmic.jar Compiler
Configuring OC4J for Interoperability
Interoperability OC4J Flags
Interoperability Configuration Files
JNDI Properties for Interoperability (jndi.properties)
Client-Side Requirements to Use IIOP
Switching from ORMI to IIOP Transport
Configuring an EJB for Interoperability in a Standalone OC4J Environment
Configuring an EJB for Interoperability in an Oracle Application Server Environment
Specifying the corbaname URL
Specifying the OPMN URL
Exception Mapping
Invoking OC4J-Hosted Beans from a Non-OC4J Container
7
Java Object Cache
Java Object Cache Concepts
Java Object Cache Basic Architecture
Distributed Object Management
How the Java Object Cache Works
Cache Organization
Java Object Cache Features
Java Object Cache Object Types
Memory Objects
Disk Objects
StreamAccess Objects
Pool Objects
Java Object Cache Environment
Cache Regions
Cache Subregions
Cache Groups
Region and Group Size Control
Cache Object Attributes
Using Attributes Defined Before Object Loading
Using Attributes Defined Before or After Object Loading
Developing Applications Using Java Object Cache
Importing Java Object Cache
Defining a Cache Region
Defining a Cache Group
Defining a Cache Subregion
Defining and Using Cache Objects
Implementing a CacheLoader Object
Using CacheLoader Helper Methods
Invalidating Cache Objects
Destroying Cache Objects
Multiple Object Loading and Invalidation
Java Object Cache Configuration
Examples
Declarative Cache
Declarative Cache File Sample
Declarative Cache File Format
Examples
Declarable User-Defined Objects
Declarable CacheLoader, CacheEventListener, and CapacityPolicy
Initializing the Java Object Cache in a Non-OC4J Container
Capacity Control
Implementing a Cache Event Listener
Restrictions and Programming Pointers
Working with Disk Objects
Local and Distributed Disk Cache Objects
Local Objects
Distributed Objects
Adding Objects to the Disk Cache
Automatically Adding Objects
Explicitly Adding Objects
Using Objects that Reside Only in Disk Cache
Working with StreamAccess Objects
Creating a StreamAccess Object
Working with Pool Objects
Creating Pool Objects
Using Objects from a Pool
Implementing a Pool Object Instance Factory
Pool Object Affinity
Running in Local Mode
Running in Distributed Mode
Configuring Properties for Distributed Mode
Setting the distribute Configuration Property
Setting the discoveryAddress Configuration Property
Using Distributed Objects, Regions, Subregions, and Groups
Using the REPLY Attribute with Distributed Objects
Using SYNCHRONIZE and SYNCHRONIZE_DEFAULT
Accessing Objects in Remote Caches
Cached Object Consistency Levels
Using Local Objects
Propagating Changes Without Waiting for a Reply
Propagating Changes and Waiting for a Reply
Serializing Changes Across Multiple Caches
Sharing Cached Objects in an OC4J Servlet
Using User-Defined Class Loaders
HTTP and Security for Distributed Cache
HTTP
SSL
Firewall
Restricting Incoming Connections
Monitoring and Debugging
XML Schema for Cache Configuration
XML Schema for Attribute Declaration
8
Oracle XML Query Service
Introduction to Oracle XML Query Service
What Is XQS?
Technologies Related to XQS
A Quick Look at XQuery
The Oracle XQuery Implementation
Comparing XQS with the XQuery API for Java
Why Use XQS?
Requirements, Limitations, and Special Notes
Overview of XQS Features and Functionality
XQS Data Source Support
Supported Categories of Data Sources
Data Source Access Through XQuery Functions
What Do Data Source Function Objects Do?
Overview of Preparing Data Sources
Introduction to XQS Configuration and the Configuration File
Introduction to XQS Client Interfaces
Introduction to OC4JPackager
Security for XQS Applications
Introduction to XQS Performance and Optimization Features
Introduction to XQS Error Handling
Summary of the Main Steps in Using XQS
How to Prepare to Use Your Data Sources
Preparing to Use a Non-XML Document Source
What Is D3L?
D3L Schema Files
Configuring XQS to Use D3L
Preparing to Use an XQS View
Preparing to Use a Database Source (SQL-Based XQS View)
Preparing to Use a WSDL Source with SOAP Binding
Preparing to Use a Custom Class or EJB (WSDL Source with Java or EJB Binding)
How to Configure Your XQS Functions
Configuring an XQS Function that Accesses a Document Source
Configuring an XQS Function that Uses an XQS View
Configuring an XQS Function that Accesses a WSDL Source
How to Design Your Queries
Query Considerations
Query Examples
Type-Checking for Input Parameters
How to Develop Your Application Code: Using the XQS Client Interfaces
Supported Types for Query Parameters
General Coding Steps in Using XQS Client APIs
Stateful Versus Stateless Clients
Using the Java Interface Client API
Example 1: XQSFacadeI API
Example 2: XQSFacadeI API with an Ad-Hoc Query
Example 3: XQSFacadeI API with an XQS View
Using the EJB Client API
EJB Clients for Stateful Versus Stateless Sessions
Use of the EJB Client API in Stateful Sessions
Example: EJB Client API with an XQS View in a Stateless Session
Using the JSP Tag Library
JSP Tags for Stateful Versus Stateless Access
Example: JSP Tags with an XQS View in a Stateful Access Pattern
Example: JSP Tags with an Ad-Hoc Query in a Stateless Access Pattern
Using an XQS View Exposed as a Web Service Operation
How to Use OC4JPackager to Package Your XQS Application
Steps in Using OC4JPackager
Preparing to Run OC4JPackager
Running OC4JPackager: Required and Optional Parameters and Properties
Running OC4JPackager on the Command Line
Running OC4JPackager Through Ant
OC4JPackager Basic Output
OC4JPackager Additional Output to Expose XQS Views As Web Service Operations
Example: Configuration to Expose a View As a Web Service Operation
Example: EAR File for a View Exposed As a Web Service Operation
Example: WAR File for a View Exposed As a Web Service Operation
Example: WSDL Document for a View Exposed As a Web Service Operation
Using XQS Performance Features
Performance Considerations for Using the XQS Stateless or Stateful Client APIs
Configuring XQS Caching
XQS Cache Settings
XQS Caching Strategies
Caching and Nondeterministic Results
Configuring XQS Document Sources for Large Data
Using XQS Error Handling Modes and APIs
Configuring XQS Function Error Handling
Retrieving XQS Error Objects
Obtaining Information from XQS Error Objects
Example: Error Retrieval and Processing
Using XQS in a BPEL Environment
Registering the BPEL XPath Function for XQuery
Using BPEL XQuery Function Parameters
Accessing Context Items with XQuery
Using XQS View Functionality in BPEL
Top Level Views
Nested View
Using External XQuery Variables
Using BPEL Process Variables in an XQS View
Using BPEL Namespaces and Folders for XQS Views
Default Namespace and Folder
Custom Namespaces and Sub-Folders
Using a URL as a View Name
XQS Client APIs Reference
XQSFactory Reference
XQS QueryParameterI Reference
Factory Methods Returning QueryParameterI
QueryParameterI Methods
XQSFacadeI Reference
Factory Method Returning XQSFacadeI
XQSFacadeI Methods
XQS EJB Client API Reference
Stateful EJB Client Methods
Stateless EJB Client Methods
XQS JSP Tag Library Reference
JSP Tags for Stateful Access
JSP Tag for Stateless Access
XQSErrorI Reference
XQS Configuration File Reference
<bind-prefix>
<cache-properties>
<dataSource>
<document-source>
<documentURL>
<error-message>
<function-name>
<in-memory>
<input-parameters>
<itemType>
<mapping>
<operation>
<output-element>
<part>
<port>
<portType>
<queryName>
<repository>
<schema-file>
<schema-type>
<service>
<typeMap>
<use-prefix>
<username>
<wsdl-source>
<wsdlURL>
<xqs-config>
<xqs-sources>
<xqsview-source>
<XMLTranslate>
<xmlType>
<xquery-sequence>
OC4JPackager Reference
OC4JPackager Parameters
appArchives
help
jsp
name
no_ws
output
repository
sf
sl
xqsConfigFile
Java Properties for OC4JPackager
oracle.home
java.home
java.util.logging.properties.file
xds.packager.work.dir
XQS Troubleshooting
Enabling OC4J Logging
Key XQS Symptoms, Causes, and Remedies
XQS Sample
9
Using The Application Client Container
Container Overview
Requirements
Developing Application Clients
Creating a Main Class
Accessing Resources Using JNDI
Using Annotations
Using the JNDI API
Using a Deployment Descriptor
Setting JNDI Properties
Using a Deployment Descriptor
Packaging a Client
Implementing a Custom Security Handler
Starting Application Clients
A
Third Party Licenses
ANTLR
The ANTLR License
Apache
The Apache Software License
Apache SOAP
Apache SOAP License
DBI Module
Perl Artistic License
Preamble
Definitions
expat
FastCGI
FastCGI Developer's Kit License
Module mod_fastcgi License
Info-ZIP Unzip Package
The Info-ZIP Unzip Package License
Jabberbeans
JSR 110
Jaxen
The Jaxen License
JGroups
The GNU License
JTidy
mod_dav
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
PHP
The PHP License
SAXPath
The SAXPath License
Sun Microsystems, Inc.
The Java Logo
W3C DOM
The W3C License
Index