Liberty Repository[8.5.5.6 or later]
This topic applies to WebSphere Application Server Liberty V8.5.5.9 and earlier. For the latest Liberty topics, see the WebSphere Application Server Liberty documentation.

Creating a Liberty application client manually

You can create a Liberty application client from the command line.

Before you begin

You enable the Java™ EE Application Client 7.0 feature in the client.xml file only.

Procedure

  1. Open a command line, then change directory to the wlp/bin directory. In the following examples, path_to_liberty specifies the location where you installed Liberty on your operating system.

    For Windows platformsExample on Windows systems: C:\Users\mo> cd path_to_liberty\wlp\bin

    For LINUX platformsExample on Linux: mo@machine01:~> cd path_to_liberty/wlp/bin

  2. Run the following command to create a client, where client_name is the name that you want to give your client. If you do not specify a client name, defaultClient is used.

    For Windows platformsExample on Windows systems: C:\wlp\bin> client create client_name

    For LINUX platformsExample on Linux: mo@machine01:~> client create client_name

    client create client_name
    If the client is created successfully, you receive the following message:
    Client client_name created.

    You can find the client.xml file in the wlp/usr/clients/client_name directory. The file contains the javaeeClient-7.0 feature.

    Attention: If a default client exists, you get an error. If a default client does not exist, defaultClient is created.
  3. Run your client application by preparing an application (.ear) file with a client module (.jar) in it. Specify a main class in the MANIFEST.MF of the client module, for example:
    Manifest-Version: 1.0 
    Main-Class: com.ibm.ws.addressbook.ContactServiceClient_XMLInject 
  4. Place the EAR file under the wlp/usr/clients/client_name/apps directory.
  5. Update the client.xml file to configure your application, for example:
    <client>
    	<featureManager>
    		<feature>javaeeClient-7.0</feature>
    	<featureManager>
    	<application id="CLIENT_APP" name="CLIENT_APP" type="ear" location="clientApp.ear"/>
    </client>
    If the specified client already exists, no client is created and you receive an exception message:
    CWWKE0005E: The runtime environment could not be launched.
    CWWKE0904E: It was not possible to create the client called client_name because 
    the client directory C:\wlp\usr\clients\client_name already exists.

What to do next

You can enable security (SSL, CSIv2, JAAS) for your application client by adding the appSecurityClient-1.0 feature to your client.xml file:
<featureManager>
	<feature>javaeeClient-7.0</feature>
	<feature>appSecurityClient-1.0</feature>
</featureManager>

For more information about configuring security on the application client, see Liberty Repository[8.5.5.6 or later]Configuring security for the Liberty application client container and its applications.


Icon that indicates the type of topic Task topic



Timestamp icon Last updated: Tuesday, 12 December 2017
http://www14.software.ibm.com/webapp/wsbroker/redirect?version=phil&product=was-libcore-mp&topic=twlp_setup_new_client
File name: twlp_setup_new_client.html