12 Replies Latest reply on Mar 2, 2002 11:43 AM by adrian.brock

    can't delete EAR in deploy directory

      Hi dudes,

      I have some problems using JBoss3.0beta2 when I want
      to undeploy an .ear by deleting the file in the deploy directory.

      The file can't be deleted. Is it normal and I missed
      something or this should be fixed ?

      Thanks a lot

        • 1. Re: can't delete EAR in deploy directory

          This is a problem on windows
          Latest CVS should be fixed.

          The underlying problem was supposed to have been fixed
          in java1.4, but it doesnt look like it :-(

          Regards,
          Adrian

          • 2. Re: can't delete EAR in deploy directory

            I tried the CVS version today.
            The problem still occurs.

            • 3. Re: can't delete EAR in deploy directory

              Ok,

              I saw some discussion on the dev-list about this
              problem. I assumed this had been fixed.

              I checked on sourceforge, there is an open bug report
              for a similar problem. You might want to montior it?

              http://sourceforge.net/tracker/index.php?func=detail&aid=523305&group_id=22866&atid=376685

              Regards,
              Adrian

              • 4. Re: can't delete EAR in deploy directory
                giorgio42


                This worked with RH alpha, as far as I rember.
                How could it be a problem of the JDK?

                Georg

                • 5. Re: can't delete EAR in deploy directory

                  Previous versions of JBoss included a workaround for
                  windows.
                  This involves copying deployments into jboss\tmp.

                  The previous versions moved the problem. The files
                  from jboss\tmp cannot be removed until jboss restarts.

                  Somewhere in the new deployer code this workaround was
                  broken. :-(

                  Regards,
                  Adrian

                  • 6. Re: can't delete EAR in deploy directory
                    davidjencks

                    The files are still being copied to tmp/deploy with the same code as several weeks ago. Someone with a windows machine is going to have to look at this, I can't reproduce it on linux or os X

                    • 7. Re: can't delete EAR in deploy directory

                      Maybe I've found a temporary solution to this
                      problem.

                      You setup a local http server on your machine showing your
                      ear and you deploy with a http://localhost/application.ear
                      url in the MainDeployer mbean.

                      bye.

                      • 8. Re: can't delete EAR in deploy directory
                        giorgio42

                        Here's a snippet from the log on my W32 system.
                        Note the "Could not delete ..." line.

                        Isn't it simply that the jars are kept open by
                        the server all the time? (On U*x platforms you
                        can delete any open file, if it has not been
                        locked explicitly, so this is not a problem).

                        2002-03-01 21:36:28,121 INFO [org.jboss.ejb.EjbModule] Destroyed
                        2002-03-01 21:36:28,121 DEBUG [org.jboss.system.ServiceController] removing service: jboss.j2ee:service=EjbModule,url=file%/D%/apps/jboss/jboss-3.0.0beta2/server/default/deploy/pmsystem-eb-ejb.jar
                        2002-03-01 21:36:28,121 DEBUG [org.jboss.system.ServiceController] removing jboss.j2ee:service=EjbModule,url=file%/D%/apps/jboss/jboss-3.0.0beta2/server/default/deploy/pmsystem-eb-ejb.jar from server
                        2002-03-01 21:36:28,121 INFO [org.jboss.deployment.MainDeployer] could not delete directory file:/D:/apps/jboss/jboss-3.0.0beta2/server/default/tmp/deploy/D/apps/jboss/jboss-3.0.0beta2/server/default/deploy/pmsystem-eb-ejb.jar/68.pmsystem-eb-ejb.jar restart will delete it
                        2002-03-01 21:36:28,121 TRACE [org.jboss.system.ServiceLibraries] removing classloader org.jboss.system.UnifiedClassLoader@ea265f89{ url=file:/D:/apps/jboss/jboss-3.0.0beta2/server/default/tmp/deploy/D/apps/jboss/jboss-3.0.0beta2/server/default/deploy/pmsystem-eb-ejb.jar/68.pmsystem-eb-ejb.jar }

                        Just checked:

                        Using the Process Explorer from www.systinternals.com
                        I can see that all jars in tmp\deploy and all jars in
                        the deploy directory are kept open by the java
                        process that runs the JBoss server.

                        With this tool I can forcibly close the file handle
                        of my deployed jar. After that I can delete the file.

                        And it is undeployed.


                        Georg

                        • 9. Re: can't delete EAR in deploy directory

                          Yes,

                          It is that simple, but then again it is not.

                          The jars are closed, but the jdk zip/jar processing
                          doesn't properly close the file.
                          This was a known bug that supposed to have been fixed
                          in JDK1.4. I've seen it reported by others that it is not
                          fixed.

                          The bug only causes a problem on windows because of the
                          locking mechanism.

                          Regards,
                          Adrian

                          • 10. Re: can't delete EAR in deploy directory

                            ok warjort, but tell me why was there not this problem
                            with the alpha version of jboss3 ?

                            • 11. Re: can't delete EAR in deploy directory
                              davidjencks

                              The deploy stuff changed dramatically in beta. The problem is very odd because we should not be looking at the original file as a zip/jar- we should have just copied it, and then looked at it.

                              • 12. Re: can't delete EAR in deploy directory

                                I've found the problem and fixed it.
                                The jar and ear deployments were passing the "deploy"
                                url to jsr77 to load the deployment descriptors.

                                I've changed them both to get the deployment descriptors
                                from the "tmp" copy.

                                Let me know if this is still a problem. I've noticed
                                a couple of other problems with latest CVS though :-(

                                Regards,
                                Adrian