This file contains information on how to start the service environment using the service runtime launcher

Launching the service environment is done by the Launcher class.

Project: ServiceRuntimeLauncher

The launcher itself only depends on only a few classes an jars. It dynamically loads some core Servicia runtime classes and then based on the runtime configuration the services classes and jars defined in the services' WEB-INF/classes and WEB-INF/lib folders.

The launcher expects to work in an eclipse workspace, i.e. all services (service projects) were checked out into a single workspace. The workspace is then referenced as 'services dir'.

How to call the Launcher

The launcher is located in the SeriveRuntimeLauncher project.

  • Use Launcher.bat to run launcher or use the executable jar Launcher.jar . Add the command-line arguments you need.


  • Create an eclipse launch configuration using class Classpath must contain ONLY the ServiceRuntimeLauncher project dependencies.

Use jconsole to monitor and modify the service runtime and running services.

Launcher Options and how to use them

  • -h: Display help text.
  • -id <instance_id>: Selects a runtime instance by name (set of services to be run at a particular port)
  • -configure: Starts service runtime configuration dialog. Services to start, port and log-level can be specified for the selected runtime.
  • -runtime <arg>: Specify path to the runtime file space. Some settings are automatically derived from this path. runtime configuration folder: is set to <runtime-dir>/config
    service data folder: is set to <runtime-dir>/data
    services folder: is set to the eclipse workspace location in which <runtime-dir> resides (if <runtime-dir> is outside an eclipse workspace then service-dir is set to the <runtime-dir>)
    These automatic settings can be overridden by the corresponding option.
  • -serviceroot <arg>: Specify root-path to the service directories (=services folder).
  • -datadir <arg>: Specify data directory for the service runtime.
  • -createdir: Creates the runtime directory, if not already present.
  • -core <arg>: Set the name of the core service (typically a relative path like 'Dependencies/service/Core').
  • -autodetect: Start service runtime in autodetection mode. That is, if no primary VM is running start instance on a primary VM. Otherwise, start it on a secondary VM.
  • -client <arg>: Instructs the launcher to call the main method of the given class. No services will be started. This options for invoking methods inside a running service runtime instance.


  • -secondary: Starts a service runtime instance on a secondary VM. An already running primary VM is needed.


Launcher [-id <instance_id>] [-runtime my/runtime/dir] [-createdir]

Sets the runtime dir to ${user.dir}/my/runtime/dir

Additional config are expected at ${user.dir}/my/runtime/dir/config

The service data area is set to ${user.dir}/my/runtime/dir/data

The services dir is set to the eclipse workspace directory containing the runtime dir (or the runtime dir, if the workspace dir does not exist)

If the runtime directory does not exist an error will be reported. This behaviour prevents from accidentally creating runtime directories in unexpected locations. Use the -createdir option to override this behaviour.

The option -id can be omitted. The instance will then have the id _anonymous_ assigned to it.

Launcher [-id <instance_id>] [-runtime <runtime_dir>] -client <clientClass> 

Runs the main method of the clientClass. Only classes contained in the given running runtime instance can be called.

Launcher [-id <instance_id>] -configure

Starts the selected runtime instance in configuration mode. Services to be started and start order can be set. Also a dedicated port for this instance can be specified.

Launcher -autodetect [-id <id1>] -runtime my/runtime/dir [-createdir]
Launcher -autodetect [-id <id2>] -runtime my/runtime/dir [-createdir]

Launches the first runtime instance on a primary VM. When starting the second runtime, the already running primary VM is detected and the instance will be run on a secondary VM. Services needed in the second runtime instance but already deployed in the first instance will be used remotely.

Note: the runtime directories should be the same

Launcher [-id <instance_id>] -runtime my/runtime/dir -client my.package.Client

Calls the main method of the class my.package.Client. The call expects a running runtime instance. The class must exist within this runtime.

More about how to start multiple runtime instances can be found in DistributedServicia.

Last modified 10 years ago Last modified on 08/04/08 14:15:46

Attachments (1)

Download all attachments as: .zip