• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

How do I incrementally patch a war file?

 
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
My war file is currently around 20mb. Sometimes I have small changes that need to be made and I would like to be able to send to the customer only the parts of the application that need to be updated, instead of sending the entire war file for every update.

The solution needs to be generic and work with any type of web application server and environment.

Thanks,
Chris
 
Java Cowboy
Posts: 16084
88
Android Scala IntelliJ IDE Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Using the jar tool (included with the JDK) you can extract, update etc. individual files inside a WAR file.

If you can update a WAR that is deployed on an application server incrementally depends on whether your particular app server supports that.
 
Christopher Lee
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I can't rely on my customers having the jdk installed so that they can update the war file. Most will only have the jre.

Is there another way?
 
Ranch Hand
Posts: 162
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
As Jesper said, you can use the JAR tool to add incrementally newer versions of certain files to your WAR. That's the only way that I'm aware of to do it.
So, I don't think it's a technical issue you're trying to solve, but a process issue.

As an old timer, I would highly recommend against giving the customer the "deltas" and then letting them update the WAR. That is fraught with peril.

20MB over FTP takes a couple minutes. I think you're *much* better off building the WAR yourself (making sure you have a copy that *exactly* matches
what your customer has for adding the new stuff).

My $0.02...
 
Christopher Lee
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
What about OSGi? I've been reading a little about it and it sounds like it might allow for what I'm trying to do.

The OSGi technology provides the standardized primitives that allow applications to be constructed from small, reusable and collaborative components. These components can be composed into an application and deployed.

The OSGi Service Platform provides the functions to change the composition dynamically on the device of a variety of networks, without requiring restarts.



Or am I reading too much into this? It also sounds a bit like the dependency injection feature of Spring (which I am currently using).


Also, I know that my war file is smallish at the moment (20 mb), but I'm planning on adding lots of new features over the next year or two. Assuming my war file gets to 100+ mb, do I really have to send the whole war file every time? How to the major companies handle this problem with their large applications?
 
Jesper de Jong
Java Cowboy
Posts: 16084
88
Android Scala IntelliJ IDE Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Do you really want to let your customers update the WAR file themselves? I don't know if that is a good idea... (assuming they are not Java developers). What if they do something wrong so that your software doesn't work anymore?

If there are resources that they have to be able to change themselves, then you could store them somewhere else, not inside the WAR file. Then they'd just have to put the right files in a directory somewhere and your webapp will pick them up from there.

What exactly are the replaceable parts of your application? Just data files (HTML pages, images, ...) or runnable code?
 
Christopher Lee
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Jesper de Jong wrote:Do you really want to let your customers update the WAR file themselves? I don't know if that is a good idea... (assuming they are not Java developers). What if they do something wrong so that your software doesn't work anymore?


I agree with you on this point. I don't like the idea of forcing the customer to manually repackage the war file. I am wondering what common strategies are used by others when dealing with this problem (multiple war/jar files, optional packages, etc). So far I haven't found a solution that works other than repackaging/redistributing the entire war.

Jesper de Jong wrote:What exactly are the replaceable parts of your application? Just data files (HTML pages, images, ...) or runnable code?


I would need to replace both static files(xml,xsl,js,etc) as well as updates to class files.
 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi this can be done by using this opensource library found here, https://truezip.java.net to update archive file.
reply
    Bookmark Topic Watch Topic
  • New Topic