11

I have a Java 1.6 application deployed on several machines (~ 30), and started as a Windows service.

My main problem concerns the maintenance of these deployed artifacts: if I develop a new version of this application, I don't want to manually redeploy it on every machine.

Ideally, when the Windows service is starting, it checks on a remote server if an update exists, and if it is found, then it upgrades the application. Note that it is acceptable that after this upgrade the service requires to be restarted again.

This mechanism can be compared to the Maven snapshot verification: if there is a newer version of a SNAPSHOT version on a remote repository, then Maven download it before running it. Note that the application itself will be deployed on a Maven repository (in our case Nexus), so the check for an update will be done against this Nexus instance.

What are my technical solutions to implement such an automatically application update?

Do not hesitate to ask me more details about technical information or about the context...

Thanks.


Edit: As stated by Peter Lawrey, I can use Java Web Start. However, how can I integrate JWS within a Java application that is run as a Windows service?

Andrew Thompson
  • 168,117
  • 40
  • 217
  • 433
Romain Linsolas
  • 79,475
  • 49
  • 202
  • 273
  • This is not a java problem. More of deployment management. – Santosh Jan 31 '12 at 13:29
  • While as phrased it isn't really a Java problem, I don't see how a slightly more generic version of the problem (ensuring that the version started is always the most recent version available) can't be solved in Java. An offshot of network class loading, maybe? – user Jan 31 '12 at 13:37
  • @Santosh yes and no. Windows - especially the ones we are using here - does not provide the required tools to ease such a procedure. Give me Linux, ssh, or some bash scripts, and I will be happy :) – Romain Linsolas Jan 31 '12 at 13:38

2 Answers2

4

I would look at Java Web Start

Peter Lawrey
  • 525,659
  • 79
  • 751
  • 1,130
  • JWS was one of my ideas, but I didn't succeed to make it work as expected. One of my problem is that the application should be run as a Windows service, and JWS starts another JVM for the application. Thus, the Windows service will stop once the JVM started by JWS starts. – Romain Linsolas Jan 31 '12 at 13:42
1

A common technique for this is to use a launcher. The steps are something like this:

  1. Start the launcher.
  2. The launcher checks to see if the application should be updated. If yes, the launcher updates the application (I think of this as "the update step").
  3. After the update step, the launcher runs the application.
DwB
  • 37,124
  • 11
  • 56
  • 82