jBoss has been observed to get eager when auto deploying from a Jar: it
can sometimes start reading the Jar before the Jar has been completely
written. There are several ways to prevent this. There is code in
ContainerFactory.deploy that copies the newly deployed Jar to a temp
file and opens a JarFile on it. The JarFile ctor only succeeds if the
Jar is completely written, so the code in ContainerFactory.deploy could
be put in a pause/retry loop. On failure it could wait and then retry to
give the writer time to finish writing the Jar. It could try two or
three (or configurable) times before giving up.

Any comments on this approach? Any alternatives that may be better? 

Cheers,
Rhett Guthrie


Reply via email to