You can create an application client that run into the Apache Geronimo application client container rather than running in your computer.

You only need to create a jar file with these files for a simple example that only will write "CLIENT RUNNING..." by console:

1. - client/

package client;

public class MainClient {

     * @param args
    public static void main(String[] args){
        System.out.println ("CLIENT RUNNING...");  

2. - META-INF/application-client.xml

<?xml version="1.0"?>
<application-client xmlns="" xmlns:xsi=""
 xsi:schemaLocation=" []" version="1.4">
    <display-name>EXAMPLE Client</display-name>

3. - META-INF/geronimo-application-client.xml

<?xml version="1.0"?>
<application-client xmlns="" xmlns:dep="">


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, and EXAMPLEClient its the comonent that you are going to start with client.jar util.


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.

With this bat file, you can create the J2EE application client jar file (I named it app_client.jar) if you have the compiled files and xml files and the our into one folder (in my case D:\workspace2\GERONIMO_APPLICATION\bin). The M jar command´s paramenter indicate that jar file must be created ussing our MANIFEST.MF file. Verify that this is correct after create jar file.

jar -cfM  app_client.jar -C D:\workspace2\GERONIMO_APPLICATION\bin .
java -jar %GERONIMO_HOME%/bin/deployer.jar --user system --password manager --host localhost undeploy JEE5/EXAMPLEClient/1.1/car
java -jar %GERONIMO_HOME%/bin/deployer.jar --user system --password manager --host localhost undeploy JEE5/EXAMPLEClientServer/1.1/car
java -jar %GERONIMO_HOME%/bin/deployer.jar --user system --password manager deploy app_client.jar

After deploy, you have to see the two components into Geronimo Web Console -> Applications -> App Clients:

JEE5/EXAMPLEClient/1.1/car    	   state: stopped
JEE5/EXAMPLEClientServer/1.1/car   state: running

You can run Application client with this command:

java -jar %GERONIMO_HOME%/bin/client.jar JEE5/EXAMPLEClient/1.1/car

  • No labels