|
|
| |
Resource Adapter Deployment
The following sections explain how to deploy, undeploy, and update the deployment of configured resource adapters to WebLogic Server:
Resource Adapter Deployment Overview
Deployment of a resource adapter is similar to deployment of Web Applications, EJBs, and Enterprise Applications. Like these deployment units, you can deploy a resource adapter in an exploded directory format or as an archive file.
Deployment Options
You can deploy a resource adapter:
Deployment Descriptor
Also similar to Web Applications, EJBs, and Enterprise Applications, resource adapters use two deployment descriptors to define their operational parameters. The deployment descriptor ra.xml is defined by Sun Microsystems in the J2EE Connector Specification, Version 1.0, Proposed Final Draft 2. The weblogic-ra.xml deployment descriptor is specific to WebLogic Server and defines operational parameters unique to WebLogic Server. For more information about the weblogic-ra.xml deployment descriptor, refer to weblogic-ra.xml Deployment Descriptor Elements.
Resource Adapter Deployment Names
When you deploy a resource adapter .rar file or deployment directory, you must specify a name for the deployment unit, for example, myResourceAdapter. This name provides a shorthand reference to the resource adapter deployment that you can later use to undeploy or update the resource adapter.
When you deploy a resource adapter, WebLogic Server implicitly assigns a deployment name that matches the path and filename of the .rar file or deployment directory. You can use this assigned name to undeploy or update the resource adapter after the server has started.
The resource adapter deployment name remains active in WebLogic Server until the server is rebooted. Undeploying a resource adapter does not remove the associated deployment name, because you may later re-use that name to deploy the resource adapter.
Using the Administration Console
This section discusses resource adapter deployment tasks using the Administration Console.
Deploying Resource Adapters Using the Administration Console
To deploy a resource adapter using the WebLogic Server Administration Console:
Viewing Deployed Resource Adapters Using the Administration Console
To view a deployed resource adapter in the Administration Console:
Undeploying Deployed Resource Adapters Using the Administration Console
To undeploy a deployed resource adapter from the WebLogic Server Administration Console:
Undeploying a resource adapter does not remove the resource adapter name from WebLogic Server. The resource adapter remains undeployed for the duration of the Server session, as long as you do not change it once it has been undeployed. You cannot re-use the deployment name with the deploy argument until you reboot the server. You can re-use the deployment name to update the deployment, as described in the following section.
Updating Deployed Resource Adapters Using the Administration Console
When you update the contents of the resource adapter .rar file or deployment directory that has been deployed to WebLogic Server, those updates are not reflected in WebLogic Server until:
or
From the WebLogic Server Administration Console:
Using the Applications Directory
You can deploy a resource adapter automatically while WebLogic Server is running. The /applications directory is monitored during runtime of the WebLogic Server and detects if a new .rar is added (causing deployment) or if an existing .rar is removed (causing undeployment).
To deploy a resource adapter using the applications directory:
For example, after copying a resource adapter called myResourceAdapter in exploded format, your WebLogic Server installation looks like this (not all the files for a resource adapter are shown here):
Listing 4-1 myResourceAdapter
\---beaHome
\---wlserver6.x
\---config
\---mydomain
\---applications
\---myResourceAdapter
eis.jar
readme.html
unix.so
utilities.jar
windows.dll
\---META-INF
ra.xml
weblogic-ra.xml
After copying a .rar file, your WebLogic Server installation looks like this:
Listing 4-2 rar File
\---beaHome
\---wlserver6.x
\---config
\---mydomain
\---applications
myResourceAdapter.rar
Using weblogic.deploy
To deploy a resource adapter .rar file or deployment directory that has not been deployed to WebLogic Server, use the following command:
% java weblogic.deploy -port port_number -host host_name
deploy password name source
where:
Viewing Deployed Resource Adapters Using weblogic.deploy
To view resource adapters that are deployed on a local WebLogic Server, from the command line enter the following:
% java weblogic.deploy list password
where password is the password for the WebLogic Server System account.
To list deployed resource adapters on a remote server, from the command line enter the following:
% java weblogic.deploy -port port_number -host host_name
list password
Undeploying Deployed Resource Adapters Using weblogic.deploy
Undeploying a resource adapter does not remove the deployment name associated with the resource adapter .rar file or deployment directory. The deployment name remains in the server to allow for later updates of the resource adapter.
To undeploy a deployed resource adapter from the command line, you need only reference the assigned deployment unit name, as in:
%java weblogic.deploy -port 7001 -host localhost undeploy
password myResourceAdapter
Undeploying a resource adapter does not remove the resource adapter name from WebLogic Server. The resource adapter will remain undeployed for the duration of the Server session, as long as you do not change it once it has been undeployed. You cannot re-use the deployment name with the deploy argument until you reboot the server. You can re-use the deployment name to update the deployment, as described in Updating Deployed Resource Adapters Using weblogic.deploy.
Updating Deployed Resource Adapters Using weblogic.deploy
When you update the contents of the resource adapter .rar file or deployment directory that has been deployed to WebLogic Server, those updates are not reflected in WebLogic Server until:
To update or redeploy the resource adapter from the command line, use the update argument and specify the active resource adapter deployment name:
%java weblogic.deploy -port 7001 -host localhost update
password myResourceAdapter
Including a Resource Adapter in an Enterprise Application (.ear file)
As part of the J2EE Platform Specification, Version 1.3, Proposed Final Draft 3, it is now possible to include a resource adapter archive (.rar) file inside an Enterprise Application archive (.ear) and then deploy the application in WebLogic Server.
To deploy an Enterprise Application that contains a resource adapter archive:
Note the following when creating an application.xml:
The application deployment descriptor must contain the new <connector> element to identify the resource adapter archive within the .ear archive. For example:
<connector>RevisedBlackBoxNoTx.rar</connector>
Because the <connector> element is a new addition to the J2EE Platform Specification, Version 1.3, the application.xml file must contain the following DOCTYPE entry to identify it as a J2EE Platform Specification, Version 1.3 deployment descriptor.
Listing 4-3 DOCTYPE Entry
<!DOCTYPE application PUBLIC `-//Sun Microsystems, Inc.//DTD
J2EE Application 1.3//EN'
`http://java.sun.com/dtd/application_1_3.dtd'>
If you do not use this DOCTYPE entry, the resource adapter will not be deployed.
The following listing is an example of an application.xml file.
Listing 4-4 application.xml File
<application>
<display-name> ConnectorSampleearApp </display-name>
<module>
<connector>RevisedBlackBoxNoTx.rar</connector>
</module>
<module>
<ejb>ejb_basic_beanManaged.jar</ejb>
</module>
</application>
For general information about deployment of Enterprise Applications, see "Enterprise Applications" in "Understanding WebLogic Server Applications."
|
Copyright © 2001 BEA Systems, Inc. All rights reserved.
|