Example: Obtaining option information for AdminApp object commands using wsadmin scripting
Use the taskInfo command of the AdminApp object to obtain information about the data needed for our application.
Provide data for rows or entries that are either missing information or require an update.
- Use the options command to see the requirements for an EAR file if you construct installation command lines. The taskInfo command provides detailed information for each task option with a default binding applied to the result.
- The options for the AdminApp install command can be complex if we specify various types of binding information; for example, JNDI name, data sources for enterprise bean modules, or virtual hosts for web modules. An way to specify command-line installation options is to use a feature of the installInteractive command that generates the options for you. After installing the application interactively once and specify all the updates needed, look for message WASX7278I in the wsadmin output log. The default output log for wsadmin is wsadmin.traceout. We can cut and paste the data in this message into a script, and modify it. For example:
(Dist)
WASX7278I: Generated command line: install c:/websphere/appserver/installableapps/jmsample.ear {-BindJndiForEJBNonMessageBinding {{deplmtest.jar MailEJBObject deplmtest.jar,META-INF/ejb-jar.xml ejb/JMSampEJB1 }} -MapResRefToEJB {{deplmtest.jar MailEJBObject deplmtest.jar,META-INF/ejb-jar.xml mail/MailSession9 javax.mail.Session mail/DefaultMailSessionX } {"JavaMail Sample WebApp" mtcomps.war,WEB-INF/web.xml mail/MailSession9 javax.mail.Session mail/DefaultMailSessionY }} -MapWebModToVH {{"JavaMail Sample WebApp" mtcomps.war,WEB-INF/web.xml newhost }} -nopreCompileJSPs -novalidateApp -installed.ear.destination c:/mylocation -distributeApp -nouseMetaDataFromBinary}(ZOS)
WASX7278I: Generated command line: install /websphere/appserver/installableapps/jmsample.ear {-BindJndiForEJBNonMessageBinding {{deplmtest.jar MailEJBObject deplmtest.jar,META-INF/ejb-jar.xml ejb/JMSampEJB1 }} -MapResRefToEJB {{deplmtest.jar MailEJBObject deplmtest.jar,META-INF/ejb-jar.xml mail/MailSession9 javax.mail.Session mail/DefaultMailSessionX } {"JavaMail Sample WebApp" mtcomps.war,WEB-INF/web.xml mail/MailSession9 javax.mail.Session mail/DefaultMailSessionY }} -MapWebModToVH {{"JavaMail Sample WebApp" mtcomps.war,WEB-INF/web.xml newhost }} -nopreCompileJSPs -novalidateApp -installed.ear.destination /mylocation -distributeApp -nouseMetaDataFromBinary}
Script and command line reference material Options for the AdminApp object install, installInteractive, edit, editInteractive, update, and updateInteractive commands Commands for the AdminApp object