IAdapter
IAdapter

Reputation: 64807

How to remove exploded war in JBoss without stopping the server?

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.

Upvotes: 3

Views: 4933

Answers (3)

stacker
stacker

Reputation: 68992

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>

Upvotes: 1

Stephen C
Stephen C

Reputation: 719336

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.

Upvotes: 0

AlexR
AlexR

Reputation: 115378

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

Upvotes: 0

Related Questions