![]() ![]() ![]() You launch application.exe, which checks version and finds that there's a new version.Because as said, runtime versioning issues are bad.įirst of all it is close to impossible to replace a running application, without restarting it, but there are techniques to transition fluidly. You do not want to use it in a production environment at your customer. But honestly: this is more of a debug feature, you do that in a development environment, for example using a tool like JRebel. or look into the "real" JVM hotswapping mechanism.either tell your users that they have to restart the application when updates came in.One customer might not have any issues, and the other might crash within 5 minutes (crashing at some point is very likely though). And it gets worse: the exact error scenario might totally depend on the workload that your JVM has seen so far, and how it is used after the update. Because it loaded some classes from X (version N), and other classes from X (version N+1, or N+5 because that customer skipped downloads for 2 weeks). And all of a sudden you have a versioning conflict within that JVM instance. class B is loaded from Jar X (version N+m)īut snap, that class B expects class A to look differently. ![]() class A is loaded from Jar X (version N).If at all, you enable situations such as: The classes are already loaded! Changing their "load origin" in the file system does not affect "running" classes. And downloading new JARs, with a full restart, that is fine.īut the question asks about updating a JAR "in use", and for that I have a distinct non-answer: you are going down the very wrong rabbit hole!Įven if you somehow hack your way into overriding the JAR file on the file system while one (or more!) JVMs that have (or have not) have loaded classes from that JAR are running, the result is not what you would expect it to be: replacing the JAR file content doesn't magically reload all classes into a running JVM. First of all: the other answer is correct, there are ways to silently update/restart JAR files. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |