[8.5.5.6 或更高版本]

准备和运行应用程序客户机

了解如何准备服务器和客户机以从 Liberty 概要文件应用程序客户机容器运行应用程序客户机。

关于此任务

成功运行应用程序客户机需要更新 server.xmlclient.xml 文件。

过程

按如下所示准备服务器:

  1. 将客户机模块 (.jar) 及其他模块(例如,EJB 模块 (.jar))打包到应用程序 EAR 文件中。
  2. 将该 EAR 文件放到 apps 目录(例如,wlp/usr/servers/your_server/apps)中。
  3. 通过添加 appClientSupport-1.0 功能部件及其他必需功能部件来更新 server.xml 配置文件。
    要点: 如果应用程序客户机是独立应用程序,那么此步骤不是必需的。
  4. 通过使用您的应用程序信息配置 <application/> 来更新 server.xml 配置文件;例如:
    <?xml version="1.0" encoding="UTF-8"?>
    	<server description="new server">
    		<!- Enable features ->
    		<featureManager>
    			<feature>javaee-7.0</feature>
    		</featureManager>
    		<application id="techsample" name="techSample" type="ear" location="TechnologySamples.ear"/>
    	</server>

按如下所示准备客户机:

  1. 将该 EAR 文件放到 apps 目录(例如,wlp/usr/clients/your_client/apps)中。
  2. 通过使用您的应用程序信息配置 <application/>更新 client.xml 配置文件;例如:
    <?xml version="1.0" encoding="UTF-8"?>
    	<client description="new client">
    		<!- Enable features ->
    		<featureManager>
    			<feature>javaeeClient-7.0</feature>
    		</featureManager>
    		<application id="techsample" name="techSample" type="ear" location="TechnologySamples.ear"/>
    	</client>
  3. 可选: appClientSecurity-1.0 feature 添加至 client.xml 文件。阅读有关手动创建 Liberty 概要文件应用程序客户机的信息。
  4. 启动服务器。
  5. 通过输入 client run your_client运行客户机 如果客户机应用程序使用命令行自变量,请使用以下格式:
    client run {your_client} -- arg1 arg2 ... argn

如果服务器和客户机在不同计算机上运行,那么还要执行一些其他步骤。缺省情况下,服务器和客户机使用 localhost:2809。必须配置 IIOP 以在服务器与客户机之间建立连接,如下所示:

  1. 停止服务器。
  2. 使用 IIOP 配置更新 server.xml 文件;例如:
    <iiopEndpoint id="defaultIiopEndpoint" host="user.host.ibm.com" iiopPort="2814" />
  3. 使用 IIOP 配置更新 client.xml 文件;例如:
    <orb id="defaultOrb" nameService="corbaloc:iiop:user.host.ibm.com:2814/NameService" />
  4. 启动服务器。

用于指示主题类型的图标 任务主题

信息中心的条款和条件 | 反馈


时间戳记图标 最近一次更新时间: Wednesday, 2 September 2015
http://www14.software.ibm.com/webapp/wsbroker/redirect?version=phil&product=was-libcore-mp&topic=twlp_setup_prepareappclient
文件名:twlp_setup_prepareappclient.html