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-undepl开发者_如何学Pythonoy, 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.
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>
Remove your application manually under from work and tmp folders under your jboss installation. Stop JBoss before and start it after. This will help.
I think what is happens is:
- The WAR file is deployed and exploded.
- When your application starts, its classloader opens the JAR files and locks them to prevent them from being removed or overwritten.
- You then stop and undeploy the application.
- 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.
精彩评论