Example: Migrating - Installing an application

The following examples demonstrate how to install an application in WAS V4.0 and V6.x:

  • 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 V6.x

    The following command sequence accomplishes approximately the same thing as the V4.0 commands previously presented, but simpler ways exist:

    • Construct the -MapWebModToVH option:

      Jacl

      set modtovh1 [list "JavaMail Sample WebApp" mtcomps.war,WEB-INF/web.xml default_host] 
      set modtovh [list $modtovh1]
      

      Jython

      modtovh1 = ["JavaMail Sample WebApp", 'mtcomps.war,WEB-INF/web.xml', 'default_host']
      modtovh = [modtovh1]
      

    • Construct the -MapResRefToEJB option:

      Jacl

      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]
      

      Jython

      resreftoejb1 = [['deplmtest.jar', 'MailEJBObject', 'deplmtest.jar,META-INF/ejb-jar.xml', 'mail/MailSession9', 'javax.mail.Session', 'mail/DefaultMailSession']]
        resreftoejb2 = [["JavaMail Sample WebApp", ' ', 'mtcomps.war,WEB-INF/web.xml', 'mail/MailSession9', 'javax.mail.Session', 'mail/bozo']]
      

    • Construct the attribute string:

      Jacl

      set attrs [list -MapWebModToVH $modtovh -MapResRefToEJB $resreftoejb -node mynode -server myserv -appname MailSampleApp]
      

      Jython

      attrs = ['-MapWebModToVH', modtovh, '-MapResRefToEJB', resreftoejb1, '-MapResRefToEJB', resreftoejb2, '-node', 'mynode', '-server', 'myserv', '-appname', 'MailSampleApp']
      

    • Install the application:

      Jacl

      $AdminApp install c:/WebSphere/AppServer/installableApps/jmsample.ear $attrs
      

      Jython

      AdminApp.install('c:/WebSphere/AppServer/installableApps/jmsample.ear', attrs)
      

    • Save your changes:

      $AdminConfig save
      

      Jython

      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. We can copy and paste this option string into wsadmin scripts.