Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Spring / Glassfish 3.1.2 stale files

I'm currently developping an application using Spring Web MVC & Spring Security.

I can deploy it on Glassfish 3.1.2 but when I want to redeploy after some bug fixing, I get this error :

WARNING: Exception while locating sub archive: XXX.war
WARNING: DPL8031: Ignoring XXX_war/ because the containing archive C:\dev\apps\glassfish3\glassfish\domains\domain1\applications\XXX recorded it as a pre-existing stale file

.glassfishStaleFiles contains :

XXX_war/
XXX_war/WEB-INF/
XXX_war/WEB-INF/lib/
XXX_war/WEB-INF/lib/spring-web-3.2.2.RELEASE.jar

And indeed, spring-web-3.2.2.RELEASE.jar still exists and when I try to remove it, I get a message that says It's still in use by JVM.

I found this link : https://www.java.net//forum/topic/glassfish/glassfish/stale-files-when-undeploying-web-app-glassfish-3

My question is : does someone have a workaround for this issue ?

It's really annoying while developping...

like image 601
Ludovic Guillaume Avatar asked May 10 '13 09:05

Ludovic Guillaume


2 Answers

To correct this problem, I have an easier solution :
Assuming your EAR file is correct:

  1. stop the server
  2. goto your EAR directory : C:\java_apps\glassfish3\glassfish\domains\domain1\applications\XXX_EAR
  3. delete the file called .glassfishStaleFiles
  4. restart server and re-deploy EAR file

It did the trick for me.

like image 148
Pat B Avatar answered Nov 11 '22 11:11

Pat B


Ok, after some days of research...

I finally found how to get around.

My project hierarchy was :

XXX.ear
--- lib/
------ XXX_Entities.jar
--- XXX_Ejb.jar
--- XXX_EjbClient.jar
--- XXX_Web.war
------ WEB-INF/lib/
--------- *libraries*

Now :

XXX.ear
--- lib/
------ XXX_Entities.jar
------ *libraries*
--- XXX_Ejb.jar
--- XXX_EjbClient.jar
--- XXX_Web.war

Then add lib folder to EAR deployment assembly and it works. Glassfish unload correctly when undeploying.

like image 38
Ludovic Guillaume Avatar answered Nov 11 '22 10:11

Ludovic Guillaume