|
|
| Sun ONE Connector Builder 2.0 Installation and Getting Started Guide |
Deploying the COTS Sample AdapterThis module describes how to deploy and run the COTS sample adapter and application that is packaged with the Sun ONE Connector Builder. The following topic is described:
Customer Order Tracking System (COTS) Sample
The COTS sample includes a stubbed EIS, an adapter and a web application client.
Directory Structure
The COTS sample is located under the <connector_builder_install_root>\samples\cots directory. This directory contains the following three sub-directories:
- adapters
- application
- eissystem
Adapters Directory
The <connector_builder_install_root>\samples\cots\adapters directory contains the source code for the generated and customized COTS resource adapter. You can use the adapter you generated in "Lessons for Creating a COTS Sample Resource Adapter" instead of the one in the install directory.
Application Directory
The <connector_builder_install_root>\samples\cots\application directory contains the source code for the sample web application that uses the COTS adapter.
eissystem Directory
The <connector_builder_install_root>\samples\cots\eissystem directory contains the source code for the sample COTS EIS. The COTS adapter was developed for this specific EIS system.
Deploying, Configuring, and Running the COTS Sample
The following are the steps to deploy, configure and run the COTS sample.
- Step 1 - Deploy and Configure the COTS Resource Adapter
- Step 2 - Deploy the Web-Based Sample Application
- Step 3 - Start the COTS EIS Server
- Step 4 - Run the Sample Application
- Step 5 - Run Sample Tests Using the TestClient
- Step 6 - Deploy SOAP Services and Run the SOAP Clients (Optional)
Step 1 - Deploy and Configure the COTS Resource Adapter
You can deploy and configure the sample COTS resource adapter into:
- iPlanet Application Server 6.5
- iPlanet Web Server 6.0
- J2EE RI Server 1.3.1
- Sun ONE Application Server 7.0
iPlanet Application Server 6.5
Use icsvrreg, icradeploy, and icconfig command line tools to deploy the sample resource adapter into the iPlanet Application Server 6.5. The command line tools are located in the following directory: <connector_builder_install_root>/bin.
To Deploy the COTS Resource Adapter into iPlanet Application Server 6.5
- Register the server:
Use the following command to register a deployment instance.
icsvrreg add -n <your_server> -t ias65 -d <ias_install_directory>
Windows:
icsvrreg add -n ias65Server -t ias65 -d d:\iplanet\ias65
Solaris:
icsvrreg add -n ias65Server -t ias65 -d /export/iplanet/ias65
- Deploy the COTS Resource Adapter (COTS.rar).
Use the following command to deploy COTS resource adapter.
icradeploy deploy -s <your_server> -a <adapter_name> -r <rar_file>
Windows:
icradeploy deploy -s ias65Server -a COTS -r <connector_builder_install_root>\samples\cots\adapters\COTS\ship\COTS.rar
Solaris:
icradeploy deploy -s ias65Server -a COTS -r <connector_builder_install_root>/samples/cots/adapters/COTS/ship/COTS.rar
- Configure the connection factory with lookup name COTS
Use the following command to configure a connection factory with default parameters (ServerName: localhost and PortNumber:9999):
icconfig add -s ias65Server -n COTS -a COTS
Use the -p option to set values other than the default for the connection factory.
Note You must restart the server for the changes to take effect.
iPlanet Web Server 6.0
Use icsvrreg, icradeploy, and icconfig command line tools to deploy the sample resource adapter into iPlanet Web Server 6.0. The command line tools are located in the following directory: <connector_builder_install_root>/bin.
By default, the iPlanet Web Server is installed with JRE 1.2.2. iPlanet Web Server must be configured with JDK 1.3.1 to deploy resource adapters built using the Connector Builder.
To Configure iWS for JDK 1.3.1
- Start the iPlanet Web Server Admin Server.
- Log into the iPlanet Web Server admin console.
http://<hostname>:<admin_port>(default_port:8888).
- Click Global Settings tab.
- Click Configure JRE/JDK Paths link - on the left side of the screen.
- Select JDK and enter the location of JDK 1.3.1, for example /usr/jdk131.
No extra information relating to libpath and classpath needs to be entered.
- Restart the web server.
To Deploy the COTS Resource Adapter into iPlanet Web Server 6.0
- Register the server:
Use the following command to register a deployment instance.
icsvrreg add -n <your_server> -t iws -d <iws_instance_directory>
Windows:
icsvrreg add -n iwsServer -t iws -d d:\iplanet\Servers\https-<webserver_instance>
Solaris:
icsvrreg add -n iwsServer -t iws -d /export/iplanet/Servers/https-<webserver_instance>
- Deploy the COTS Resource Adapter (COTS.rar).
Use the following command to deploy COTS resource adapter.
icradeploy deploy -s <your_server> -a <adapter_name> -r <rar_file>
Windows:
icradeploy deploy -s iwsServer -a COTS -r <connector_builder_install_root>\samples\cots\adapters\COTS\ship\cots.rar
Solaris:
icradeploy deploy -s iwsServer -a COTS -r <connector_builder_install_root>/samples/cots/adapters/COTS/ship/cots.rar
- Configure the connection factory with lookup name COTS
Use the following command to configure a connection factory with default parameters (ServerName: localhost and PortNumber:9999):
icconfig add -s iwsServer -n COTS -a COTS
You can use the -p option to set values other than the default for the connection factory.
Note You must restart the server for the changes to take effect.
J2EE RI Server 1.3.1
Use the J2EE RI Server Deployment Tool to deploy the sample resource adapter COTS packaged as COTS.rar file. The COTS.rar file is located under <connector_builder_install_root>/samples/cots/adapters/COTS/ship/ COTS.rar.
To Deploy the COTS Resource Adapter into the J2EE RI Server 1.3.1
- Open the COTS.rar using the File -> Open option of the RI Deployment Tool.
- Deploy the resource adapter using the Tools -> Deploy menu option.
- Add the Connection Factory with the lookup name COTS with default parameter values using the Servers->HostName->Resource Adapters tab.
Note You must restart the server for the changes to take effect.
Refer to J2EE RI documentation for details on how to deploy and configure connection factories.
Sun ONE Application Server 7.0
Use the Sun ONE Application Server to deploy the sample resource adapter COTS packaged as COTS.rar file. The COTS.rar file is located under <connector_builder_install_root>/samples/cots/adapters/COTS/ship/COTS.rar. For more information about deployment generated resource adapters see the Administrator's Guide for the Sun ONE Application Server 7.
Step 2 - Deploy the Web-Based Sample Application
This describes how to deploy the web-based applications (icbsample.ear and icbsample.war).
The web applications can be deployed into:
- iPlanet Application Server 6.5
- iPlanet Web Server 6.0
- J2EE RI Server 1.3.1
- Sun ONE Application Server 7.0
iPlanet Application Server 6.5
Use the iPlanet Application Server - Deployment Tool to deploy the sample application packaged as icbsample.ear. The icbsample.ear is located under <connector_builder_install_root>/samples/cots/application directory. Refer to iPlanet Application Server 6.5 documentation for details on how to use the iPlanet Application Server 6.5 Deployment Tool.
iPlanet Web Server 6.0
By default, the iPlanet Web Server is installed with JRE 1.2.2. The iPlanet Web Server must be configured with JDK 1.3.1 to deploy the sample application. Refer to the section To Configure iWS for JDK 1.3.1 on page 88.
Windows:
set IWS_SERVER_HOME=<web_server_home_directory>
For example: set IWS_SERVER_HOME=d:\iPlanet\Servers
Change directory to
<web_server_home_directory>\bin\https\httpadmin\bin.
Run the command: wdeploy deploy -u /icbsample -i <webserver_instance_name> -v <virtual_server_id> <connector_builder_install_root>\samples\cots\application\icbsample .war
For example: wdeploy deploy -u /icbsample -i https-myhost.acme.com -v https-myhost.acme.com d:\sun\samples\cots\application\icbsample.war
Solaris:
setenv IWS_SERVER_HOME=<web_server_home_directory>
For example (in csh): setenv IWS_SERVER_HOME /usr/iplanet/servers
cd to <web_server_home_directory>/bin/https/httpadmin/bin
Run the command: wdeploy deploy -u /icbsample -i <webserver_instance_name> -v <virtual_server_id> <connector_builder_install_root>/samples/cots/application/icbsample .war
For example: wdeploy deploy -u /icbsample -i https-myhost.acme.com -v https-myhost.acme.com /usr/sun/samples/cots/application/icbsample.war
The server should be restarted for the changes to take effect. Refer to iPlanet Web Server documentation for details on how to deploy web applications.
J2EE RI Server 1.3.1
Use the J2EE RI Server - Deployment Tool to deploy the sample application packaged as icbsample.ear. The icbsample.ear file is located in the <connector_builder_install_root>/samples/cots/application directory.
To Deploy the Sample Application
For more information about deploying generated resource adapters see the Administrator's Guide for the Sun ONE Application Server 7.
Sun ONE Application Server 7.0
Use the Sun ONE Application Server's web-based administration Console to deploy the sample application packaged as icbsample.war. The icbsample.war file is located in the <connector_builder_install_root>/samples/cots/application directory.
For more information about deployment of web applications see the Administrator's Guide for the Sun ONE Application Server 7.
Step 3 - Start the COTS EIS Server
To Start the COTS EIS Server
- Windows: Go to <connector_builder_install_root>\samples\cots\eissystem\bin
Solaris: Go to <connector_builder_install_root>/samples/cots/eissystem/bin
- Run iccotssvr.
You should see the message `Customer Order Tracking System is ready...' on the screen.
By default, the resource adapter and the COTS EIS server are configured for local host and port number 9999.
To use parameters other than default you need to reconfigure the connection factory parameters for lookup name COTS using icconfig command line tool and modify the iccotssvr script to use a different port.
Refer to <connector_builder_install_root>/samples/cots/eissystem/ README.txt for more details.
Step 4 - Run the Sample Application
To Run the Sample Application
You can access the COTS web application using the following URL:
For Sun ONE Application Server 7.0
http://<hostname:port>/icbsample and follow the instructions.
Default Port: 80
For iPlanet Application Server 6.5
http://<hostname:port>/NASApp/icbsample and follow the instructions.
Default Port: 80
For iPlanet Web Server 6.0
http://<hostname:port>/icbsample and follow the instructions.
Default Port: 80
For J2EE RI Server 1.3.1
http://<hostname:port>/icbsample and follow the instructions.
Default Port: 8000
The Customer Order Tracking System main screen is displayed when you select the above URL. You are provided with an option to execute the resource adapter using CCI or SOAP services. See the Sun ONE Connector Builder Developer's Guide for information about SOAP Services. If you have deployed the SOAP services, you can see the resource adapter working in both the modes.
Step 5 - Run Sample Tests Using the TestClient
Sample tests are packaged with the COTS resource adapter. These tests are automatically deployed as a part of the COTS resource adapter deployment. The source code and TestClient related configuration files are available under the <connector_builder_install_root>/samples/cots/adapters/COTS/test/ src directory. You might be required to update the COTStestrun.properties file to reflect your environment. Use the ictstclnt -i COTStestrun.properties command to run the sample tests against the deployed resource adapter. Refer to 9 in the Sun ONE Connector Builder Developer's Guide for further details on using the TestClient tool.
Step 6 - Deploy SOAP Services and Run the SOAP Clients (Optional)
After you generate a resource adapter with SOAP service you can deploy the resource adapter or run the SOAP clients as stand-alone Java applications.
Deploy COTS SOAP Services
You can deploy and configure the COTS SOAP Services into:
- iPlanet Application Server 6.5
- iPlanet Web Server 6.0
- J2EE RI Server 1.3.1
- Sun ONE Application Server 7.0
To Deploy the COTS Resource Adapter
- Use the following command to deploy the SOAP Services.
icwsdeploy deployall -s <your_server> -j <your_deployment_descriptor_jar>
For Windows:
icwsdeploy deployall -s myiws -j <connector_builder_install_root>\samples\cots\adapters\COTS\ship\CO TS-soapdd.jar
For Solaris:
icwsdeploy deployall -s myiws - <connector_builder_install_root>/samples/cots/adapters/COTS/ship/CO TS-Soapdd.jar
Note Refer to the Sun ONE Connector Builder Developer's Guide for details on setting up Apache SOAP in various platforms.
Running the SOAP Clients
The SOAP clients can be run as stand alone Java applications. You need to have the following in the classpath to run the SOAP clients as stand alone Java classes:
- SOAP library with its dependencies
- COTS API library
- the generated SOAP client jar file
- Connector Builder runtime library
For example, run the COTSAPIGetCustomerClient client by entering the following at the command prompt:
java com.sun.appinteg.samples.cots.soap.clients. COTSAPIGetCustomerClient.