Skip to main content

Notice: This Wiki is now read only and edits are no longer possible. Please see: for the plan.

Jump to: navigation, search

SCA/SCA Component/SCA Java Run and Debug FraSCAti



This tutorial explains how you can run an SCA Java project created with SCA Tools on OW2 FraSCAti.
There are three simple steps to perform:

  • Create a master launch configuration for OW2 FraSCAti.
  • Instantiate this configuration for the composite to deploy.
  • Optionaly, modify the generated configuration (for advanced use).

For this tutorial, we will use the "Simple Weather Sample" provided by SCA Tools.
It is an SCA project that you can create by selecting File > New > Examples > SCA > SCA Examples and then by choosing the Weather - Simple weather sample.

Three simple steps

Create a master launch configuration

The first thing to do is to create a master launch configuration.
For this example, we use OW2 FraSCAti 0.5.

Go into Window > Preferences > SCA Tools > Run / Debug.
Click Add.... In the dialog that shows up, type in "FraSCAti 0.5". That will be the name of our master launch configuration.

SCA Java Run and Debug Frascati1.gif

Click OK.
You should see the argument line is filled with ${composite_name}.
When this master launch configuration is instantiated (applied) for a composite, this variable will be replaced by the composite file name.

SCA Java Run and Debug Frascati2.gif

And you should see the classpath contains a reference to the plug-in.

SCA Java Run and Debug Frascati3.gif

In the Classpath tab, click Add library..., select all the librairies of OW2 FraSCAti 0.5 and click Open.

SCA Java Run and Debug Frascati4.gif

In the Launch tab, copy in the Main class field.
This class is provided by the plug-in and just deploys the composite.

SCA Java Run and Debug Frascati5.gif

Click OK to save this configuration.

Run the composite with this configuration

In the package explorer, find the simpleWeather.composite file.
Make a right-click on it and select Run as... > SCA application. If you have created only one master configuration, it should automatically be launched.

SCA Java Run and Debug runAs.gif

Otherwise, in the dialog that shows up, select the "FraSCAti 0.5" configuration.
You should get the following console display.

SCA Java Run and Debug Frascati6.gif

You made it run without modifying the project classpath.
Type in 'q' to stop the main application.

Modify the launch configuration

Let's suppose you want to add special arguments to the configuration, or try on another JRE.
Go into Run > Run configurations... and select your configuration in the SCA category. Its name looks like < compositeName > - < masterLaunchConfigurationName >

You can now edit its properties, save it and run it again.

SCA Java Run and Debug Frascati7.gif

Links to visit

Appendix: the main method for FraSCAti

public static void main( String[] args ) throws Exception {
	if( args.length != 1 )
		throw new IllegalArgumentException( 
			"<Usage>\n\tFrascatiMain05.main( new String[] { <compositeFilePath> });" ); //$NON-NLS-1$
	Object factory = null;
	try {
		System.out.println( "Deploying " + args[ 0 ] + "..." ); //$NON-NLS-1$ //$NON-NLS-2$
		factory = Class.forName( "org.ow2.frascati.factory.Factory" ).newInstance(); //$NON-NLS-1$
		Method newInstanceMethod = factory.getClass().getMethod( "getComposite", new Class[] { String.class }); //$NON-NLS-1$
		newInstanceMethod.invoke( factory, new Object[] { args[ 0 ]});
		// Wait...
		System.out.println( "\nType in 'q' followed by 'enter' to end this application." ); //$NON-NLS-1$
		char c;
		while(( c = (char) != 'q' ) {
			System.out.println( c );
	} catch( Exception e ) {
	} finally {
		System.out.println( "Undeploying " + args[ 0 ] + "..." ); //$NON-NLS-1$ //$NON-NLS-2$
		System.out.println( "Done." ); //$NON-NLS-1$

Copyright © Eclipse Foundation, Inc. All Rights Reserved.