Example: Migrating - Installing an application
The following examples demonstrate how to install an application in the WebSphere Application Server V4.0 and V5.0:
- wscp V4.0
- Construct the -modvirtualhosts option:
set modhost1 [list mtcomps.war default_host] set modhosts [list $modhost1]- Construct the -resourcereferences option:
set resref1 [list mtcomps.war::mail/MailSession9 mail/DefaultMailSession] set resref2 [list deplmtest.jar::MailEJBObject::mail/MailSession9 mail/DefaultMailSession] set resrefs [list $resref1 $resref2]- Install the application:
EnterpriseApp install /Node:mynode/ c:/WebSphere/AppServer/installableApps/jmsample.ear -appname MailSampleApp -defappserver /Node:$mynode/ApplicationServer:myserv/ -modvirtualhosts $modhosts -resourcereferences $resrefs
- wsadmin V5.0
The command sequence given below accomplishes approximately the same thing as the 4.0 commands above, but simpler ways exist.
- Construct the -MapWebModToVH option:
set modtovh1 [list "JavaMail Sample WebApp" mtcomps.war,WEB-INF/web.xml default_host] set modtovh [list $modtovh1]- Construct the -MapResRefToEJB option:
set resreftoejb1 [list deplmtest.jar MailEJBObject deplmtest.jar,META-INF/ejb-jar.xml mail/MailSession9 javax.mail.Session mail/DefaultMailSession] set resreftoejb2 [list "JavaMail Sample WebApp" "" mtcomps.war,WEB-INF/web.xml mail/MailSession9 javax.mail.Session mail/bozo] set resreftoejb [list $resreftoejb1 $resreftoejb2]- Construct the attribute string:
set attrs [list -MapWebModToVH $modtovh -MapResRefToEJB $resreftoejb -node mynode -server myserv -appname MailSampleApp]- Install the application:
$AdminApp install c:/WebSphere/AppServer/installableApps/jmsample.ear $attrs- Save your changes:
$AdminConfig save
Use the AdminApp taskInfo command to obtain information about each task option. Use the AdminApp interactiveInstall command to step through all the installation tasks, one at a time. If you use the installInteractive command to successfully install an application, an option string logs in the wsadmin.traceout file under the message ID WASX7278I. You can copy and paste this option string into wsadmin scripts.