Skip to main content

Notice: this Wiki will be going read only early in 2024 and edits will no longer be possible. Please see: https://gitlab.eclipse.org/eclipsefdn/helpdesk/-/wikis/Wiki-shutdown-plan for the plan.

Jump to: navigation, search

Difference between revisions of "Swordfish Documentation: Running Target Platform Outside An IDE"

(Customizing Target Platform properties)
(Customizing Target Platform Properties)
 
(One intermediate revision by one other user not shown)
Line 12: Line 12:
 
After the build is successful, the prepared target platform can be found in <tt>org.eclipse.swordfish.build/target/platform</tt> directory.
 
After the build is successful, the prepared target platform can be found in <tt>org.eclipse.swordfish.build/target/platform</tt> directory.
  
==Customizing Target Platform Properties==
+
== Customizing Target Platform Properties ==
By default, Swordfish target platform is launched with predefined set of properties. These properties include Equinox runtime properties (e.g. set of bundles contained in a target platform, packages exported by a framework system bundle, etc.) and Swordfish specific ones (e.g. Swordfish registry URL or JMX server port).<br/>
+
All properties are defined in the file <code>config.ini</code> in the directory <tt>target/platform/configuration</tt> (A template with default values can be found here:
+
[http://dev.eclipse.org/svnroot/rt/org.eclipse.swordfish/trunk/org.eclipse.swordfish.build/platform/config.ini config.ini]).
+
  
<b>NOTE:</b> This page does not contain detailed description of all properties listed in target platform configuration. For additional information please refer to  [http://help.eclipse.org/galileo/topic/org.eclipse.platform.doc.isv/reference/misc/runtime-options.html Equinox runtime properties], [[Swordfish_Documentation:_Running_Target_Platform#Setting_up_Target_Platform | Running Swordfish Target Platform]] articles.
+
By default, Swordfish target platform is launched with predefined set of properties. These properties include Equinox runtime properties (e.g. set of bundles contained in a target platform, packages exported by a framework system bundle, etc.) and Swordfish specific ones (e.g. Swordfish registry URL or JMX server port).<br> All properties are defined in the file <code>config.ini</code> in the directory <tt>target/platform/configuration</tt> (A template with default values can be found here: [http://dev.eclipse.org/svnroot/rt/org.eclipse.swordfish/trunk/rt/org.eclipse.swordfish.build/platform/config.ini config.ini]).  
  
Depending on real situation default settings can be changed to specify for example different set of bundles or different ports to be used.<br/>
+
'''NOTE:''' This page does not contain detailed description of all properties listed in target platform configuration. For additional information, see [http://help.eclipse.org/galileo/topic/org.eclipse.platform.doc.isv/reference/misc/runtime-options.html Equinox runtime properties] and [[Swordfish Documentation: Running Target Platform#Setting_up_Target_Platform|Running Swordfish Target Platform]].
  
In order to run user defined services inside Swordfish Target Platform it is necessary to modify <code>config.ini</code> file and add these services to list of bundles included into the target platform. For example if a service provider bundle has the symbolic name <tt>swordfish.test.service</tt> then the list of bundles should look in the following way:
+
Default settings can be changed in certain scenarios, like to specify a different set of bundles or different ports to be used.<br>
<pre>
+
 
#List of bundles the target platform consists of
+
To run user defined services inside Swordfish Target Platform, it is necessary to modify the file <code>config.ini</code> and add these services to list of bundles included into the target platform. For example if a service provider bundle has the symbolic name <tt>swordfish.test.service</tt> then the list of bundles should contain this name as shown next:  
 +
<pre>#List of bundles the target platform consists of
 
osgi.bundles=\
 
osgi.bundles=\
 
com.ctc.wstx@start,\
 
com.ctc.wstx@start,\
Line 29: Line 27:
 
org.springframework.osgi.io@start,\
 
org.springframework.osgi.io@start,\
 
swordfish.test.service@start
 
swordfish.test.service@start
</pre>
+
</pre>  
 
+
Also for every target platform it is possible to configure ports for HTTP server running Swordfish registry, JMX server, location of registry artifacts or registry URL. The following entries can be changed according to the requirement:
Also for every target platform it is possible to configure ports for HTTP server running Swordfish registry, JMX server, location of registry artifacts or registry URL.
+
<pre>#Port the ServiceMix's JMX server runs on.
<pre>
+
#Port the ServiceMix's JMX server runs on.
+
 
rmiRegistryPort=1099
 
rmiRegistryPort=1099
  
Line 47: Line 43:
 
#Swordfish registry URL
 
#Swordfish registry URL
 
org.eclipse.swordfish.registry.url=http://localhost:9001/registry
 
org.eclipse.swordfish.registry.url=http://localhost:9001/registry
</pre>
+
</pre>  
 
+
'''NOTE:''' When running multiple platforms on the same machine it is necessary to set different ports for HTTP and JMX servers in every platform.
<b>NOTE:</b> When running multiple platforms on the same machine it is necessary to set different ports for HTTP and JMX servers in every platform.
+
  
 
==Running Target Platform==
 
==Running Target Platform==

Latest revision as of 04:05, 9 November 2009

Running Swordfish Target Platform outside an Eclipse IDE

This section contains instructions on running Swordfish Target Platform outside an Eclipse IDE.
The whole process consists of three steps: preparing a target platform, customizing platform properties and launching platform. More detailed information for each step is provided below.

Prerequisites

Eclipse Galileo (Eclipse 3.5) build or later. The examples described here are based on Eclipse 3.5.

Preparing the Target Platform

The target platform is one of the artifacts produced by the Swordfish Headless Build.
To build a platform you have to set up the Headless Build and run it by executing the ant command from the build directory (org.eclipse.swordfish.build).
After the build is successful, the prepared target platform can be found in org.eclipse.swordfish.build/target/platform directory.

Customizing Target Platform Properties

By default, Swordfish target platform is launched with predefined set of properties. These properties include Equinox runtime properties (e.g. set of bundles contained in a target platform, packages exported by a framework system bundle, etc.) and Swordfish specific ones (e.g. Swordfish registry URL or JMX server port).
All properties are defined in the file config.ini in the directory target/platform/configuration (A template with default values can be found here: config.ini).

NOTE: This page does not contain detailed description of all properties listed in target platform configuration. For additional information, see Equinox runtime properties and Running Swordfish Target Platform.

Default settings can be changed in certain scenarios, like to specify a different set of bundles or different ports to be used.

To run user defined services inside Swordfish Target Platform, it is necessary to modify the file config.ini and add these services to list of bundles included into the target platform. For example if a service provider bundle has the symbolic name swordfish.test.service then the list of bundles should contain this name as shown next:

#List of bundles the target platform consists of
osgi.bundles=\
com.ctc.wstx@start,\
...
org.springframework.osgi.io@start,\
swordfish.test.service@start

Also for every target platform it is possible to configure ports for HTTP server running Swordfish registry, JMX server, location of registry artifacts or registry URL. The following entries can be changed according to the requirement:

#Port the ServiceMix's JMX server runs on.
rmiRegistryPort=1099

#Whether Equinox's HTTP server is enabled, default is true
org.eclipse.equinox.http.jetty.http.enabled=true

#Port the Swordfish registry runs on
org.osgi.service.http.port=9001

#Directory containing all Swordfish registry artifacts (WSDL's etc.)
org.eclipse.swordfish.registry.fileLocation=./registry

#Swordfish registry URL
org.eclipse.swordfish.registry.url=http://localhost:9001/registry

NOTE: When running multiple platforms on the same machine it is necessary to set different ports for HTTP and JMX servers in every platform.

Running Target Platform

To run Swordfish Target Platform:

  • Switch to the target platform directory (org.eclipse.swordfish.build/target/platform).
  • Depending on your operating system start the platform by running corresponding launch script (launch.bat for Windows, launch.sh for MacOS/Linux).
  • Verify that the platform has started successfully. To do this check the status of bundles included into the platform by typing ss command in the console window.
    In case of successfull start all bundles must be in ACTIVE state except few fragment bundles (org.eclipse.swordfish.compatibility.wsdl4j, org.mortbay.jetty.security etc.) which must be in RESOLVED state.
    Swordfish Target Platform state


NOTE: To provide the same behavior as target platform started inside Eclipse IDE, all launchers specify osgi.compatibility.bootdelegation system property set to true.
Use of this property enables delegation to parent (boot) classloader by default if class can not be found, hence provides successful resolving of all packages visible for parent class loader (javax.*, org.w3c.*, etc.) regardless if their imports are present in bundle manifest. For more information regarding Eclipse boot delegation and usage of osgi.compatibility.bootdelegation property please refer to: Equinox boot delegation, Bug 178477


Swordfish End User Documentation
Swordfish Wiki Home

Back to the top