3

I can delete everything except lib folder(JBoss says application is undeployed, but he wont release the jars).

I tied jboss-maven-plugin and hard-undeploy, however it says that file(doc says it also support dirs) is undeployed, however it does not undeploy application.

Im using jboss-4.2.1.GA. I bet it can be undeployed through jmx-console, but i weren't able to find out how.

IAdapter
  • 62,595
  • 73
  • 179
  • 242

3 Answers3

1

The way Seam performs an undeploy an exploded application is

<target name="unexplode" description="Undeploy the exploded archive">
        <delete failonerror="no">
            <fileset dir="${ear.deploy.dir}">
                <exclude name="**/*.jar"/>
            </fileset>
        </delete>
        <delete file="${deploy.dir}/${project.name}-ds.xml" failonerror="no"/>
        <delete dir="${ear.deploy.dir}" failonerror="no"/>
</target>

this usually works good, sometimes I need to restart (by touching a file which is observerd by the deployer)

<target name="restart-exploded">
    <antcall target="explode"/>
    <touch file="${ear.deploy.dir}/META-INF/application.xml"/>
</target>
stacker
  • 68,052
  • 28
  • 140
  • 210
0

Remove your application manually under from work and tmp folders under your jboss installation. Stop JBoss before and start it after. This will help.

AlexR
  • 114,158
  • 16
  • 130
  • 208
  • The Libs aren't unloaded completely from the Classloader. The JVM holds a filehandle and especially windows can't delete the files. – Christian Kuetbach Dec 08 '10 at 10:22
  • After I stop the server I just need to delete exploded dir, but Id like to be able to undeploy without stopping the server. – IAdapter Dec 08 '10 at 19:02
0

I think what is happens is:

  1. The WAR file is deployed and exploded.
  2. When your application starts, its classloader opens the JAR files and locks them to prevent them from being removed or overwritten.
  3. You then stop and undeploy the application.
  4. Unfortunately the classloader still exists, and the locks it still holds prevent removal of the JAR files.

The classloader could still exist for two reasons:

  • It could be unreachable, but the GC hasn't run.
  • It could have been leaked, so it won't removed even if the GC does run.

The only sure solution is to shutdown and restart JBoss.

Stephen C
  • 698,415
  • 94
  • 811
  • 1,216