Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Migration of unmigrated content due to installation of a new plugin

...

  1. Create a client jar file for a simple example with these files. The client will write a message "CLIENT RUNNING..." on the Geronimo console: client/MainClient.java
    Code Block
    java
    java
    borderStylesolidjava
    package client;
    
    public class MainClient {
    
        /**
         * @param args ignored
         */
        public static void main(String[] args){
            System.out.println ("CLIENT RUNNING...");  
        }
    }
    
  2. Create an application client deployment descriptor that provides the client display name: META-INF/application-client.xml
    Code Block
    xml
    xml
    borderStylesolidxml
    <?xml version="1.0"?>
    <application-client xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
     xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee [http://java.sun.com/xml/ns/j2ee/applicationclient_1_4.xsd]" version="1.4">
        <display-name>EXAMPLE Client</display-name>
    </application-client>
    
  3. Create a Geronimo application client deployment plan that describes the deployment moduleId and types: META-INF/geronimo-application-client.xml You need to define two modules, one for client side and one for server side. EXAMPLEClientServer is the component that always its going to be running on the server, and EXAMPLEClient is the component that you are going to run on the client from client.jar.
    Code Block
    xml
    xml
    borderStylesolidxml
    <?xml version="1.0"?>
    <application-client xmlns="http://geronimo.apache.org/xml/ns/j2ee/application-client-2.0" xmlns:dep="http://geronimo.apache.org/xml/ns/deployment-1.2">
        <dep:client-environment>
            <dep:moduleId>
                <dep:groupId>JEE5</dep:groupId>
                <dep:artifactId>EXAMPLEClient</dep:artifactId>
                <dep:version>2.1</dep:version>
                <dep:type>car</dep:type>
            </dep:moduleId>
        </dep:client-environment>
    
        <dep:server-environment>
            <dep:moduleId>
                <dep:groupId>JEE5</dep:groupId>
    	    <dep:artifactId>EXAMPLEClientServer</dep:artifactId>
    	    <dep:version>2.1</dep:version>
    	    <dep:type>car</dep:type>
            </dep:moduleId>
        </dep:server-environment>
        
    </application-client>
    
  4. Create a manifest that tells the Java jar util which class to run first. META-INF/MANIFEST.MF
    No Format
    borderStylesolid
    Manifest-Version: 1.0
    Main-Class: client.MainClient
    \# blank line
    
    MANIFEST must contain the Main-Class and blank line at the end of the file.
  5. Create a bat file that packages the client jar, undeploys any older versions of the client/server apps, and deploys the client application. This bat file creates the J2EE application client jar file (Here is is named app_client.jar.) and associated files from an application bin folder (in this case D:\workspace2\GERONIMO_APPLICATION\bin). Run java client/MainClient.java to create a class file. The jar command -M paramenter indicates the jar file must be created using a MANIFEST.MF file. Verify that this is correct after create jar file.

...