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"

Line 18: Line 18:
 
Depending on real situation default settings can be changed to specify for example additional bundles which should be added to to target platform or different ports to be used.<br/>
 
Depending on real situation default settings can be changed to specify for example additional bundles which should be added to to target platform or different ports to be used.<br/>
  
If you want to run your services inside Swordfish target platform it is necessary to  
+
If you want to run your own services inside Swordfish target platform without Eclipse IDE it is necessary to modify <code>config.ini</code> property file and add your
 +
services to the list of bundles included into a target platform. For example if your service bundle has a symbolic name <tt>swordfish.test.service</tt> then you could do the following change:
 
<pre>
 
<pre>
 +
...
 
#List of bundles the target platform consists of
 
#List of bundles the target platform consists of
 
osgi.bundles=\
 
osgi.bundles=\
 
com.ctc.wstx@start,\
 
com.ctc.wstx@start,\
com.sun.xml.bind@start,\
 
 
...
 
...
 
org.springframework.osgi.io@start,\
 
org.springframework.osgi.io@start,\
 
swordfish.test.service@start
 
swordfish.test.service@start
 +
...
 
</pre>
 
</pre>
  
 +
Additionally you may specify different ports for Swordfish Registry and/or JMX server running inside target platform.
 +
This is necessary in situation if you want to run multiple target platforms on the same machine.
 
<pre>
 
<pre>
 +
...
 +
#Port the Swordfish registry runs on
 +
org.osgi.service.http.port=9002
 +
...
 +
</pre>
 +
 +
<pre>
 +
...
 
#Port the ServiceMix's JMX server runs on.
 
#Port the ServiceMix's JMX server runs on.
 
rmiRegistryPort=5556
 
rmiRegistryPort=5556
 +
...
 
</pre>
 
</pre>
  
 
<pre>
 
<pre>
#Port the Swordfish registry runs on
 
org.osgi.service.http.port=9002
 
 
...
 
...
#Swordfish registry URL
+
org.eclipse.swordfish.registry,\
org.eclipse.swordfish.registry.url=http://localhost:9002/registry
+
...
 
</pre>
 
</pre>
  
 
<pre>
 
<pre>
#Directory containing all Swordfish registry artifacts (WSDL's etc.)
+
...
org.eclipse.swordfish.registry.fileLocation=D:\\swordfish\\repository
+
#Swordfish registry URL
 +
org.eclipse.swordfish.registry.url=http://localhost:9002/registry
 +
...
 
</pre>
 
</pre>
 +
  
 
==Running Target Platform==
 
==Running Target Platform==

Revision as of 11:03, 30 September 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 Target Platform

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 ant command from the build directory (org.eclipse.swordfish.build).
After build finishes 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 default set properties.
These properties include for example set of bundles a target platform consists of, packages exported by a framework system bundle, Equinox runtime properties etc. All platform properties are defined in config.ini file under configuration directory. Depending on real situation default settings can be changed to specify for example additional bundles which should be added to to target platform or different ports to be used.

If you want to run your own services inside Swordfish target platform without Eclipse IDE it is necessary to modify config.ini property file and add your services to the list of bundles included into a target platform. For example if your service bundle has a symbolic name swordfish.test.service then you could do the following change:

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

Additionally you may specify different ports for Swordfish Registry and/or JMX server running inside target platform. This is necessary in situation if you want to run multiple target platforms on the same machine.

...
#Port the Swordfish registry runs on
org.osgi.service.http.port=9002
...
...
#Port the ServiceMix's JMX server runs on.
rmiRegistryPort=5556
...
...
org.eclipse.swordfish.registry,\
...
...
#Swordfish registry URL
org.eclipse.swordfish.registry.url=http://localhost:9002/registry
...


Running Target Platform

To run Swordfish Target Platform:

  • Switch to the org.eclipse.swordfish.build/target/platform directory.
  • 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 either in ACTIVE or 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