![]() |
![]() |
|
|
Deploying Adapters
Once you have created an adapter, you must deploy it by using an Enterprise Archive (.ear) file. An .ear file simplifies this task by deploying all adapter components in a single step. You can deploy an .ear file either from the WebLogic Server Administration Console or manually, by manipulating the config.xml file.
This section contains information about the following subjects:
Using Enterprise Archive (.ear) Files
Each adapter is deployed from a single Enterprise Archive (.ear) file. An .ear file contains a design-time Web application .war file, an adapter .rar file, an adapter .jar file, and any shared .jar files required for deployment. Optionally, it can also include an event router Web application file. The .ear file should be structured as shown in Listing 9-1.
Listing 9-1 .ear File Structure
adapter.ear
application.xml
sharedJar.jar
adapter.jar
adapter.rar
META-INF
ra.xml
weblogic-ra.xml
MANIFEST.MF
designtime.war
WEB-INF
web.xml
META-INF
MANIFEST.MF
eventrouter.war
WEB-INF
web.xml
META-INF
MANIFEST.MF
The .ear file for the sample adapter is shown in Listing 9-2.
Listing 9-2 .ear File for the Sample Adapter
sample.ear
application.xml
adk.jar (shared .jar between .war and .rar)
bea.jar (shared .jar between .war and .rar)
BEA_WLS_SAMPLE_ADK.jar (shared .jar between .war and .rar)
BEA_WLS_SAMPLE_ADK.war (Web application with
META-INF/MANIFEST.MF entry Class-Path:
BEA_WLS_SAMPLE_ADK.jar adk.jar bea.jar log4j.jar
logtoolkit.jar xcci.jar xmltoolkit.jar)
BEA_WLS_SAMPLE_ADK.rar (Resource Adapter with
META-INF/MANIFEST.MF entry Class-Path:
BEA_WLS_SAMPLE_ADK.jar adk.jar bea.jar log4j.jar
logtoolkit.jar xcci.jar xmltoolkit.jar)
log4j.jar (shared .jar between .war and .rar)
logtoolkit.jar (shared .jar between .war and .rar)
xcci.jar (shared .jar between .war and .rar)
xmltoolkit.jar (shared .jar between .war and .rar)
Notice that neither the .rar nor .war file includes the shared .jar files; them; rather, Instead, both types of files refer to the shared .jar files by using the <manifest.classpath> attribute.
Using Shared .jar Files in an .ear File
The design-time application uses an adapter's SPI classes in an unmanaged scenario. Consequently, an adapter's SPI and CCI classes should be contained in a shared .jar file that resides in the same directory as the .ear file. To allow the .war and .rar classloaders to access the classes in the shared .jar, you must specify, in the MANIFEST.MF files, a request for inclusion of the shared .jar files. For more information about MANIFEST.FM, see either The Manifest File or "Understanding the Manifest" at the following URL:
http://developer.java.sun.com/developer/Books/JAR/basics/manifest.html
The BEA_WLS_SAMPLE_ADK.rar and BEA_WLS_SAMPLE_ADK.war files contain META-INF/MANIFEST.MF, as shown in Listing 9-3:
Listing 9-3 Manifest File Example
Manifest-Version: 1.0
Created-By: BEA Systems, Inc.
Class-Path: BEA_WLS_SAMPLE_ADK.jar adk.jar bea.jar log4j.jar logtoolkit.jar xcci.jar xmltoolkit.jar
Note: The name of the file, MANIFEST.MF, is spelled in all uppercase. If it is not spelled correctly, it is not recognized on a UNIX system and an error occurs.
.ear File Deployment Descriptor
Listing 9-4 shows the deployment descriptor, which declares the components of an .ear file. In this case, these components include the design-time .war, event router .war, and adapter .rar modules.
Listing 9-4 Deployment Descriptor for the .ear File
<!DOCTYPE application PUBLIC '-//Sun Microsystems, Inc.//DTD J2EE Application 1.3//EN'
'http://java.sun.com/dtd/application_1_3.dtd'>
<application>
<display-name>BEA_WLS_SAMPLE_ADK</display-name>
<description>This is a J2EE application that contains a sample
connector, Web application for configuring
application views for the adapter, and an
event router Web application.</description>
<module>
<connector>BEA_WLS_SAMPLE_ADK.rar</connector>
</module>
<module>
<web>
<web-uri>BEA_WLS_SAMPLE_ADK.war</web-uri>
<context-root>BEA_WLS_SAMPLE_ADK_Web</context-root>
</web>
</module>
<module>
<web>
<web-uri>BEA_WLS_SAMPLE_ADK_EventRouter.
.war</web-uri>
<context-root>BEA_WLS_SAMPLE_ADK_
EventRouter</context-root>
</web>
</module>
</application>
Note: The adapter .jar files must be included in the system classpath.
You can deploy the adapter via the WebLogic Server Administration Console or by adding an application component to config.xml. These procedures are described in Deploying Adapters.
You must also configure the event router Web application using the WebLogic Server Administration Console. For more information, see Editing Web Application Deployment Descriptors.
Deploying Adapters
You can deploy adapters by either of the following methods:
This section provides procedures for both methods.
Deploying Adapters by Using the WebLogic Server Administration Console
To configure and deploy an adapter from the WebLogic Server Administration Console, complete the following procedure:
When you install an application (or application component) via the WebLogic Server Administration Console, you also create entries for that application or component in the configuration file for the relevant domain (/config/DOMAIN_NAME/config.xml, where DOMAIN_NAME is your domain). WebLogic Server also generates JMX Management Beans (MBeans) that enable you to configure and monitor the application and application components.
Deploying Adapters Manually
To deploy the adapter manually, you must first modify the config.xml file. Within the <Application> element, you must set the Deployed= value to true and specify the logical name of the adapter with the Name= value parameter setting. Additionally, you must:
Listing 9-5 shows how the config.xml file is modified to deploy the sample adapter. In this listing, the path directive points to the .ear file and each component describes the URI of its own deployment.
Listing 9-5 Sample Code for Deploying an Adapter by Using config.xml
<!-- This deploys the EAR file -->
<Application Deployed="true" Name="BEA_WLS_SAMPLE_ADK"
Path="WLI_HOME/adapters/sample/lib/BEA_WLS_SAMPLE_ADK.ear">
<ConnectorComponent Name="BEA_WLS_SAMPLE_ADK"
Targets="myserver" URI="BEA_WLS_SAMPLE_ADK.rar"/>
<WebAppComponent Name="BEA_WLS_SAMPLE_ADK_EventRouter"
Targets="myserver" URI="BEA_WLS_SAMPLE_ADK_
EventRouter.war"/>
<WebAppComponent Name="BEA_WLS_SAMPLE_ADK_Web"
Targets="myserver" URI="BEA_WLS_SAMPLE_ADK_Web.war"/>
</Application>
Note: You must replace WLI_HOME with the correct path for the WebLogic Integration root directory for your environment.
Once config.xml is updated, deploy the adapter by completing the following procedure:
Adapter Auto-registration
WebLogic Integration uses an automatic registration process during adapter deployment. To implement the automatic registration process, use one of the procedures provided in Registering the Design-time Web Application.
Editing Web Application Deployment Descriptors
For some adapters, you may need to change the deployment parameters of the Event Router Web application. For the DBMS adapter, for example, you might need to change the data source used by its event generator.
This section explains how to use the Deployment Descriptor Editor provided by the WebLogic Server Administration Console to edit the following Web application deployment descriptors:
Deployment Parameters
You can change any parameter of the Event Router Servlet. These parameters are:
Editing the Deployment Descriptors
To edit the Web application deployment descriptors, complete the following procedure:
![]() |
![]() |
![]() |
|
Copyright © 2002 BEA Systems, Inc. All rights reserved.
|