Results 1 to 3 of 3
  1. #1
    Goose is offline Member
    Join Date
    Aug 2009
    Location
    UK
    Posts
    2
    Rep Power
    0

    Default Best practice for packaging add-ons

    I am currently in the middle of reworking a custom apache-tomcat application and want to take the opportunity to resolve numerous problems we had with the old version.

    A large number of our customers ask for specific customisations of the product which which do for them. The problem is that we are constantly working on the product adding new features/bug fixing etc and this means all the customizations need to be merged in if we upgrade those customers.

    To try and solve a the majority of these situations I have been working on a rendering engine. Each screen in the application has a settings file, FreeMarker template and java class to render/process the screen through the use of reflections. These files will exist in a 'standard' directory. A customized version of these files can be placed in a 'custom' directory and these will be automatically used instead. In addition I can add new screens into the 'custom' directory for a customer. The theory is that we can easily upgrade and overwrite the 'standard' directory without touching their customisations.

    What I would like to do however is package the three files (or more if required) into a single 'add-on' file. I've not used jars too much and whilst reading up about them found there are a few different archive formats including war, rar (not winrar) and ear. Which would be the most suitable and why? I generally need to include one or more of the following file type: .class .xml .ftl

  2. #2
    vkorenev is offline Member
    Join Date
    Aug 2009
    Location
    Kharkov, Ukraine
    Posts
    29
    Rep Power
    0

    Default

    I think that plain jar is the most suitable here.
    war is for web apps.
    rar is for resource adapters.
    ear is for packing all of those together.

  3. #3
    Goose is offline Member
    Join Date
    Aug 2009
    Location
    UK
    Posts
    2
    Rep Power
    0

    Default

    Thanks for the reply. After much reading up etc I managed to package the files into a jar and access them at run time but as the class stored in the jar references other classes not contained within the jar the class loader throws a NoClassDefFoundError exception.

    I'm thinking it might be less hassle forgetting this idea and stick to separate files. :( I have learnt a couple of new things though so it was worth looking into.

Similar Threads

  1. Packaging all files into a single executable .jar
    By ichwar in forum New To Java
    Replies: 5
    Last Post: 01-27-2010, 02:31 AM
  2. SCJA - practice
    By Mihail Kravsun in forum Java Certification
    Replies: 2
    Last Post: 04-29-2009, 08:26 AM
  3. Packaging and Running Java Apps
    By JL4 in forum New To Java
    Replies: 1
    Last Post: 04-08-2009, 08:17 PM
  4. Packaging Driver and Applet
    By ibanez270dx in forum New To Java
    Replies: 0
    Last Post: 11-14-2007, 02:18 AM
  5. Packaging and accessing data files
    By todd in forum Advanced Java
    Replies: 1
    Last Post: 08-01-2007, 01:27 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •