java.io.FileNotFoundException: /prod/jenkins/test-slave/workspace/MYProjectBuild/pom.xml (No such file or directory)

Jenkins JIRA | Mihir Vora | 10 months ago
  1. 0

    The script i am using the in postbuild-step is as follows, I am trying to extract the MAVEN_VERSION from the file and it doesnt find the file on remote slave, however when i execute the same on local slave the same works fine, So i believe the Plugin needs to be updated to have a VirtualChannel open to the remote workspace for parsing file, I havent looked at the code yet but if anyone has a quick fix, can some one help with this import jenkins.util.*; import jenkins.model.*; def thr = Thread.currentThread(); def currentBuild = thr?.executable; def workspace = currentBuild.getModuleRoot().absolutize().toString(); def project = new XmlSlurper().parse(new File("$workspace/pom.xml")) def param = new hudson.model.StringParameterValue("MAVEN_VERSION", project.version.toString()) currentBuild.addAction(new hudson.model.ParametersAction(param)); Error in log - ERROR: Failed to evaluate groovy script. java.io.FileNotFoundException: /prod/jenkins/test-slave/workspace/MYProjectBuild/pom.xml (No such file or directory) at java.io.FileInputStream.open0(Native Method) at java.io.FileInputStream.open(FileInputStream.java:195) at java.io.FileInputStream.<init>(FileInputStream.java:138) at groovy.util.XmlSlurper.parse(XmlSlurper.java:160) at groovy.util.XmlSlurper$parse.call(Unknown Source) at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:42) at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:108) at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:116) at Script1.run(Script1.groovy:6) at groovy.lang.GroovyShell.evaluate(GroovyShell.java:580) at groovy.lang.GroovyShell.evaluate(GroovyShell.java:618) at groovy.lang.GroovyShell.evaluate(GroovyShell.java:589) at org.jenkinsci.plugins.scriptsecurity.sandbox.groovy.SecureGroovyScript.evaluate(SecureGroovyScript.java:166) at org.jvnet.hudson.plugins.groovypostbuild.GroovyPostbuildRecorder.perform(GroovyPostbuildRecorder.java:362) at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:20) at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:785) at hudson.model.AbstractBuild$AbstractBuildExecution.performAllBuildSteps(AbstractBuild.java:726) at hudson.model.Build$BuildExecution.post2(Build.java:185) at hudson.model.AbstractBuild$AbstractBuildExecution.post(AbstractBuild.java:671) at hudson.model.Run.execute(Run.java:1766) at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43) at hudson.model.ResourceController.execute(ResourceController.java:98) at hudson.model.Executor.run(Executor.java:408)

    Jenkins JIRA | 10 months ago | Mihir Vora
    java.io.FileNotFoundException: /prod/jenkins/test-slave/workspace/MYProjectBuild/pom.xml (No such file or directory)
  2. 0

    The script i am using the in postbuild-step is as follows, I am trying to extract the MAVEN_VERSION from the file and it doesnt find the file on remote slave, however when i execute the same on local slave the same works fine, So i believe the Plugin needs to be updated to have a VirtualChannel open to the remote workspace for parsing file, I havent looked at the code yet but if anyone has a quick fix, can some one help with this import jenkins.util.*; import jenkins.model.*; def thr = Thread.currentThread(); def currentBuild = thr?.executable; def workspace = currentBuild.getModuleRoot().absolutize().toString(); def project = new XmlSlurper().parse(new File("$workspace/pom.xml")) def param = new hudson.model.StringParameterValue("MAVEN_VERSION", project.version.toString()) currentBuild.addAction(new hudson.model.ParametersAction(param)); Error in log - ERROR: Failed to evaluate groovy script. java.io.FileNotFoundException: /prod/jenkins/test-slave/workspace/MYProjectBuild/pom.xml (No such file or directory) at java.io.FileInputStream.open0(Native Method) at java.io.FileInputStream.open(FileInputStream.java:195) at java.io.FileInputStream.<init>(FileInputStream.java:138) at groovy.util.XmlSlurper.parse(XmlSlurper.java:160) at groovy.util.XmlSlurper$parse.call(Unknown Source) at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:42) at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:108) at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:116) at Script1.run(Script1.groovy:6) at groovy.lang.GroovyShell.evaluate(GroovyShell.java:580) at groovy.lang.GroovyShell.evaluate(GroovyShell.java:618) at groovy.lang.GroovyShell.evaluate(GroovyShell.java:589) at org.jenkinsci.plugins.scriptsecurity.sandbox.groovy.SecureGroovyScript.evaluate(SecureGroovyScript.java:166) at org.jvnet.hudson.plugins.groovypostbuild.GroovyPostbuildRecorder.perform(GroovyPostbuildRecorder.java:362) at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:20) at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:785) at hudson.model.AbstractBuild$AbstractBuildExecution.performAllBuildSteps(AbstractBuild.java:726) at hudson.model.Build$BuildExecution.post2(Build.java:185) at hudson.model.AbstractBuild$AbstractBuildExecution.post(AbstractBuild.java:671) at hudson.model.Run.execute(Run.java:1766) at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43) at hudson.model.ResourceController.execute(ResourceController.java:98) at hudson.model.Executor.run(Executor.java:408)

    Jenkins JIRA | 10 months ago | Mihir Vora
    java.io.FileNotFoundException: /prod/jenkins/test-slave/workspace/MYProjectBuild/pom.xml (No such file or directory)
  3. 0

    Groovy-Postbuild-Plugin execution on remote slave fails, complains about File Not Found

    Stack Overflow | 10 months ago | mv012004
    java.io.FileNotFoundException: /prod/jenkins/test-slave/workspace/MYProjectBuild/pom.xml (No such file or directory)
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  5. 0

    Building with mvn install -Dmaven.test.skip=true

    axis-java-user | 9 months ago | Stadelmann Josef
    org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.codehaus.gmavenplus:gmavenplus-plugin:1.5:execute (default) on project axis2-java2wsdl: Error occurred whil e calling a method on a Groovy class from classpath.
  6. 0

    RE: Building with mvn install -Dmaven.test.skip=true

    axis-java-user | 9 months ago | Martin Gainty
    org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.codehaus.gmavenplus:gmavenplus-plugin:1.5:execute (default) on project axis2-java2wsdl: Error occurred whil e calling a method on a Groovy class from classpath.

  1. stigkj 2 times, last 1 month ago
  2. r1chjames 1 times, last 6 days ago
  3. richard77 1 times, last 2 weeks ago
  4. gehel 2 times, last 2 weeks ago
  5. Kialandei 100 times, last 2 weeks ago
45 more registered users
50 unregistered visitors
Not finding the right solution?
Take a tour to get the most out of Samebug.

Tired of useless tips?

Automated exception search integrated into your IDE

Root Cause Analysis

  1. java.io.FileNotFoundException

    /prod/jenkins/test-slave/workspace/MYProjectBuild/pom.xml (No such file or directory)

    at java.io.FileInputStream.open0()
  2. Java RT
    FileInputStream.<init>
    1. java.io.FileInputStream.open0(Native Method)
    2. java.io.FileInputStream.open(FileInputStream.java:195)
    3. java.io.FileInputStream.<init>(FileInputStream.java:138)
    3 frames
  3. Groovy
    AbstractCallSite.call
    1. groovy.util.XmlSlurper.parse(XmlSlurper.java:160)
    2. groovy.util.XmlSlurper$parse.call(Unknown Source)
    3. org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:42)
    4. org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:108)
    5. org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:116)
    5 frames
  4. Unknown
    Script1.run
    1. Script1.run(Script1.groovy:6)
    1 frame
  5. Groovy
    GroovyShell.evaluate
    1. groovy.lang.GroovyShell.evaluate(GroovyShell.java:580)
    2. groovy.lang.GroovyShell.evaluate(GroovyShell.java:618)
    3. groovy.lang.GroovyShell.evaluate(GroovyShell.java:589)
    3 frames
  6. org.jenkinsci.plugins
    SecureGroovyScript.evaluate
    1. org.jenkinsci.plugins.scriptsecurity.sandbox.groovy.SecureGroovyScript.evaluate(SecureGroovyScript.java:166)
    1 frame
  7. org.jvnet.hudson
    GroovyPostbuildRecorder.perform
    1. org.jvnet.hudson.plugins.groovypostbuild.GroovyPostbuildRecorder.perform(GroovyPostbuildRecorder.java:362)
    1 frame
  8. Hudson
    Executor.run
    1. hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:20)
    2. hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:785)
    3. hudson.model.AbstractBuild$AbstractBuildExecution.performAllBuildSteps(AbstractBuild.java:726)
    4. hudson.model.Build$BuildExecution.post2(Build.java:185)
    5. hudson.model.AbstractBuild$AbstractBuildExecution.post(AbstractBuild.java:671)
    6. hudson.model.Run.execute(Run.java:1766)
    7. hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
    8. hudson.model.ResourceController.execute(ResourceController.java:98)
    9. hudson.model.Executor.run(Executor.java:408)
    9 frames