Rickard,
hmm, well... let me explain:
> But more troubling is the installApplication() code. I don't understand
> how your local copy works. First it seems to copy the stuff being
> deployed into tmp. This is great, since we then don't look the original.
> But then you don't use it. As a consequence, the other code seems to
> work on the original so that it becomes locked, which is bad. I thought
> you should use the localCopy *only* once it had been created.
The localCopy I do currently only to determine the file type (try to
access the deployment descriptor), after this I try to remove it.
Once I know what type I have to deploy, I install it from the original
source. This doesnt seem smart, especially if we dont have much
bandwidth. But it was simpler to only pass the original source location,
which is needed to find libraries referenced by MANIFEST.MF/Class-Path:
entries in case of ejb or war packages.
I agree its not a clean solution, so maybe I should change this...
BTW the localCopy is needed, because I had trouble reading the
descriptor, when the content of a file changed where an url points to
(happens on repacking during development).
>
> Is this a bug, or what am I missing?
>
> Specifically, the exception I get (which is due to the deploy/file copy
> race condition) is:
> [Auto deploy] java.io.FileNotFoundException: JAR entry ebs.war not found
> in H:\projects\jboss\dist\d
> eploy\ebs.ear
> [Auto deploy] at
> sun.net.www.protocol.jar.JarURLConnection.connect(JarURLConnection.java:98)
> [Auto deploy] at
> sun.net.www.protocol.jar.JarURLConnection.getInputStream(JarURLConnection.java:10
> 8)
> [Auto deploy] at java.net.URL.openStream(URL.java:798)
> [Auto deploy] at
> org.jboss.deployment.URLWizzard.downloadAndInflate(URLWizzard.java:159)
> [Auto deploy] at
> org.jboss.deployment.URLWizzard.downloadAndInflateTemporary(URLWizzard.java:207)
> [Auto deploy] at
> org.jboss.deployment.J2eeDeployer.installWAR(J2eeDeployer.java:516)
> [Auto deploy] at
> org.jboss.deployment.J2eeDeployer.installApplication(J2eeDeployer.java:472)
> [Auto deploy] at
> org.jboss.deployment.J2eeDeployer.deploy(J2eeDeployer.java:128)
> ...
This is a bug! ...in the AutoDeployer. The AutoDeployer calls the
J2eeDeployer too early (before the copy (or jar operation) on OS level
is completed). I ve tried to prevent that by adding 4 lines to the
AutoDeployer (in its run method): I check the size of the file I m going
to deploy, wait a second and check it again and only if both sizes are
equal I do the deployment, else I skip it and try it on the next loop.
Whether I ve missed something there (?) or its a problem of the
implementation of java.io.File? I have no idea, currently...
\Daniel
> /Rickard
>