使用 wsadmin 脚本编制的 AdminApp 对象的命令
使用 AdminApp 对象来安装、修改和管理应用程序。
AdminApp 对象与 WebSphere® Application Server 管理和配置服务进行交互,以进行应用程序查询和更改。 此交互包含安装和卸载应用程序、列示模块和导出等。
如果您只要使用本地操作,那么当无服务器运行时您可启动脚本客户机。 要以本地方式运行,使用 -conntype NONE 选项启动脚本客户机。 您会接收到正在以本地方式运行的消息。 建议服务器运行的时候不要以本地方式运行 AdminApp 对象。 这是因为以本地方式进行的任何配置更改将不会反映到正在运行的服务器配置中,反之亦然。 如果您保存冲突的配置,那么会毁坏配置。
wsadmin -conntype NONE以本地方式部署应用程序,那么必须修改 install_root/bin 目录中的 wsadmin.bat 或 wsadmin.sh 命令文件。 请完成下列步骤:- 生成 install_root/bin/wsadmin.bat 或 install_dir/bin/wsadmin.bat 文件的备份副本。
- 在调用 setupCmdLine.bat 或 setupCmdLine.sh 文件之后,将以下代码行直接添加到 wsadmin 文件:
LIBPATH="$WAS_LIBPATH":$LIBPATH export LIBPATH EXTSHMSHLIB_PATH="$WAS_LIBPATH":$SHLIB_PATH export SHLIB_PATHLD_LIBRARY_PATH="$WAS_LIBPATH":$LD_LIBRARY_PATH export LD_LIBRARY_PATHSET PATH=%WAS_PATH%避免麻烦: 请勿在先前的 export 语句中指定 LD_LIBRARY_PATH_64 而不是 LD_LIBRARY_PATH。 指定该导出语句上的 LD_LIBRARY_PATH_64 覆盖存在于其他脚本中的任何 LD_LIBRARY_PATH 值。
- 保存更新的 wsadmin.bat 或 wsadmin.sh 文件。
- 部署该应用程序。
但是, Java EE 5 或更高版本的模块可以存在于包含Java EE 5 之前的文件并使用 .xmi 文件扩展名的应用程序中。
ibm-webservices-ext.xmi、ibm-webservices-bnd.xmi、ibm-webservicesclient-bnd.xmi、ibm-webservicesclient-ext.xmi 和 ibm-portlet-ext.xmi 文件继续使用 .xmi 文件扩展名。
deleteUserAndGroupEntries
使用 deleteUserAndGroupEntries 命令来删除所有角色的用户或组,以及删除在应用程序中定义的所有 RunAs 角色的用户标识和密码。
目标对象
无。必需参数
- application name
- 指定相关的应用程序。
可选参数
无。示例
- 使用 Jacl:
$AdminApp deleteUserAndGroupEntries myapp - 使用 Jython 字符串:
print AdminApp.deleteUserAndGroupEntries('myapp') - 使用 Jython 列表:
print AdminApp.deleteUserAndGroupEntries(['myapp'])
编辑
使用 edit 命令以批处理方式编辑应用程序或模块。 edit 命令将使用 options 参数指定的选项来更改由 application name 参数指定的应用程序。 edit 命令不需要选项。
目标对象
无。必需参数
- 应用程序名称
- 指定相关的应用程序。
- 选项
- 指定要应用于应用程序或模块配置的选项。
可选参数
无。示例
- 使用 Jacl:
$AdminApp edit "JavaMail Sample" {-MapWebModToVH {{"JavaMail Sample WebApp" mtcomps.war,WEB-INF/web.xml newVH}}} - 使用 Jython 字符串:
print AdminApp.edit("JavaMail Sample", '[-MapWebModToVH [["JavaMail 32 Sample WebApp" mtcomps.war,WEB-INF/web.xml newVH]]]') - 使用 Jython 列表:
option = [["JavaMail 32 Sample WebApp", "mtcomps.war,WEB-INF/web.xml", "newVH"]] mapVHOption = ["-MapWebModToVH", option] print AdminApp.edit("JavaMail Sample", mapVHOption)
editInteractive
使用 editInteractive 命令以交互方式编辑应用程序或模块。 editInteractive 命令将更改应用程序部署。 在 options 参数中指定这些更改。 editInteractive 命令不需要选项。
目标对象
无。必需参数
- 应用程序名称
- 指定相关的应用程序。
- 选项
- 指定要应用于应用程序或模块配置的选项。
可选参数
无。示例
- 使用 Jacl:
$AdminApp editInteractive ivtApp - 使用 Jython 字符串:
AdminApp.editInteractive('ivtApp')
导出
使用 export 命令将 application name 参数导出到您通过 file name 指定的文件中。
目标对象
无。必需参数
- 应用程序名称
- 指定相关的应用程序。
- 文件名
- 指定要将应用程序名称导出至的文件名。
可选参数
- exportToLocal
- 指定系统应该将相关应用程序导出至具有本地客户端机器上指定的文件名的文件。
示例
- 使用 Jacl:
$AdminApp export DefaultApplication c:/temp/export.ear {-exportToLocal} - 使用 Jython:
AdminApp.export('DefaultApplication', 'c:/temp/export.ear', '[-exportToLocal]')
exportDDL
使用 exportDDL 命令将数据定义语言 (DDL) 从 application name 参数抽取到目录指定的 directory name 参数。 options 参数是可选的。
目标对象
无。必需参数
- 应用程序名称
- 指定相关的应用程序。
- 目录名称
- 指定要将应用程序名称导出至的目录的名称。
可选参数
- 选项
- 指定要传递给指定的应用程序名称的选项。
示例
- 使用 Jacl:
$AdminApp exportDDL "My App" /usr/me/DDL {-ddlprefix myApp} - 使用 Jython 字符串:
print AdminApp.exportDDL("My App", '/usr/me/DDL', '[-ddlprefix myApp]')
exportFile
使用 exportFile 命令从相关的应用程序中导出用统一资源标识 (URI) 指定的单个文件的内容。
目标对象
无。必需参数
- 应用程序名称
- 指定相关的应用程序。
- URI
- 指定要导出的单个文件。 在应用程序的上下文中指定该 URI,如以下示例所示:
META-INF/application.xml。 要指定模块中的文件,该 URI 应以模块 URI 开头,如以下示例中所示:foo.war/WEB-INF/web.xml。 - 文件名
- 指定文件导出目标的标准路径和文件名。
可选参数
无。示例
- 使用 Jacl:
$AdminApp exportFile "My App" myapp/components.jar/META-INF/ibm-ejb-jar-bnd.xml META-INF/ibm-ejb-jar-bnd.xml - 使用 Jython 字符串:
AdminApp.exportFile('My App', 'myapp/components.jar/META-INF/ibm-ejb-jar-bnd.xml', 'META-INF/ibm-ejb-jar-bnd.xml')
getDeployStatus
使用 getDeployStatus 命令显示应用程序的部署状态。 安装或更新大型应用程序后,请使用此命令来显示应用程序二进制文件扩展的详细状态信息。 在系统抽取应用程序二进制文件后,您才能启动该应用程序。
目标对象
无。必需参数
- 应用程序名称
- 指定相关应用程序的名称。
可选参数
无。示例
- 使用 Jacl:
$AdminApp getDeployStatus myApplication - 使用 Jython:
print AdminApp.getDeployStatus('myApplication')
运行 getDeployStatus 命令,其中 myApplication 是有关类似以下内容的 DefaultApplication 的状态信息中的 DefaultApplication 结果:
ADMA5071I: Distribution status check started for application DefaultApplication.
WebSphere:cell=myCell01,node=myNode01,distribution=unknown,expansion=unknown
ADMA5011I: The cleanup of the temp directory for application DefaultApplication is complete.
ADMA5072I: Distribution status check completed for application DefaultApplication.
WebSphere:cell=myCell01,node=myNode01,distribution=unknown,expansion=unknown
帮助
使用 help 命令来显示有关 AdminApp 对象的一般帮助信息。
目标对象
无。必需参数
无。可选参数
- 操作名
- 指定此选项以显示有关 AdminApp 命令或安装选项的帮助。
样本输出
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 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
uninstall,那么将返回以下输出: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.
示例
- 以下示例未指定任何参数:
$AdminApp help - 以下示例指定了 operation name 参数:
$AdminApp help uninstall
- 以下示例未指定任何参数:
print AdminApp.help() - 以下示例指定了 operation name 参数:
print AdminApp.help('uninstall')
install
使用 install 命令并提供标准文件名和安装选项字符串来以非交互方式安装应用程序。 options 参数是可选的。
目标对象
无。必需参数
- ear 文件
- 指定要安装的 .ear 文件的路径。
可选参数
- 选项
- 指定命令的安装选项。
示例
- 使用 Jacl:
$AdminApp install c:/apps/myapp.ear - 使用 Jython:
print AdminApp.install('c:/apps/myapp.ear')
使用 Jacl:
$AdminApp options myApp.earprint AdminApp.options('myApp.ear')使用 Jacl:
$AdminApp help MapModulesToServersprint AdminApp.help('MapModulesToServers')installInteractive
使用 installInteractive 命令并提供标准文件名和安装选项字符串来以交互方式安装应用程序。 options 参数是可选的。
目标对象
无。必需参数
- ear 文件
- 指定要安装的 .ear 文件的路径。
可选参数
- 选项
- 指定命令的安装选项。
示例
- 使用 Jacl:
$AdminApp installInteractive c:/websphere/appserver/installableApps/jmsample.ear - 使用 Jython:
print AdminApp.installInteractive('c:/websphere/appserver/installableApps/jmsample.ear')
isAppReady
使用 isAppReady 命令来确定是否已分发并且已准备好运行所指定的应用程序。 如果应用程序已准备就绪,那么返回值 true,如果应用程序未准备就绪,那么返回值 false。 调用 isAppReady 的脚本通常安装或更新应用程序,然后循环执行该调用,直到该调用返回值 true 后才启动该应用程序。 当 wsadmin 工具未连接到服务器时,此命令不受支持。
目标对象
无。必需参数
- 应用程序名称
- 指定相关应用程序的名称。
可选参数
- ignoreUnknownState
- 测试是否已分发并且已准备好运行所指定的应用程序。 ignoreUnknownState 参数的有效值包括
true和false。 如果您指定值true,那么具有未知状态的节点和服务器将不会包括在最终的就绪返回中。 如果应用程序已准备就绪,那么命令返回值true,如果应用程序未准备就绪,那么返回值false。 当 wsadmin 工具未连接到服务器时,此命令不受支持。
样本输出
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.trueADMA5071I: 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
示例
- 使用 Jacl:
set result [$AdminApp isAppReady DefaultApplication] while {$result == "false"} { ### Wait 5 seconds before checking again after 5000 set result [$AdminApp isAppReady DefaultApplication] } puts "Starting application..." - 使用 Jython:
import time result = AdminApp.isAppReady('DefaultApplication') while (result == "false") : ### Wait 5 seconds before checking again time.sleep(5) result = AdminApp.isAppReady ('DefaultApplication') print("Starting application...")
- 使用 Jacl:
set result [$AdminApp isAppReady DefaultApplication] while {$result == "false"} { ### Wait 5 seconds before checking again after 5000 set result [$AdminApp isAppReady DefaultApplication] } puts "Starting application..." - 使用 Jython:
import time result = AdminApp.isAppReady ('DefaultApplication') while (result == "false"): ### Wait 5 seconds before checking again time.sleep(5) result = AdminApp.isAppReady ('DefaultApplication') print("Starting application...")
列表
使用 list 命令来列示配置中已安装的应用程序。
目标对象
无。必需参数
无。可选参数
- 目标
- 列出配置中安装在给定目标作用域的应用程序。
样本输出
adminconsole
DefaultApplication
ivtApp
示例
- 使用 Jacl:
$AdminApp list - 使用 Jython:
print AdminApp.list()
- 使用 Jacl:
$AdminApp list WebSphere:cell=myCell,node=myNode,server=myServer - 使用 Jython:
print AdminApp.list("WebSphere:cell=myCell,node=myNode,server=myServer")
listModules
使用 listModules 命令来列示应用程序中的模块。
目标对象
无。必需参数
- 应用程序名称
- 指定相关的应用程序。
可选参数
- 选项
- 指定安装了模块的应用程序服务器的列表。 options 参数是可选的。 有效选项为 -server。
样本输出
ivtApp#ivtEJB.jar+META-INF/ejb-jar.xml
ivtApp#ivt_app.war+WEB-INF/web.xml示例
- 使用 Jacl:
$AdminApp listModules ivtApp - 使用 Jython:
print AdminApp.listModules('ivtApp')
选项
使用 options 命令可显示用于安装企业归档 (EAR) 文件的选项列表。
目标对象
无。必需参数
无。可选参数
- EAR 文件
- 指定相关的 EAR 文件。
- 应用程序名称
- 指定要对其显示用于编辑现有应用程序的选项列表的应用程序。
- application module name
- 指定要对其显示用于编辑现有应用程序中的模块的选项列表的模块名。 此参数需要与由 listModules 命令返回的输出相同的模块名称格式。
- file, operations
- 显示用于安装或更新应用程序或应用程序模块文件的选项列表。 指定下列其中一个有效值:
- installapp - 使用此选项可安装所指定的文件。
- updateapp - 使用此选项并用已指定的文件可更新现有应用程序。
- addmodule - 使用此选项可将指定的模块文件添加至现有应用程序。
- updatemodule - 使用此选项并用已指定的模块文件可更新应用程序中的现有模块。
样本输出
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
示例
- 使用 Jacl:
$AdminApp options c:/websphere/appserver/installableApps/ivtApp.ear - 使用 Jython:
print AdminApp.options('c:/websphere/appserver/installableApps/ivtApp.ear')
- 使用 Jacl:
$AdminApp options ivtApp - 使用 Jython:
print AdminApp.options('ivtApp')
- 使用 Jacl:
$AdminApp options ivtApp#ivtEJB.jar+META-INF/ejb-jar.xml - 使用 Jython:
print AdminApp.options('ivtApp#ivtEJB.jar+META-INF/ejb-jar.xml')
- 使用 Jacl:
$AdminApp options c:/websphere/appserver/installableApps/ivtApp.ear updateapp - 使用 Jython:
print AdminApp.options('c:/websphere/appserver/installableApps/ivtApp.ear', 'updateapp')
publishWSDL
使用 publishWSDL 命令将在 application name 参数中指定的应用程序的 Web 服务描述语言 (WSDL) 文件发布到在 file name 参数中指定的文件。
目标对象
无。必需参数
- 文件名
- 指定相关文件。
- 应用程序名称
- 指定相关应用程序。
可选参数
- SOAP address prefixes
- 指定要使用的 SOAP 地址前缀。
样本输出
publishWSDL 命令不会返回输出。
示例
- 使用 Jacl:
$AdminApp publishWSDL JAXRPCHandlerServer c:/temp/a.zip - 使用 Jython:
print AdminApp.publishWSDL('JAXRPCHandlerServer', 'c:/temp/a.zip')
- 使用 Jacl:
$AdminApp publishWSDL JAXRPCHandlersServer c:/temp/a.zip {{JAXRPCHandlersServerApp.war {{http http://localhost:9080}}}} - 使用 Jython:
print AdminApp.publishWSDL('JAXRPCHandlersServer', 'c:/temp/a.zip', '[[JAXRPCHandlersServerApp.war [[http http://localhost:9080]]]]')
searchJNDIReferences
使用 searchJNDIReferences 命令可列示特定节点上引用了 Java 命名和目录接口 (JNDI) 名称的应用程序。
目标对象
无。必需参数
- node configuration ID
- 指定相关节点的配置标识。
可选参数
- 选项
- 指定要使用的选项。
样本输出
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]
示例
MyApp 的应用程序,它的 JNDI 名称为 eis/J2CCF1:- 使用 Jacl:
$AdminApp searchJNDIReferences $node {-JNDIName eis/J2CCF1 -verbose} - 使用 Jython:
print AdminApp.searchJNDIReferences(node, '[-JNDIName eis/J2CCF1 -verbose]')
taskInfo
使用 taskInfo 命令可提供有关应用程序文件的特定任务选项的信息。 在 V5.x 和 V6.x 中,执行相似或完全相同操作的许多任务名称是不同的。 如果要从 V5.x 迁移至 V6.x,那么可能需要更新现有脚本。
目标对象
无。必需参数
- EAR 文件
- 指定相关的 EAR 文件。
- 任务名称
- 指定要对其请求信息的任务。
可选参数
无。样本输出
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
示例
- 使用 Jacl:
$AdminApp taskInfo c:/websphere/appserver/installableApps/jmsample.ear MapWebModToVH - 使用 Jython:
print AdminApp.taskInfo('c:/websphere/appserver/installableApps/jmsample.ear', 'MapWebModToVH')
uninstall
使用 uninstall 命令来卸载现有应用程序。
目标对象
无。必需参数
即使未执行配置保存,也会删除应用程序分析报告并且不可恢复。
- 应用程序名称
- 指定要卸载的应用程序的名称。
可选参数
- 选项
- 指定用于卸载的选项。
样本输出
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.
示例
- 使用 Jacl:
$AdminApp uninstall myApp - 使用 Jython:
print AdminApp.uninstall('myApp')
update
使用 update 命令以非交互方式更新应用程序。 此命令支持对应用程序子组件或整个应用程序进行添加、移除和更新。 提供应用程序名、content type 和更新选项。
目标对象
无。必需参数
- 应用程序名称
- 指定要更新的应用程序的名称。
- 内容类型
- 使用 content type 参数指示您要更新部分应用程序,还是整个应用程序。 以下列表包含 update 命令的有效 content type 值:
app- 指示您要更新整个应用程序。 此选项与使用 install 命令指出 update 选项是相同的。 使用app值作为 content type,您必须将 update 操作选项指定为值。 使用内容选项提供新的企业归档 (EAR) 文件。 您还可指定绑定信息和应用程序选项。 缺省情况下,已安装模块的绑定信息合并在已更新模块的绑定信息中。 要更改此缺省行为,指定 update.ignore.old 选项或 update.ignore.new 选项。file- 指示您要更新单个文件。 您可在已部署应用程序中的任何作用域内添加、移除或更新个别文件。 使用file值作为 content type,您必须使用operation选项对文件执行操作。 根据 operation 的类型,需要更多选项。 对于文件添加和更新,您必须使用 contents 选项和 conetnturi 选项提供文件内容和相对于 EAR 文件根的文件 URI。 对于文件删除,您必须使用 contenturi 选项提供相对于 EAR 文件根的文件 URI,这是唯一需要的输入。 您提供的任何其他选项都将被忽略。modulefile- 指示您要更新模块。 您可添加、移除或更新单个应用程序模块。 如果您指定modulefile值作为 content type,您必须使用 operation 选项指示您要对模块执行的操作。 根据 operation 的类型,需要更多选项。 对于安装新模块或更新应用程序中现有模块,您必须使用 contents 选项和 conetnturi 选项指示文件内容和相对于 EAR 文件根的文件 URI。 您还可指定适用于新模块或已更新模块的绑定信息和应用程序选项。 对于模块更新,缺省情况下,已安装模块的绑定信息合并在输入模块的绑定信息中。 要更改此缺省行为,指定 update.ignore.old 选项或 update.ignore.new 选项。 要删除模块,指示相对于 EAR 文件根的文件 URI。限制: 通常,如果模块依赖于模块外部的其他类 (例如可选包或库中的类) ,那么无法添加或更新模块。 客户端处理涉及对输入模块类的自省,除非还解析类依赖性,否则那些类可能不会成功装入。 如果您使必需类在可通过 wsadmin 脚本编制访问的文件系统上可用,那么可添加或更新模块。 通过 wsadmin 脚本编制,可修改 profile_root/properties/wsadmin.properties 文件中的 com.ibm.ws.scripting.classpath 属性来包括那些类,以便类装入器可对它们进行解析。partialapp- 指示您要更新部分应用程序。 使用以 .zip 压缩文件格式提供的应用程序组件的子集,您可以更新、添加和删除文件和模块。 压缩文件不是有效的 Java 2 platform, Enterprise Edition (J2EE) 归档。 然而,它以 EAR 文件中显示应用程序 artifact 的相同分层构造包含这些应用程序 artifact。 有关如何构造部分应用程序压缩文件的更多信息,请参阅 Java API 部分。 如果您指示partialapp值作为内容类型,请使用内容选项指定压缩文件的位置。 当提供部分应用程序作为更新输入时,无法指定绑定信息和应用程序选项,但如果已提供将忽略它们。
可选参数
- 选项
- 有许多选项可用于 update 命令。 有关 update 命令的每个有效选项的列表,请参阅 使用 wsadmin 脚本编制的 AdminApp 对象安装的选项, installInteractive, edit , editInteractive, update 和 updateInteractive 命令的选项。
执行完整应用程序更新时,将删除应用程序分析报告,并且即使未执行配置保存也不可恢复。
样本输出
ADMA5078I: Update of myApp has started.
ADMA5058I: Application and module versions are validated with versions of deployment targets.
ADMA5009I: Extracting application archive to C:\was\WebSphere\AppServer\profiles\AppSrv01\wstemp\appmgmt\mbean\AppManagement_16926a55ce1_1\app_16926d99097\ext.
ADMA5064I: FileMergeTask completed successfully for myApp.
ADMA5005I: The application myApp is configured in the WebSphere Application Server repository.
ADMA5005I: The application myApp is configured in the WebSphere Application Server repository.
ADMA5005I: The application myApp is configured in the WebSphere Application Server repository.
ADMA5005I: The application myApp is configured in the WebSphere Application Server repository.
ADMA5113I: Activation plan created successfully.
ADMA5005I: The application myApp is configured in the WebSphere Application Server repository.
ADMA5011I: The cleanup of the temp directory for application myApp is complete.
ADMA5079I: Update of myApp has ended. The application or its web modules may require a restart when a save is performed.
示例
- 使用 Jacl:
$AdminApp update myApp file {-operation add -contents c:/apps/myApp/customdb.xml -contenturi myApp.jar/META-INF/customdb.xml} - 使用 Jython:
print AdminApp.update('myApp', 'file', '[-operation add -contents c:/apps/myApp/customdb.xml -contenturi myApp.jar/META-INF/customdb.xml]') - 使用 Jython 列表:
print AdminApp.update('myApp', 'file', ['-operation', 'add', '-contents', 'c:/apps/myApp/customdb.xml', '-contenturi', 'myApp.jar/META-INF/customdb.xml']))
updateAccessIDs
使用 updateAccessIDs 命令来更新为应用程序中定义的各种角色指定的用户和组的访问标识信息。 系统将从用户注册表中读取访问标识,并将这些标识保存在应用程序绑定中。 此操作将提高应用程序的运行时性能。 在安装应用程序之后或者编辑已安装应用程序的特定于安全角色的信息之后使用此命令。 当 wsadmin 工具的 -conntype 选项设置为 NONE 时不能调用此方法。 您必须连接到服务器以调用此命令。
目标对象
无。必需参数
- 应用程序名称
- 指定相关应用程序的名称。
- bALL
- bALL 布尔参数将检索和保存应用程序绑定中的用户和组的所有访问标识。 指定
false就会检索在应用程序绑定中没有访问标识的用户或组的访问标识。
示例
- 在指定 true 的情况下使用 Jacl:
$AdminApp updateAccessIDs myapp true - 在指定 false 的情况下使用 Jacl:
$AdminApp updateAccessIDs myapp false - 在指定 true 的情况下使用 Jython:
print AdminApp.updateAccessIDs('myapp', 1) - 在指定 false 的情况下使用 Jython:
print AdminApp.updateAccessIDs('myapp', 0)
updateInteractive
使用 updateInteractive 命令添加、移除和更新应用程序子组件或整个应用程序。 当您使用交互方式更新应用程序模块或整个应用程序时,您用于配置绑定信息的步骤类似于应用于 installInteractive 命令的步骤。 如果您更新文件或部分应用程序,您不可以使用用于配置绑定信息的步骤。 在这种情况下,使用的步骤与您使用 update 命令的步骤相同。
目标对象
无。必需参数
- 应用程序名称
- 指定要更新的应用程序的名称。
- 内容类型
- 使用 content type 参数指示您要更新部分应用程序,还是整个应用程序。 以下列表包含 updateInteractive 命令的有效 content type 值:
app- 指示您要更新整个应用程序。 此选项与使用 install 命令指出 update 选项是相同的。 使用app值作为 content type,您必须将 update 操作选项指定为值。 使用内容选项提供新的企业归档 (EAR) 文件。 您还可指定绑定信息和应用程序选项。 缺省情况下,已安装模块的绑定信息合并在已更新模块的绑定信息中。 要更改此缺省行为,指定 update.ignore.old 选项或 update.ignore.new 选项。file- 指示您要更新单个文件。 您可在已部署应用程序中的任何作用域内添加、移除或更新个别文件。 使用file值作为 content type,您必须使用operation选项对文件执行操作。 根据 operation 的类型,需要更多选项。 对于文件添加和更新,您必须使用 contents 选项和 conetnturi 选项提供文件内容和相对于 EAR 文件根的文件 URI。 对于文件删除,您必须使用 contenturi 选项提供相对于 EAR 文件根的文件 URI,这是唯一需要的输入。 您提供的任何其他选项都将被忽略。modulefile- 指示您要更新模块。 您可添加、移除或更新单个应用程序模块。 如果您指定modulefile值作为 content type,您必须使用 operation 选项指示您要对模块执行的操作。 根据 operation 的类型,需要更多选项。 对于安装新模块或更新应用程序中现有模块,您必须使用 contents 选项和 conetnturi 选项指示文件内容和相对于 EAR 文件根的文件 URI。 您还可指定适用于新模块或已更新模块的绑定信息和应用程序选项。 对于模块更新,缺省情况下,已安装模块的绑定信息合并在输入模块的绑定信息中。 要更改此缺省行为,指定 update.ignore.old 选项或 update.ignore.new 选项。 要删除模块,指示相对于 EAR 文件根的文件 URI。限制: 通常,如果模块依赖于模块外部的其他类 (例如可选包或库中的类) ,那么无法添加或更新模块。 客户端处理涉及对输入模块类的自省,除非还解析类依赖性,否则那些类可能不会成功装入。 如果您使必需类在可通过 wsadmin 脚本编制访问的文件系统上可用,那么可添加或更新模块。 通过 wsadmin 脚本编制,可以修改 profile_root/properties/wsadmin.properties 文件中的 com.ibm.ws.scripting.classpath 属性以包含这些类,以便类装入器可以解析这些类。partialapp- 指示您要更新部分应用程序。 使用以 .zip 压缩文件格式提供的应用程序组件的子集,您可以更新、添加和删除文件和模块。 压缩文件不是有效的 Java 2 platform, Enterprise Edition (J2EE) 归档。 然而,它以 EAR 文件中显示应用程序 artifact 的相同分层构造包含这些应用程序 artifact。 有关如何构造部分应用程序压缩文件的更多信息,请参阅 Java API 部分。 如果您指示partialapp值作为内容类型,请使用内容选项指定压缩文件的位置。 当提供部分应用程序作为更新输入时,无法指定绑定信息和应用程序选项,但如果已提供将忽略它们。
可选参数
- 选项
- 有许多选项可用于 updateInteractive 命令。 有关 updateInteractive 命令的每个有效选项的列表,请参阅 使用 wsadmin 脚本编制的 AdminApp 对象安装的选项, installInteractive, edit , editInteractive, update 和 updateInteractive 命令的选项。
执行完整应用程序更新时,将删除应用程序分析报告,并且即使未执行配置保存也不可恢复。
样本输出
WASX7266I: A was.policy file exists for this application; would you like to display it?[No]
Task[1]: Specifying application options
Specify the various options that are available for your application.
Precompile JavaServer Pages files: [No]:
Deploy enterprise beans: [No]:
Deploy Web services: [No]:
Validate schema: [No]:
Task[3]: Clone Existing Work Classes.
Clone existing work classes from from an available application edition.
....Clone work class is disabled.
Task[4]: Selecting servers
Specify targets such as application servers or clusters of application servers where you want to install the modules
that are contained in your application. Modules can be installed on the same application server or dispersed among
several application servers. Also, specify the Web servers as targets that serve as routers for requests to this application.
The plug-in configuration file (plugin-cfg.xml) for each Web server is generated, based on the applications that are routed through.
Module: Default Web Application
URI: DefaultWebApplication.war,WEB-INF/web.xml
Server: [WebSphere:cell=LAPTOP-6LGKFAPUNode03Cell,node=LAPTOP-6LGKFAPUNode05,server=server1]:
Task[6]: Configure JASPI authentication.
JASPI providers offer an alternative to JAAS pluggable authentication for web modules. By default, an application
inherits the JASPI settings defined in the WebSphere Application Server global or domain security configuration and
web modules inherit the application setting. However, you can override these defaults by using wsadmin or the administrative console.
Module: DefaultApplication
URI: META-INF/application.xml
Use JASPI: [Inherit]:
JASPI provider name: []:
Module: Default Web Application
URI: DefaultWebApplication.war,WEB-INF/web.xml
Use JASPI: [Inherit]:
JASPI provider name: []:
Task[10]: Binding enterprise Bean to JNDI names
Each non-message-driven enterprise bean in your application or module must be bound to a Java Naming and Directory Interface (JNDI) name.
For beans in a pre-EJB 3.0 module, you have to use JNDI name for the bean to provide the binding. For beans in a EJB 3.0 module,
you can optionally provide binding through JNDI name for the bean or local/remote home JNDI names. If JNDI name for the bean is specified,
you cannot specify binding for its local/remote home and any business interface. If no JNDI name is specified for beans in a EJB 3.0 module,
runtime will provide a container default.
Module: Default Web Application
Bean: IncrementSSB
URI: DefaultWebApplication.war,WEB-INF/ejb-jar.xml
Target Resource JNDI Name: [null]:
Local Home JNDI Name: [null]:
Remote Home JNDI Name: [null]:
Task[12]: Binding enterprise Bean with business interface to JNDI names
Each enterprise bean with a business interface in a module must be bound to a Java Naming and Directory Interface (JNDI) name.
For any business interface that does not provide a JNDI name, if its bean does not provide a JNDI name, a default binding name is provided.
If its bean provides a JNDI name, then a default is provided on top of its bean JNDI name.
Module: Default Web Application
Bean: IncrementSSB
URI: DefaultWebApplication.war,WEB-INF/ejb-jar.xml
Business interface:
JNDI Name: []:
Task[13]: Mapping EJB references to enterprise beans
Each Enterprise JavaBeans (EJB) reference that is defined in your application must map to an enterprise bean.
Module: Default Web Application
Bean:
URI: DefaultWebApplication.war,WEB-INF/web.xml
Resource Reference: HitCount/inc
Class: com.ibm.defaultapplication.IncrementSSB
Target Resource JNDI Name: []:
Task[20]: Selecting virtual hosts for Web modules
Specify the virtual host for the Web modules that are contained in your application. You can install Web modules
on the same virtual host or disperse them among several hosts.
Web module: Default Web Application
URI: DefaultWebApplication.war,WEB-INF/web.xml
Virtual host: [default_host]:
Task[21]: Specify the Context root of web module
Configure values for context roots in web modules.
Web module: Default Web Application
URI: DefaultWebApplication.war,WEB-INF/web.xml
Context Root: [/]:
Task[31]: Specifying EJB deploy options
Specify the options to deploy enterprise beans. Select database type only when all of the modules are mapped
to the same database type. If some modules map to a different backend ID, set the database type blank so that
the Select current backend ID panel is displayed.
....The EJB deploy option is not enabled.
Task[33]: Assign shared libraries to application or each module
Specify shared libraries that the application or individual modules reference. These libraries must be
defined in the configuration at the appropriate scope.
Module: Default Web Application
URI: DefaultWebApplication.war,WEB-INF/web.xml
Shared Libraries: []:
Task[34]: Assign asset or composition unit IDs as shared libraries to the application or each module
Specify asset or composition unit IDs as shared libraries that the application or individual modules reference.
If a composition unit ID is specified, it must be part of the business level application that this enterprise
application belongs to. If an asset ID is specified, a composition unit is created from the asset.
When editing an application, only composition unit IDs can be specified as shared libraries.
Module: Default Web Application
URI: DefaultWebApplication.war,WEB-INF/web.xml
Asset or composition unit IDs: []:
Composition Unit names: []:
Match target: [Yes]:
Task[35]: Specifying JSP deploy options
Specify the options for JSP precompiler.
....The JSP deploy option is not enabled.
Task[36]: Specify JSP reload options for web module
Configure Servlet and JSP reload attributes in web modules.
Web module: Default Web Application
URI: DefaultWebApplication.war,WEB-INF/web.xml
JSP enable class reloading: [Yes]:
JSP reload interval in seconds: [10]:
Task[38]: Set the metadata-complete attribute of the deployment descriptor for the module
The metadata-complete attribute defines whether the deployment descriptor for this module is complete.
Set the metadata-complete attribute to "true" to merge and persist annotation-based metadata with existing XML-based
deployment descriptor metedata to avoid scanning of annotation-based metadata each time the module is read.
If the attribute remains "false", then the annotation-based metadata is scanned each time the module is read and can impact performance.
Module: Default Web Application
URI: DefaultWebApplication.war,WEB-INF/ejb-jar.xml
metadata-complete attribute: [false]:
Module: Default Web Application
URI: DefaultWebApplication.war,WEB-INF/web.xml
metadata-complete attribute: [false]:
Task[39]: Specify runtime provisioning components to be added or removed
Specify runtime components that should be added to or removed from the default runtime components that are
needed to run this application. This step is for advanced users and should only be used in those cases when
all the runtime components needed for the application cannot be obtained by inspecting the application.
Module: Default Web Application
URI: DefaultWebApplication.war,WEB-INF/ejb-jar.xml
Runtime Provisioning Components To Add: []:
Runtime Provisioning Components To Remove: []:
Module: Default Web Application
URI: DefaultWebApplication.war,WEB-INF/web.xml
Runtime Provisioning Components To Add: []:
Runtime Provisioning Components To Remove: []:
Task[40]: Module Build ID
Display module build IDs.
Module: Default Web Application
URI: DefaultWebApplication.war,WEB-INF/web.xml
Build ID:
Task[41]: Copy WSDL files
Copy WSDL files
....This task does not require any user input
Task[42]: Specify options to deploy Webservices
Specify options to deploy Webservices
....WebServices Deploy option is not enabled.
ADMA5078I: Update of DefaultApplication has started.
ADMA5058I: Application and module versions are validated with versions of deployment targets.
ADMA5009I: Extracting application archive to C:\was9.0\cf111907.02\WebSphere\AppServer\profiles
\AppSrv02\wstemp\appmgmt\mbean\AppManagement_16926a55ce1_1\app_16926e99953\ext\DefaultWebApplication.war.
ADMA5064I: FileMergeTask completed successfully for DefaultApplication.
ADMA5005I: The application DefaultApplication is configured in the WebSphere Application Server repository.
ADMA5005I: The application DefaultApplication is configured in the WebSphere Application Server repository.
ADMA5005I: The application DefaultApplication is configured in the WebSphere Application Server repository.
ADMA5005I: The application DefaultApplication is configured in the WebSphere Application Server repository.
ADMA5113I: Activation plan created successfully.
ADMA5005I: The application DefaultApplication is configured in the WebSphere Application Server repository.
ADMA5011I: The cleanup of the temp directory for application DefaultApplication is complete.
ADMA5079I: Update of DefaultApplication has ended. The application or its web modules may require a restart when a save is performed.
示例
- 使用 Jacl:
$AdminApp updateInteractive myApp modulefile {-operation update -contents c:/apps/myApp/DefaultWebApplication.war -contenturi DefaultWebApplication.war -nodeployejb} - 使用 Jython:
print AdminApp.updateInteractive('myApp', 'modulefile', '[-operation update -contents c:/apps/myApp/DefaultWebApplication.war -contenturi DefaultWebApplication.war -nodeployejb]') - 使用 Jython 列表:
print AdminApp.updateInteractive('myApp', 'modulefile', ['-operation', 'update', '-contents', 'c:/apps/myApp/DefaultWebApplication.war', '-contenturi', 'DefaultWebApplication.war, '-nodeployejb'])在 9.0.0.11之前, DefaultApplication 包含具有实体 EJB 的 Increment.jar 。 对于 9.0.0.10 和更低版本的产品, Jython 列表示例如下所示:bindJndiForEJBValue = [["Increment EJB module", "Increment","Increment.jar,META-INF/ejb-jar.xml", "Inc"]] print AdminApp.updateInteractive('myApp', 'modulefile', ['-operation', 'add', '-contents', 'c:/apps/myApp/Increment.jar', '-contenturi', 'Increment.jar', '-nodeployejb', '-BindJndiForEJBNonMessageBinding', bindJndiForEJBValue])
视图
使用 view 命令来查看由 application name 参数指定的应用程序或模块的由 task name 参数指定的任务。 使用 -tasknames 作为获取应用程序的有效任务名的列表的选项。 否则,指定一个或多个任务名作为选项。
目标对象
无。必需参数
- 名称
- 指定要查看的应用程序或模块的名称。
可选参数
- bALL
- bALL 布尔参数将检索和保存应用程序绑定中的用户和组的所有访问标识。 指定
false就会检索在应用程序绑定中没有访问标识的用户或组的访问标识。 - -buildVersion
- 指定是否显示相关应用程序的构建版本。
样本输出
taskoptions 值,那么此命令将返回以下信息:MapModulesToServers
MapWebModToVH
MapRolesToUsersmapModulesToServers 任务,那么此命令将返回以下信息: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示例
- 使用 Jacl:
$AdminApp view DefaultApplication {-tasknames} - 使用 Jython:
print AdminApp.view('DefaultApplication', ['-tasknames'])
- 使用 Jacl:
$AdminApp view DefaultApplication {-MapModulesToServers} - 使用 Jython:
print AdminApp.view('DefaultApplication', ['-MapModulesToServers'])
- 使用 Jacl:
$AdminApp view DefaultApplication {-AppDeploymentOptions} - 使用 Jython:
print AdminApp.view('DefaultApplication', '-AppDeploymentOptions')
- 使用 Jacl:
$AdminApp view DefaultApplication {-buildVersion} - 使用 Jython:
print AdminApp.view('DefaultApplication', '-buildVersion')