public class MyBuilder extends Builder implements Serializable {private static final long serialVersionUID = 1L;public boolean perform(AbstractBuild<?, ?> build, Launcher launcher, BuildListener listener)throws InterruptedException, IOException {FilePath fp = new FilePath(build.getWorkspace(), "test.txt");String result = fp.act(new FileCallable<String>() {private static final long serialVersionUID = 1L;@Overridepublic String invoke(File file, VirtualChannel channel) throws IOException, InterruptedException {if (file.getAbsoluteFile().exists()){return file.getName() + " exists.";} else {return file.getName() + " doesn't exist.";}}});System.out.println("resultat : " + result);
FATAL: remote file operation failed: D:\workspace\JOB_NAME\test.txt at hudson.remoting.Channel@182752b:Slavehudson.util.IOException2: remote file operation failed: D:\workspace\JOB_NAME\test.txt at hudson.remoting.Channel@182752b:Slaveat hudson.FilePath.act(FilePath.java:900)at hudson.FilePath.act(FilePath.java:877)at com.company.tlb.proj.MyBuilder.perform(Unknown Source)at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:19)at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:804)at hudson.model.Build$BuildExecution.build(Build.java:199)at hudson.model.Build$BuildExecution.doRun(Build.java:160)at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:586)at hudson.model.Run.execute(Run.java:1575)at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:46)at hudson.model.ResourceController.execute(ResourceController.java:88)at hudson.model.Executor.run(Executor.java:237)Caused by: java.io.IOException: Unable to serialize hudson.FilePath$FileCallableWrapper@18b91cbat hudson.remoting.UserRequest.serialize(UserRequest.java:166)at hudson.remoting.UserRequest.<init>(UserRequest.java:62)at hudson.remoting.Channel.call(Channel.java:671)at hudson.FilePath.act(FilePath.java:893)... 11 moreCaused by: java.io.NotSerializableException: java.io.PrintStreamat java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1164)at java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1518)at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1483)at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1400)at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1158)at java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1518)at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1483)at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1400)at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1158)at java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1518)at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1483)at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1400)at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1158)at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:330)at hudson.remoting.UserRequest._serialize(UserRequest.java:155)at hudson.remoting.UserRequest.serialize(UserRequest.java:164)... 14 more
--
You received this message because you are subscribed to the Google Groups "Jenkins Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-de...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
--
You received this message because you are subscribed to the Google Groups "Jenkins Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-de...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
Started by user anonymous Building remotely on ubuntu64 in workspace /home/ubuntu/slave/workspace/stephanetestubuntu64 perform start watermelon.localdomain file /home/ubuntu/slave/workspace/stephanetestubuntu64/test.txt truechannel callable call host: domU-12-31-39-0A-3C-D0.compute-1.internal result: test.txt exists. host: domU-12-31-39-0A-3C-D0.compute-1.internalFinished: SUCCESS