Prepare and run an application client

Running an application client successfully requires updates to both the server.xml and client.xml files.

  1. Prepare the server.

    1. Package a client module (.jar) and other modules, such as an EJB module (.jar), in an application EAR file.

    2. Place the EAR file in...

        wlp/usr/servers/your_server/apps

    3. Update the server.xml configuration file by adding the appClientSupport-1.0 feature, along with other necessary features.

      This step is not needed if the application client is a stand-alone application.

    4. Update the server.xml configuration file by configuring <application/> with the application information. For example

        <?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>

  2. Prepare your client.

    1. Place the EAR file in the apps directory.

      An example directory is wlp/usr/clients/your_client/apps.

    2. Update the client.xml configuration file by configuring <application/> with the application information.

      The following example shows what to add to the client.xml configuration file.

        <?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. Optional: Add the appClientSupport-1.0 feature to the client.xml file.

      See Create a Liberty application client manually.

    4. Start the server.

    5. Run the client...

        client run {your_client} -- arg1 arg2 ... argn

  3. If the server and client are running on different computers, configure IIOP to establish a connection between the server and client.

    By default, the server and client are using localhost:2809.

    1. Stop the server.

    2. Update server.xml with the IIOP configuration.

        <iiopEndpoint id="defaultIiopEndpoint" host="user.host.ibm.com" iiopPort="2814" />

    3. Update the client.xml file with the IIOP configuration.

        <orb id="defaultOrb" nameService="corbaname::user.host.ibm.com:2814" />

    4. Start the server.

      Note that the client might fail to connect to the server due to firewall software that blocks the connection on the server. Consult with the server administrator to ensure that no firewall blocks inbound connections to port 2814.

See also:


Parent topic: Set up Liberty


Related reference


Related information