How do you remotely update Java applications?

前端 未结 9 1713
予麋鹿
予麋鹿 2021-01-30 17:30

We\'ve got a Java server application that runs on a number of computers, all connected to the Internet, some behind firewalls. We need to remotely update the JAR files and start

相关标签:
9条回答
  • 2021-01-30 18:13

    I'd recommend Capistrano for multi-server deployment. While it is built for deploying Rails apps, I've seen it used successfully to deploy Java applications.

    Link: Capistrano 2.0 Not Just for Rails

    0 讨论(0)
  • 2021-01-30 18:21

    Jars cannot be modified while the JVM is running on top of it and will result in errors. I have tried similar tasks and the best I came up with is making a copy of the updated Jar and transition the start up script to look at that Jar. Once you have the updated Jar, start it up and wait on the old Jar to end after giving it the signal to do so. Unfortunately this means a loss of GUI etc. for a sec but serializing most of the structures in java is easy and the current GUI could be transferred to the updated application before actually closing (some things may not be serializable though!).

    0 讨论(0)
  • 2021-01-30 18:21

    I believe you can hot-deploy JAR files if you use an OSGi-based app server like SpringSource dm Server. I've never used it myself, but knowing the general quality of the Spring portfolio, I'm sure it's worth a look.

    0 讨论(0)
提交回复
热议问题