4
votes

I've been struggling with an annoying "Jenkins/Tomcat/Windows" problem for a while now without reaching any solution.

I've installed Tomcat version 7.0.25 in a Windows 7 Enterprise machine and Jenkins 1.451 as a webapplication running under Tomcat. I have just 4 jobs configured right now and all of then are using the "Always chekout a fresh copy" checkout strategy, so everytime a job runs the content in /jobs//workspace gets deleted. But, there are situations in which the job fails to run because it is unable to delete the /jobs//workspace/pom.xml file like you can see in this (edited) stacktrace:

Building in workspace C:\.hudson\jobs\<task name>\workspace
Cleaning local Directory .
java.io.IOException: Unable to delete C:\.hudson\jobs\<task name>\workspace\.\pom.xml
    at hudson.Util.deleteFile(Util.java:237)
    at hudson.Util.deleteRecursive(Util.java:287)
    at hudson.Util.deleteContentsRecursive(Util.java:198)
    at hudson.scm.subversion.CheckoutUpdater$1.perform(CheckoutUpdater.java:73)
    at hudson.scm.subversion.WorkspaceUpdater$UpdateTask.delegateTo(WorkspaceUpdater.java:136)
    at hudson.scm.SubversionSCM$CheckOutTask.perform(SubversionSCM.java:780)
    at hudson.scm.SubversionSCM$CheckOutTask.invoke(SubversionSCM.java:761)
    at hudson.scm.SubversionSCM$CheckOutTask.invoke(SubversionSCM.java:745)
    at hudson.FilePath.act(FilePath.java:788)
    at hudson.FilePath.act(FilePath.java:770)
    at hudson.scm.SubversionSCM.checkout(SubversionSCM.java:735)
    at hudson.scm.SubversionSCM.checkout(SubversionSCM.java:677)
    at hudson.model.AbstractProject.checkout(AbstractProject.java:1195)
    at hudson.model.AbstractBuild$AbstractRunner.checkout(AbstractBuild.java:576)
    at hudson.model.AbstractBuild$AbstractRunner.run(AbstractBuild.java:465)
    at hudson.model.Run.run(Run.java:1409)
    at hudson.maven.MavenModuleSetBuild.run(MavenModuleSetBuild.java:481)
    at hudson.model.ResourceController.execute(ResourceController.java:88)
    at hudson.model.Executor.run(Executor.java:238)
Retrying after 10 seconds  

Here you can see Tomcat locking the file as I told:

Tomcat locking pom.xml

After some time Jenkins/Tomcat releases the lock on the pom.xml and i can execute the job again without any problem.

Does anyone know how to get around this ? Am i missing something ? Thanks in advance!

1
which JVM version are you using? - Sebastian Łaskawiec
Hi altanis, i am using this one: 'java version "1.6.0_18" Java(TM) SE Runtime Environment (build 1.6.0_18-b07) Java HotSpot(TM) Client VM (build 16.0-b13, mixed mode, sharing)' - ederribeiro
This is pretty strange behavior. Please try updating java (try not to pick beta versions) and adding "-server" option to the JVM. - Sebastian Łaskawiec
Hi altanis, i've finally been able to follow your suggestions, but, unfortunately, with no success. I am using now the latest version of Java 6 (update 31) and running it as server and still i see the pom files getting locked. - ederribeiro
I am having the same issue. Seems in Windows the pom.xml being locked for some period. - Rudy

1 Answers

0
votes

I changed to Windows Service installation, and the pom.xml never gets locked anymore.

Seems that this caused by Tomcat that somehow locks the pom.xml, although the build has finished.