Mojo AppAssembler Plugin

[appassembler] CLASSPATH environment variable overflow for too many dependencies

Details

  • Type: New Feature New Feature
  • Status: Closed Closed
  • Priority: Major Major
  • Resolution: Fixed
  • Affects Version/s: None
  • Fix Version/s: 1.0-beta-1
  • Component/s: None
  • Labels:
    None
  • Environment:
    windows
  • Number of attachments :
    0

Description

Having hundreds of dependencies the windows shell script tries to create a huge environment variable, which overflows. You get a "line too long" when running.

A possible solution would be to load jars inside the shell script by using a classloader like Jakarta Commons Launcher http://jakarta.apache.org/commons/launcher/, Ant, Uberjar or perhaps Classworlds http://classworlds.codehaus.org/

This would also open a whole new range of possibilities : having jar directories with different priorities (say an empty "patches" directory), having a different class loading order then the usual alphanumeric order (for conflicting jars)

Activity

Hide
Brill Pappin added a comment -

Thats not a bad idea (re ClassWorlds) but most launchers have a way of defining the classpath as a wildcard, for instance wrapper can define it as lib/* and it will add the jars it finds to the classpath.

On the other hand, using the classpath is actually not the best thing to do, or if you do you it in the startup scripts, you have to make sure you wipe out any existing classpath or you may end up importing something unintended (thats my developers don't use it).

I think using a bootstrapper like classworlds might be better anyway as it gives a good clean entry point to any application. My only concern is the overhead of loading jars that way. e.g. if I have a simple utility bundles with the app, I only need that one jar.

Show
Brill Pappin added a comment - Thats not a bad idea (re ClassWorlds) but most launchers have a way of defining the classpath as a wildcard, for instance wrapper can define it as lib/* and it will add the jars it finds to the classpath. On the other hand, using the classpath is actually not the best thing to do, or if you do you it in the startup scripts, you have to make sure you wipe out any existing classpath or you may end up importing something unintended (thats my developers don't use it). I think using a bootstrapper like classworlds might be better anyway as it gives a good clean entry point to any application. My only concern is the overhead of loading jars that way. e.g. if I have a simple utility bundles with the app, I only need that one jar.
Hide
Trygve Laugstol added a comment -

It would have to be an option that you could turn on if required.

Show
Trygve Laugstol added a comment - It would have to be an option that you could turn on if required.
Hide
Trygve Laugstol added a comment -

Kaare: what's the status on this one?

Show
Trygve Laugstol added a comment - Kaare: what's the status on this one?
Hide
Kaare Nilsen added a comment -

Well the code is now in the project, and functional (afaik), but there are some more work needed to clean it up to get the quality needed for a release.

Show
Kaare Nilsen added a comment - Well the code is now in the project, and functional (afaik), but there are some more work needed to clean it up to get the quality needed for a release.
Hide
Parag Mehta added a comment -

Allowing custom templates with markers would allow any kind of downstream system to be used for bootstrapping, from simple scripts to classworlds to perl scripts that can input an XML file and invoke jvm via exec bypassing command line length restrictions.

Show
Parag Mehta added a comment - Allowing custom templates with markers would allow any kind of downstream system to be used for bootstrapping, from simple scripts to classworlds to perl scripts that can input an XML file and invoke jvm via exec bypassing command line length restrictions.
Hide
Kaare Nilsen added a comment -

booter-windows and booter-unix daemons added that uses a booter that reads the generic booter xml file and creates a classloader based on the artifacts listed here. This has been tested and verified on both platforms to work as intended.

If you guys have changes of enhancment suggestions, please create new issues for this

Show
Kaare Nilsen added a comment - booter-windows and booter-unix daemons added that uses a booter that reads the generic booter xml file and creates a classloader based on the artifacts listed here. This has been tested and verified on both platforms to work as intended. If you guys have changes of enhancment suggestions, please create new issues for this

People

Vote (0)
Watch (4)

Dates

  • Created:
    Updated:
    Resolved: