Use the AdminApp object to install, modify, and administer applications. The AdminApp object interacts with the WebSphere Application Server management and configuration services to make application inquiries and changes. This interaction includes installing and uninstalling applications, listing modules, exporting, and so on.
You can start the scripting client when no server is running, if you want to use only local operations. To run in local mode, use the -conntype NONE option to start the scripting client. You receive a message that you are running in the local mode. Running the AdminApp object in local mode when a server is currently running is not recommended. This is because any configuration changes made in local mode will not be reflected in the running server configuration and vice versa. If you save a conflicting configuration, you could corrupt the configuration. In a deployment manager environment, configuration updates are available only if a scripting client is connected to a deployment manager. When connected to a node agent or a managed application server, you will not be able to update the configuration because the configuration for these server processes are copies of the master configuration which resides in the deployment manager. The copies are created on a node machine when a configuration synchronization occurs between the deployment manager and the node agent. Make configuration changes to the server processes by connecting a scripting client to a deployment manager. For this reason, to change a configuration, do not run a scripting client in local mode on a node machine. It is not a supported configuration.
The following commands are available for the AdminApp object:
Command name: | Parameters and return values: | Examples: | |
deleteUserAndGroupEntries | Deletes users or groups for all roles, and deletes user IDs and passwords for all of the RunAs roles that are defined in the application. |
|
Example usage: Using Jacl: $AdminApp deleteUserAndGroupEntries myappUsing Jython: AdminApp.deleteUserAndGroupEntries('myapp') |
edit | Edits an application or module in non-interactive mode.
The edit command changes the application deployment. Specify these changes in the options parameter. No options are required for the edit command. |
|
Example usage: Using Jacl: $AdminApp edit "JavaMail Sample" {-MapWebModToVH {{"JavaMail Sample WebApp" mtcomps.war,WEB-INF/web.xml newVH}}}Using Jython with string options: AdminApp.edit("JavaMail Sample", '[-MapWebModToVH [["JavaMail 32 Sample WebApp" mtcomps.war,WEB-INF/web.xml newVH]]]')Using Jython with list options: option = [["JavaMail 32 Sample WebApp", "mtcomps.war,WEB-INF/web.xml", "newVH"]] mapVHOption = ["-MapWebModToVH", option] AdminApp.edit("JavaMail Sample", mapVHOption) |
editInteractive | Edits an application or module in interactive mode.
The editInteractive command changes the application deployment. Specify these changes in the options parameter. No options are required for the editInteractive command. |
|
Example usage: Using Jacl: $AdminApp editInteractive ivtAppUsing Jython: AdminApp.editInteractive('ivtApp') |
export | Exports the application appname parameter to a file that you specify by file name. |
|
Example usage: Using Jacl: $AdminApp export "My App" /usr/me/myapp.earUsing Jython: AdminApp.export("My App", '/usr/me/myapp.ear') |
exportDDL | Extracts the data definition language (DDL) from the application appname parameter to the directoryname parameter that a directory specifies. The options parameter is optional. |
|
Example usage: Using Jacl: $AdminApp exportDDL "My App" /usr/me/DDL {-ddlprefix myApp}Using Jython: AdminApp.exportDDL("My App", '/usr/me/DDL', '[-ddlprefix myApp]') |
help | Displays general help for the AdminApp object. |
|
Example usage: Using Jacl: $AdminApp helpUsing Jython: print AdminApp.help()Example output: WASX7095I: The AdminApp object allows application objects to be manipulated including installing, uninstalling, editing, and listing. Most of the commands supported by AdminApp operate in two modes: the default mode is one in which AdminApp communicates with the WebSphere Application Server to accomplish its tasks. A local mode is also possible, in which no server communication takes place. The local mode of operation is invoked by including the "-conntype NONE" flag in the option string supplied to the command. The following commands are supported by AdminApp; more detailed information about each of these commands is available by using the "help" command of AdminApp and supplying the name of the command as an argument. edit Edit the properties of an application editInteractive Edit the properties of an application interactively export Export application to a file exportDDL Extract DDL from application to a directory help Show help information install Installs an application, given a file name and an option string. installInteractive Installs an application in interactive mode, given a file name and an option string. list List all installed applications listModules List the modules in a specified application options Shows the options available, either for a given file, or in general. taskInfo Shows detailed information pertaining to a given installation task for a given file uninstall Uninstalls an application, given an application name and an option string |
help | Displays help for an AdminApp command or installation option. |
|
Example usage: Using Jacl: $AdminApp help uninstallUsing Jython: print AdminApp.help('uninstall')Example output: WASX7102I: Method: uninstall Arguments: application name, options Description: Uninstalls application named by "application name" using the options supplied by String 2. Method: uninstall Arguments: application name Description: Uninstalls the application specified by "application name" using default options. |
install | Installs an application in non-interactive mode, given a fully qualified file name and a string of installation options. The options parameter is optional. |
|
Example usage: Using Jacl: $AdminApp install /home/myDir/apps/myApp.earUsing Jython: AdminApp.install('/home/myDir/apps/myApp.ear')Many options are available for this command. You can obtain a list of valid options for an Enterprise Archive (EAR) file with the following command: Using Jacl: $AdminApp options myApp.earUsing Jython: AdminApp.options('myApp.ear')You can also obtain help for each object with the following command: Using Jacl: $AdminApp help MapModulesToServersUsing Jython: AdminApp.help('MapModulesToServers') |
installInteractive | Installs an application in interactive mode, given a fully qualified file name and a string of installation options. The options parameter is optional. |
|
Example usage: Using Jacl: $AdminApp installInteractive /QIBM/ProdData/WebSphere/AppServer/V6/ installableApps/jmsample.earUsing Jython: AdminApp.installInteractive('/QIBM/ProdData/WebSphere/AppServer/V6/ installableApps/jmsample.ear') |
isAppReady | Tests to see if the specified application has been distributed and is ready to be run. Returns a value of true if the application is ready, or a value of false if the application is not ready. This command is not supported when the wsadmin tool is not connected to a server. |
|
Example usage: Using Jacl: $AdminApp isAppReady DefaultApplicationUsing Jython: AdminApp.isAppReady('DefaultApplication')Example output: ADMA5071I: Distribution status check started for application DefaultApplication. WebSphere:cell=Node03Cell,node=myNode,distribution=true ADMA5011I: The cleanup of the temp directory for application DefaultApplication is complete. ADMA5072I: Distribution status check completed for application DefaultApplication. true |
isAppReady | Tests to see if the specified application has been distributed and is ready to be run. Valid values for the ignoreUnknownState parameter include true and false . If you specify a value of true , nodes and servers with an unknown state will not be included in the final ready return. The command returns a value of true if the application is ready or a value of false if the application is not ready. This command is not supported when the wsadmin tool is not connected to a server. |
|
Example usage: Using Jacl: $AdminApp isAppReady TEST trueUsing Jython: AdminApp.isAppReady('TEST', 'true')Example output: ADMA5071I: Distribution status check started for application TEST. WebSphere:cell=myCell,node=myNode,distribution=unknown ADMA5011I: The cleanup of the temp directory for application TEST is complete. ADMA5072I: Distribution status check completed for application TEST. false |
list | Lists the applications that are installed in the configuration. |
|
Example usage: Using Jacl: $AdminApp listUsing Jython: print AdminApp.list()Example output: adminconsole DefaultApplication ivtApp |
listModules | Lists the modules in an application.
The options parameter is optional. The valid option is -server. This option lists the application servers on which the modules are installed. |
|
Example usage: Using Jacl: $AdminApp listModules ivtAppUsing Jython: print AdminApp.listModules('ivtApp')Example output: ivtApp#ivtEJB.jar+META-INF/ejb-jar.xml ivtApp#ivt_app.war+WEB-INF/web.xmlThis example is formed by the concatenation of appname, #, module URI, +, and DD URI. You can pass this string to the edit and editInteractive AdminApp commands. |
options | Displays a list of options for installing an Enterprise Archive (EAR) file. |
|
Example usage: Using Jacl: $AdminApp options /QIBM/ProdData/WebSphere/AppServer/V6/installableApps/ivtApp.earUsing Jython: AdminApp.options('/QIBM/ProdData/WebSphere/AppServer/V6/installableApps/ivtApp.ear')Example usage: WASX7112I: The following options are valid for "/QIBM/ProdData/WebSphere/AppServer/V6/installableapps/ivtApp.ear" MapRolesToUsers BindJndiForEJBNonMessageBinding MapEJBRefToEJB MapWebModToVH MapModulesToServers EnsureMethodProtectionFor10EJB GetServerName preCompileJSPs nopreCompileJSPs distributeApp nodistributeApp useMetaDataFromBinary nouseMetaDataFromBinary deployejb nodeployejb createMBeansForResources nocreateMBeansForResources reloadEnabled noreloadEnabled deployws nodeployws usedefaultbindings defaultbinding.force allowPermInFilterPolicy noallowPermInFilterPolicy verbose update update.ignore.old update.ignore.new installed.ear.destination appname reloadInterval validateinstall deployejb.rmic deployejb.dbtype deployejb.dbschema deployejb.classpath deployws.classpath deployws.jardirs defaultbinding.datasource.jndi defaultbinding.datasource.username defaultbinding.datasource.password defaultbinding.cf.jndi defaultbinding.cf.resauth defaultbinding.ejbjndi.prefix defaultbinding.virtual.host defaultbinding.strategy.file server node cell |
options | Displays a list of options for editing an existing application. |
|
Example usage: Using Jacl: $AdminApp options ivtAppUsing Jython: AdminApp.options('ivtApp')Example output: WASX7112I: The following options are valid for "ivtApp" MapRolesToUsers BindJndiForEJBNonMessageBinding MapEJBRefToEJB MapWebModToVH MapModulesToServers distributeApp nodistributeApp useMetaDataFromBinary nouseMetaDataFromBinary createMBeansForResources nocreateMBeansForResources reloadEnabled noreloadEnabled verbose installed.ear.destination reloadInterval |
options | Displays a list of options for editing a module in an existing application. |
|
Example usage: Using Jacl: $AdminApp options ivtApp#ivtEJB.jar+META-INF/ejb-jar.xmlUsing Jython: AdminApp.options('ivtApp#ivtEJB.jar+META-INF/ejb-jar.xml')Example output: WASX7112I: The following options are valid for "ivtApp#ivtEJB.jar+META-INF/ejb-jar.xml" MapRolesToUsers BindJndiForEJBNonMessageBinding MapModulesToServers verbose |
options | Displays a list of options for installing or updating
an application or application module file. |
|
Example using the updateapp operation: Using Jacl: $AdminApp options /QIBM/ProdData/WebSphere/AppServer/V6/installableApps/ ivtApp.ear updateappUsing Jython: AdminApp.options('/QIBM/ProdData/WebSphere/AppServer/V6/installableApps/ ivtApp.ear', 'updateapp') Example using the addmodule operation: Using Jacl: $AdminApp options myModule.jar addmoduleUsing Jython: AdminApp.options('DefaultWebApplication.war', 'addmodule')Example output using the updateapp operation: WASX7112I: The following options are valid for "/QIBM/ProdData/WebSphere/AppServer/V6/installableApps/ivtApp.ear" MapRolesToUsers BindJndiForEJBNonMessageBinding MapEJBRefToEJB MapWebModToVH MapModulesToServers EnsureMethodProtectionFor10EJB GetServerName preCompileJSPs nopreCompileJSPs distributeApp nodistributeApp useMetaDataFromBinary nouseMetaDataFromBinary deployejb nodeployejb createMBeansForResources nocreateMBeansForResources reloadEnabled noreloadEnabled deployws nodeployws usedefaultbindings defaultbinding.force allowPermInFilterPolicy noallowPermInFilterPolicy verbose update update.ignore.old update.ignore.new installed.ear.destination reloadInterval deployejb.rmic deployejb.dbtype deployejb.dbschema deployejb.classpath deployws.classpath deployws.jardirs defaultbinding.datasource.jndi defaultbinding.datasource.username defaultbinding.datasource.password defaultbinding.cf.jndi defaultbinding.cf.resauth defaultbinding.ejbjndi.prefix defaultbinding.virtual.host defaultbinding.strategy.file appname contextroot custom contenturi contents operationExample output using the addmodule operation: WASX7112I: The following options are valid for "DefaultWebApplication.war" MapRolesToUsers MapEJBRefToEJB MapWebModToVH MapModulesToServers GetServerName preCompileJSPs nopreCompileJSPs deployejb nodeployejb deployws nodeployws usedefaultbindings defaultbinding.force verbose defaultbinding.datasource.jndi defaultbinding.datasource.username defaultbinding.datasource.password defaultbinding.cf.jndi defaultbinding.cf.resauth defaultbinding.ejbjndi.prefix defaultbinding.virtual.host defaultbinding.strategy.file server node cell |
publishWSDL | Publishes Web Services Description Language (WSDL) files for the application that is specified in the appname parameter to the file that is specified in the filename parameter. |
|
Example usage: Using Jacl: $AdminApp publishWSDL JAXRPCHandlerServer /home/myDir/temp/a.zipUsing Jython: AdminApp.publishWSDL('JAXRPCHandlerServer', '/home/myDir/temp/a.zip') |
publishWSDL | Publishes Web Services Description Language (WSDL) files for the application that is specified in the appname parameter to the file that is specified in the filename parameter using the SOAP address prefixes that are specified in the soapAddressPrefixes parameter. |
|
Example usage: Using Jacl: $AdminApp publishWSDL JAXRPCHandlersServer /home/myDir/temp/a.zip {{JAXRPCHandlersServerApp.war {{http http://localhost:9080}}}}Using Jython: AdminApp.publishWSDL('JAXRPCHandlersServer', '/home/myDir/temp/a.zip', '[[JAXRPCHandlersServerApp.war [[http http://localhost:9080]]]]') |
searchJNDIReferences | Lists applications that refer to the Java Naming and Directory Interface (JNDI) name on a specific node. |
|
Example usage: The following example assumes that an installed application named MyApp has a JNDI name of eis/J2CCF1. Using Jacl: $AdminApp searchJNDIReferences $node {-JNDIName eis/J2CCF1 -verbose}Using Jython: print AdminApp.searchJNDIReferences(node, '[-JNDIName eis/J2CCF1 -verbose]')Example output: WASX7410W: This operation may take a while depending on the number of applications installed in your system. MyApp MapResRefToEJB :ejb-jar-ic.jar : [eis/J2CCF1] |
taskInfo | Provides information about a particular task option for an application file. |
|
Example usage: Using Jacl: $AdminApp taskInfo /QIBM/ProdData/WebSphere/AppServer/V6/installableApps/jmsample.ear MapWebModToVHUsing Jython: print AdminApp.taskInfo('/QIBM/ProdData/WebSphere/AppServer/V6/installableApps/jmsample.ear', 'MapWebModToVH')Example output: MapWebModToVH: Selecting virtual hosts for Web modules Specify the virtual host where you want to install the Web modules that are contained in your application. Web modules can be installed on the same virtual host or dispersed among several hosts. Each element of the MapWebModToVH task consists of the following three fields: "webModule," "uri," "virtualHost." Of these fields, the following fields might be assigned new values: "virtualHost"and the following are required: "virtualHost" The current contents of the task after running default bindings are: webModule: JavaMail Sample WebApp uri: mtcomps.war,WEB-INF/web.xml virtualHost: default_host |
uninstall | Uninstalls an existing application. |
|
Example usage: Using Jacl: $AdminApp uninstall myAppUsing Jython: AdminApp.uninstall('myApp')Example output: ADMA5017I: Uninstallation of myapp started. ADMA5104I: Server index entry for myCellManager was updated successfully. ADMA5102I: Deletion of config data for myapp from config repository completed successfully. ADMA5011I: Cleanup of temp dir for app myapp done. ADMA5106I: Application myapp uninstalled successfully. |
updateAccessIDs | Updates the access ID information for users and groups that are assigned to various roles that are defined in the application. The access IDs are read from the user registry and saved in the application bindings.
This operation improves run-time performance of the application. Call this command after installing an application or after editing security role-specific information for an installed application. This method cannot be invoked when the -conntype option is set to NONE. You must be connected to a server to invoke this command.
The bALL Boolean parameter retrieves and saves all access IDs for users and groups in the application bindings. Specify false if you want to retrieve access IDs for users or groups that do not have an access ID in the application bindings. |
|
Example usage: Using Jacl: $AdminApp updateAccessIDs myapp trueUsing Jython: AdminApp.updateAccessIDs('myapp', 'true') |
view | View the task that is specified by the taskname option parameter for the application or by the module that is specified by the name parameter. Use -tasknames as the option to get a list of valid task names for the application. Otherwise, specify one or more task names as the option. |
|
Example usage: Using Jacl: $AdminApp view adminconsole {-tasknames}Using Jython: AdminApp.view('adminconsole', ['-tasknames'])Example output: MapModulesToServers MapWebModToVH MapRolesToUsersUsing Jacl: $AdminApp view adminconsole {-MapModulesToServers}Using Jython: AdminApp.view('adminconsole', ['-MapModulesToServers']) Example output: MapModulesToServers: Selecting Application Servers Specify the application server where you want to install the modules that are contained in your application. Modules can be installed on the same server or dispersed among several servers: Module: adminconsole URI: adminconsole.war,WEB-INF/web.xml Server: WebSphere:cell=juniartiNetwork,node=juniartiManager,server=dmgr Example usage: Using Jacl: $AdminApp view adminconsole#adminconsole.war+WEB-INF/Using Jython: AdminApp.view('adminconsole#adminconsole.war+WEB-INF/ web.xml', ['-MapRolesToUsers']) Example output: MapRolesToUsers: Mapping Users to Roles Each role that is defined in the application or the module must be mapped to a user or a group from the user registry of the domain: Role: administrator Everyone?: No All Authenticated?: No Mapped Users: Mapped Groups: Role: operator Everyone?: No All Authenticated?: No Mapped Users: Mapped Groups: Role: configurator Everyone?: No All Authenticated?: No Mapped Users: Mapped Groups: Role: monitor Everyone?: No All Authenticated?: No Mapped Users: Mapped Groups: |
update | Updates an application in non-interactive mode. Provide the application name, content type, and update options. |
|
Example usage: Using Jacl: $AdminApp update myApp file {-operation add -contents /home/myDir/myApps/web.xml -contenturi META-INF/web.xml}Using Jython with string options: AdminApp.update('myApp', 'file', '[-operation add -contents /home/myDir/myApps/web.xml -contenturi META-INF/web.xml]')Using Jython with list options: AdminApp.update('myApp', 'file', ['-operation', 'add', '-contents', '/home/myDir/myApps/web.xml', '-contenturi', 'META-INF/web.xml']) |
updateInteractive | Updates an application in interactive mode. Provide the application name, content type, and update options. |
|
Example usage: Using Jacl: $AdminApp updateInteractive myApp modulefile {-operation add -contents /home/myDir/myApps/Increment.jar -contenturi Increment.jar -nodeployejb -BindJndiForEJBNonMessageBinding {{"Increment Enterprise JavaBeans" Increment Increment. jar,META-INF/ejb-jar.xml Inc}}}Using Jython string: AdminApp.updateInteractive('myApp', 'modulefile', '[-operation add -contents /home/myDir/myApps/Increment.jar -contenturi Increment.jar -nodeployejb -BindJndiForEJBNonMessageBinding [["Increment Enterprise JavaBeans" Increment Increment. jar,META-INF/ejb-jar.xml Inc]]]')Using Jython list: bindJndiForEJBValue = [["Increment Enterprise JavaBeans", "Increment", "Increment.jar,META-INF/ejb-jar.xml", "Inc"]] AdminApp.updateInteractive('myApp', 'modulefile', ['-operation', 'add', '-contents', '/home/myDir/myApps/Increment.jar', '-contenturi', 'Increment.jar', '-nodeployejb', '-BindJndiForEJBNonMessageBinding', bindJndiForEJBValue]) |
Related concepts
AdminApp object for scripted administration