Sorry for the confusion here.

The intention is to support running applications through the launcher using
$ java -jar launcher.jar ${your-executable-jar}

The launcher is assuming that your-executable-jar is packaged as a executable jar with Main-Class and Class-Path attributes in the manifest in exactly the way they would be if the jar was to be run directly itself using the -jar option. As you point out, running jars this way results in the --classpath option to the JRE and the CLASSPATH environment variable being ignored; I've always thought this was a curious thing for the JRE to do but I was trying to be consistent with it.

You can still add JARs to your application's classpath using the Class-Path manifest option. If you're building using Maven, the <classPath> config parameter can be used to get the archiver to add all dependencies this way (for an example see the pom in the launcher module).

The launcher automatically adds the SCA and Tuscany API jars through it's Class-Path so you don't need to specify those again.

You can also add to the application's classpath using <dependency> elements in the composite's SCDL. The launcher adds artifacts defined that way to the classloader used to load the application. We have recently added transitive dependency support using Maven so if your application jar contains Maven metadata then just listing it as a dependency in the composite will transitively bring in all other dependencies. Maven adds this metadata by default but you can also add it using Ant or any other build tool.

--
Jeremy

On Oct 15, 2006, at 1:50 PM, Peter Cousins wrote:

When running applications standalone typically the suggestion has been
to use



    java -jar launcher.jar ${your-executable-jar}



However, about a month ago changes were made to MainLauncherBooter that
removed support for supplying a --classpath argument.

Before this change, this argument could be used to set the classpath for
other dependencies required for the user component inside
"your-executable-jar", which is needed if you usee the suggested -jar
argument since doing so makes the system classloader ignore the contents
of the classpath java command line argument and the CLASSPATH
environment variable.



It was recently noted that --classpath is no longer supported and the
JIRA on it was closed as a doc bug in response to complaints about NPEs.

http://issues.apache.org/jira/browse/TUSCANY-838



However, anyone needing to boot their components standalone should add
launcher.jar to the classpath and launch like this instead:



  java org.apache.tuscany.launcher.MainLauncherBooter
${your-executable-jar}



also, don't forget to put your main class in the jar manifest since
support for the --main command line argument was also dropped.











---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to