You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tuscany.apache.org by Peter Cousins <pe...@itemfield.com> on 2006/10/15 22:50:30 UTC

Problems related to changes to MainLauncherBooter

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.

 

 

 

 


Re: Problems related to changes to MainLauncherBooter

Posted by Venkata Krishnan <fo...@gmail.com>.
Hi Jeremy,

Please ignore my prev. mail.  I find this now done :)

Thanks

- Venkat

On 10/16/06, Venkata Krishnan <fo...@gmail.com> wrote:
>
> Hi Jeremy,
>
> As part of the the standalone distribution zip would it be a good thing to
> have a 'extensions' directory and a readme in it which will instruct the
> user about what that directory is meant for and what would typically get to
> be put there.  So when the user extracts the distribution this directory is
> in place with some instruction in it.  I am saying this out of my experience
> extracting the disb a few times now and then going and creating the
> 'extensions' directory and so on.
>
> Thanks
>
> - Venkat
>
>
>
> On 10/16/06, Jeremy Boynes <jb...@apache.org> wrote:
> >
> > 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: tuscany-dev-unsubscribe@ws.apache.org
> > For additional commands, e-mail: tuscany-dev-help@ws.apache.org
> >
> >
>

Re: Problems related to changes to MainLauncherBooter

Posted by Venkata Krishnan <fo...@gmail.com>.
Hi Jeremy,

As part of the the standalone distribution zip would it be a good thing to
have a 'extensions' directory and a readme in it which will instruct the
user about what that directory is meant for and what would typically get to
be put there.  So when the user extracts the distribution this directory is
in place with some instruction in it.  I am saying this out of my experience
extracting the disb a few times now and then going and creating the
'extensions' directory and so on.

Thanks

- Venkat



On 10/16/06, Jeremy Boynes <jb...@apache.org> wrote:
>
> 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: tuscany-dev-unsubscribe@ws.apache.org
> For additional commands, e-mail: tuscany-dev-help@ws.apache.org
>
>

Re: Problems related to changes to MainLauncherBooter

Posted by Jeremy Boynes <jb...@apache.org>.
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: tuscany-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: tuscany-dev-help@ws.apache.org