[JIRA] [job-dsl-plugin] (JENKINS-30348) Additional classpath locks up JAR files

13 views
Skip to first unread message

vvv444@gmail.com (JIRA)

unread,
Sep 8, 2015, 10:16:03 AM9/8/15
to jenkinsc...@googlegroups.com
Vasili Galka created an issue
 
Jenkins / Bug JENKINS-30348
Additional classpath locks up JAR files
Issue Type: Bug Bug
Assignee: Daniel Spilker
Components: job-dsl-plugin
Created: 08/Sep/15 2:15 PM
Priority: Critical Critical
Reporter: Vasili Galka

Configuration: Jenkins 1.625, job-dsl-plugin 1.37, OS Windows 2012R2

I have a job containing:
1. Clean SVN checkout
2. Gradle step that obtains some dependency libraries.
3. "Process Job DSLs" step that uses these libraries in Groovy script.

The job was created basing on example from https://github.com/jenkinsci/job-dsl-plugin/wiki/User-Power-Moves#using-libraries

Running this job twice, returns an error on second run. The checkout fails since Java still locks the JAR files:

Cleaning local Directory .
java.nio.file.FileSystemException: d:\workspace\m\.\lib\antlr-runtime-3.4.jar: The process cannot access the file because it is being used by another process.

	at sun.nio.fs.WindowsException.translateToIOException(Unknown Source)
	at sun.nio.fs.WindowsException.rethrowAsIOException(Unknown Source)
	at sun.nio.fs.WindowsException.rethrowAsIOException(Unknown Source)
	at sun.nio.fs.WindowsFileSystemProvider.implDelete(Unknown Source)
	at sun.nio.fs.AbstractFileSystemProvider.delete(Unknown Source)
	at java.nio.file.Files.delete(Unknown Source)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
	at java.lang.reflect.Method.invoke(Unknown Source)
	at hudson.Util.deleteFile(Util.java:247)
	at hudson.Util.deleteRecursive(Util.java:310)
	at hudson.Util.deleteContentsRecursive(Util.java:212)
	at hudson.Util.deleteRecursive(Util.java:301)
	at hudson.Util.deleteContentsRecursive(Util.java:212)
	at hudson.scm.subversion.CheckoutUpdater$1.perform(CheckoutUpdater.java:81)
	at hudson.scm.subversion.WorkspaceUpdater$UpdateTask.delegateTo(WorkspaceUpdater.java:162)
	at hudson.scm.SubversionSCM$CheckOutTask.perform(SubversionSCM.java:992)
	at hudson.scm.SubversionSCM$CheckOutTask.invoke(SubversionSCM.java:973)
	at hudson.scm.SubversionSCM$CheckOutTask.invoke(SubversionSCM.java:949)
	at hudson.FilePath.act(FilePath.java:991)
	at hudson.FilePath.act(FilePath.java:969)
	at hudson.scm.SubversionSCM.checkout(SubversionSCM.java:898)
	at hudson.scm.SubversionSCM.checkout(SubversionSCM.java:834)
	at hudson.scm.SCM.checkout(SCM.java:485)
	at hudson.model.AbstractProject.checkout(AbstractProject.java:1277)
	at hudson.model.AbstractBuild$AbstractBuildExecution.defaultCheckout(AbstractBuild.java:610)
	at jenkins.scm.SCMCheckoutStrategy.checkout(SCMCheckoutStrategy.java:86)
	at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:532)
	at hudson.model.Run.execute(Run.java:1741)
	at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
	at hudson.model.ResourceController.execute(ResourceController.java:98)
	at hudson.model.Executor.run(Executor.java:408)
Finished: FAILURE

I found someone already reported similar problem few months ago, but no issue was opened: https://groups.google.com/forum/#!topic/job-dsl-plugin/zwSgrtJhOLc

Add Comment Add Comment
 
This message was sent by Atlassian JIRA (v6.4.2#64017-sha1:e244265)
Atlassian logo

vvv444@gmail.com (JIRA)

unread,
Sep 8, 2015, 10:17:02 AM9/8/15
to jenkinsc...@googlegroups.com
Vasili Galka updated an issue
Change By: Vasili Galka
*Configuration:* Jenkins 1.625, job-dsl-plugin 1.37, OS Windows 2012R2


I have a job containing:
1. Clean SVN checkout
2. Gradle step that obtains some dependency libraries.
3. "Process Job DSLs" step that uses these libraries in Groovy script.

The job was created basing on  this  example  from :  https://github.com/jenkinsci/job-dsl-plugin/wiki/User-Power-Moves#using-libraries


Running this job twice, returns an error on second run. The checkout fails since Java still locks the JAR files:
{noformat}
{noformat}


I found someone already reported similar problem few months ago, but no issue was opened: https://groups.google.com/forum/#!topic/job-dsl-plugin/zwSgrtJhOLc

mail@daniel-spilker.com (JIRA)

unread,
Sep 9, 2015, 5:45:01 AM9/9/15
to jenkinsc...@googlegroups.com
Daniel Spilker commented on Bug JENKINS-30348
 
Re: Additional classpath locks up JAR files

Have you tried the workaround (extracting the JARs) that is mentioned in the post?

vvv444@gmail.com (JIRA)

unread,
Sep 9, 2015, 7:19:01 AM9/9/15
to jenkinsc...@googlegroups.com

Not yet. I will try.
However, the existence of workaround does not contradict the existence of the bug

vvv444@gmail.com (JIRA)

unread,
Sep 9, 2015, 7:21:01 AM9/9/15
to jenkinsc...@googlegroups.com

I also attempted another workaround, by placing the JARs outside of the workspace. Unfortunately, it seems the "Additional classpath" field does not allow absolute paths (which could have been a nice feature too, and probably deserves a separate issue here).

scm_issue_link@java.net (JIRA)

unread,
Sep 22, 2015, 12:05:03 PM9/22/15
to jenkinsc...@googlegroups.com

Code changed in jenkins
User: Ray Huang
Path:
job-dsl-core/src/main/groovy/javaposse/jobdsl/dsl/helpers/common/DownstreamTriggerParameterContext.groovy
http://jenkins-ci.org/commit/job-dsl-plugin/d37b1a84bfd182c904ee85a3aa004cee92d86f03
Log:
Explicitly set `delegate` on `predefinedProps`

See [[https://issues.jenkins-ci.org/browse/JENKINS-30348 | Jenkins-30348]].

mail@daniel-spilker.com (JIRA)

unread,
Sep 24, 2015, 3:59:02 PM9/24/15
to jenkinsc...@googlegroups.com
Daniel Spilker updated an issue
 

Vasili Galka can you test the attached HPI file? It should fix the problem. You need to run JDK7 or later.

Change By: Daniel Spilker
Attachment: job-dsl.hpi

mail@daniel-spilker.com (JIRA)

unread,
Sep 24, 2015, 4:02:01 PM9/24/15
to jenkinsc...@googlegroups.com

scm_issue_link@java.net (JIRA)

unread,
Oct 4, 2015, 8:54:03 AM10/4/15
to jenkinsc...@googlegroups.com
SCM/JIRA link daemon resolved as Fixed
 
Change By: SCM/JIRA link daemon
Status: Open Resolved
Resolution: Fixed

scm_issue_link@java.net (JIRA)

unread,
Oct 4, 2015, 8:54:03 AM10/4/15
to jenkinsc...@googlegroups.com

Code changed in jenkins
User: Daniel Spilker
Path:
docs/Home.md
job-dsl-core/src/main/groovy/javaposse/jobdsl/dsl/DslScriptLoader.java
http://jenkins-ci.org/commit/job-dsl-plugin/98ad52ac530dc58156807cd7dca29f323301042c
Log:
fixed problem with additional classpath

[FIXES JENKINS-30348]

scm_issue_link@java.net (JIRA)

unread,
Oct 4, 2015, 8:54:03 AM10/4/15
to jenkinsc...@googlegroups.com

Code changed in jenkins
User: Daniel Spilker
Path:
docs/Home.md
job-dsl-core/src/main/groovy/javaposse/jobdsl/dsl/DslScriptLoader.java

scm_issue_link@java.net (JIRA)

unread,
Oct 5, 2015, 3:54:02 AM10/5/15
to jenkinsc...@googlegroups.com

Code changed in jenkins
User: Daniel Spilker
Path:
docs/Home.md

docs/Migration.md
job-dsl-core/src/main/groovy/javaposse/jobdsl/dsl/DslScriptLoader.java
job-dsl-core/src/test/groovy/javaposse/jobdsl/dsl/DslScriptLoaderSpec.groovy
http://jenkins-ci.org/commit/job-dsl-plugin/785de7f877fdbe8fc56b8b2423ae76ec9c59fa66
Log:
Merge pull request #634 from daspilker/

JENKINS-30348

avoid class loader leak, really fixes

JENKINS-30348

Compare: https://github.com/jenkinsci/job-dsl-plugin/compare/ea8254a85ec5...785de7f877fd

scm_issue_link@java.net (JIRA)

unread,
Oct 5, 2015, 3:54:04 AM10/5/15
to jenkinsc...@googlegroups.com

Code changed in jenkins
User: Daniel Spilker
Path:
docs/Home.md
docs/Migration.md
job-dsl-core/src/main/groovy/javaposse/jobdsl/dsl/DslScriptLoader.java
job-dsl-core/src/test/groovy/javaposse/jobdsl/dsl/DslScriptLoaderSpec.groovy


avoid class loader leak, really fixes

JENKINS-30348

mail@daniel-spilker.com (JIRA)

unread,
Oct 5, 2015, 4:58:04 AM10/5/15
to jenkinsc...@googlegroups.com
Daniel Spilker closed an issue as Fixed
 
Change By: Daniel Spilker
Status: Resolved Closed

vvv444@gmail.com (JIRA)

unread,
Oct 7, 2015, 6:19:01 AM10/7/15
to jenkinsc...@googlegroups.com
Vasili Galka commented on Bug JENKINS-30348
 
Re: Additional classpath locks up JAR files

Daniel Spilker
Sorry for delayed reply, we had long holidays here...
Indeed, I verified and version 1.39 solves the issue.
Many thanks!

johnpalomo1@gmail.com (JIRA)

unread,
Jan 13, 2016, 7:03:03 PM1/13/16
to jenkinsc...@googlegroups.com

We are currently using Jenkins 1.643 with Job DSL version 1.42 and we still get the error. We have seen this issue since 1.38 and have done successive updates to the plugin (39, 40, 41, 42), but have never rid ourselves of this issues.

[EnvInject] - Loading node environment variables.
Building on master in workspace C:\Program Files (x86)\Jenkins\jobs\dsl-seed-job_dev\workspace
[WS-CLEANUP] Deleting project workspace...
ERROR: [WS-CLEANUP] Cannot delete workspace: C:\Program Files (x86)\Jenkins\jobs\dsl-seed-job_dev\workspace\lib\groovy-all-1.8.9.jar: The process cannot access the file because it is being used by another process.

ERROR: Cannot delete workspace: C:\Program Files (x86)\Jenkins\jobs\dsl-seed-job_dev\workspace\lib\groovy-all-1.8.9.jar: The process cannot access the file because it is being used by another process.

If we bounce the Jenkins server, we can get around this issue.

mail@daniel-spilker.com (JIRA)

unread,
Jan 14, 2016, 3:20:01 AM1/14/16
to jenkinsc...@googlegroups.com

John Palomo: the classpath should not include any JARs that are already contained in Jenkins core or the Job DSL plugin. So in this case, exclude groovy-all-1.8.9.jar and it should work.

johnpalomo1@gmail.com (JIRA)

unread,
Jan 15, 2016, 10:43:02 AM1/15/16
to jenkinsc...@googlegroups.com

Daniel Spilker thanks so much. We had inherited this project from another team who was on a previous version of Job DSL. Excluding that library from our dependencies worked perfectly.

Reply all
Reply to author
Forward
0 new messages