Oracle® Containers for J2EE Deployment Guide 10g (10.1.3.1.0) Part Number B28951-01 |
|
|
View PDF |
A resource adapter can be packaged and deployed as a standalone RAR that is available as a shared library to all applications within an OC4J instance.
This chapter includes the following topics:
For additional information about deploying resource adapters, see the Oracle Containers for J2EE Resource Adapter Administrator's Guide.
A resource adapter deployed as a standalone RAR is deployed as a child of the default
application, making the connector available to all other applications deployed to the OC4J instance. When an application is deployed, the application imports all standalone resource adapters that were previously deployed, by default.
Each standalone resource adapter deployed in OC4J is represented as a shared library, which, by default, is available to all applications. All code sources of a standalone resource adapter are added to a dedicated, shared loader that will be imported by all applications unless the applications are explicitly configured otherwise. When multiple versions of a standalone resource adapter are deployed, an application can be configured to import a specific resource adapter, so all resource adapter classes will be loaded from the same adapter.
A resource adapter is deployed to the ORACLE_HOME
/j2ee/
instance
/connectors
directory by default. This directory is specified in ORACLE_HOME
/j2ee/
instance
/config/server.xml
, the OC4J server configuration file.
When a resource adapter is deployed, the following updates are made to the OC4J instance:
A new <connector> element defining the resource adapter is added to ORACLE_HOME
/j2ee/
instance
/config/oc4j-connectors.xml
. This file provides an enumeration of the standalone resource adapters deployed to the OC4J instance.
An oc4j-ra.xml
descriptor is generated in a new directory with the same name as the connector in the ORACLE_HOME
/j2ee/
instance
/application-deployments
directory.
For deploying a standalone resource adapter (RAR) to a specific OC4J instance or to all OC4J instances in a group within a cluster, you can use one of these tools:
Application Server Control Console
See "Using the Application Server Control Console for Deployment".
deploy
Ant task
admin_client.jar
command-line utility
Although admin_client.jar
is the preferred command-line utility, you can use admin.jar
instead to deploy a RAR to a standalone OC4J server. For details on deploying a resource adapter with admin.jar
, see "Deploying or Redeploying a Standalone Connector".
When a standalone resource adapter is deployed, all running applications that were previously deployed, except the default
application, are asked to import the resource adapter. So, an application that is dependent on a standalone RAR can be deployed before the resource adapter as long as the application does not attempt to use the resource adapter prior to its deployment.
Take special care when you deploy a standalone resource adapter after a dependent application because the application might have already loaded classes, which could include resource adapter classes. If importing the standalone RAR causes previously loaded classes to be subsequently loaded by a different loader, unexpected exceptions may occur.
A resource adapter can look up and use another resource adapter. Because each standalone RAR has its own class loader, standalone RARs import other deployed standalone RARs as shared libraries. By default, a standalone RAR will import all previously deployed standalone RARs and all shared libraries. A standalone RAR must be deployed before any dependent standalone RARs.
Deploying a resource adapter to the default application will prevent the resource adapter from using any standalone RAR that is deployed as a shared library. Resources deployed as shared libraries are not imported by the default
application.
You can deploy multiple standalone resource adapters that contain classes of the same name. Each resource adapter must have a unique name and not a version number.
Because all standalone RARs are available to all applications by default, any application that uses a standalone RAR for which multiple versions are deployed must explicitly specify which of the versions it will use. The application must use only one version of a resource adapter that has multiple deployed versions. An application specifies which standalone RARs it will use in the configuration file orion-application.xml
.
For more information about using multiple versions of a resource adapter, see the Oracle Containers for J2EE Resource Adapter Administrator's Guide.
Undeploying or redeploying a standalone RAR does not require a restart of the default
application.
If you undeploy or redeploy a resource adapter with active endpoints without stopping it first, OC4J throws a DeployerException exception due to the active endpoints. Stop the resource adapter before redeploying or undeploying it.
When stopping a resource adapter, OC4J does not always stop dependent applications. Stop any applications that use a resource adapter before you stop it, to make sure all application activity completes.