I ran into this recently. It turns out you can't pass an anonymous
implementation of MasterToSlaveFileCallable to `call`. It must be a named
class.

Mark Adamcin
http://adamcin.net/

On Tue, Oct 25, 2016 at 2:29 PM, <[email protected]> wrote:

> A user has asked me to support running my plugin on a slave but whatever I
> try I keep getting an “Unable to serialize” exception.  My code is now
> about as basic as it gets and still failing.  Any ideas?
>
>
>
> I’m running Jenkins 2.19.1 and my plugin has a Jenkins version dependency
> of '1.642.3'.
>
>
>
>
>
> @Override
>
> public boolean perform(final AbstractBuild<?, ?> build, final Launcher
> launcher, final BuildListener listener) throws IOException,
> InterruptedException {
>
>     return launcher.getChannel().call(new MasterToSlaveCallable<Boolean,
> IOException>() {
>
>            private static final long serialVersionUID =
> -8921104780200640023L;
>
>
>
>             @Override
>
>             public Boolean call() throws IOException {
>
>                 return true;
>
>             }
>
>        });
>
> }
>
>
>
>
>
> FATAL: Unable to serialize com.inedo.proget.jenkins.
> DownloadPackageBuilder$1@10c1200
>
> java.io.IOException: Unable to serialize com.inedo.proget.jenkins.
> DownloadPackageBuilder$1@10c1200
>
>                 at hudson.remoting.UserRequest.serialize(UserRequest.java:
> 201)
>
>                 at hudson.remoting.UserRequest.<init>(UserRequest.java:64)
>
>                 at hudson.remoting.Channel.call(Channel.java:795)
>
>                 at com.inedo.proget.jenkins.DownloadPackageBuilder.
> perform(DownloadPackageBuilder.java:84)
>
>                 at hudson.tasks.BuildStepMonitor$
> 1.perform(BuildStepMonitor.java:20)
>
>                 at hudson.model.AbstractBuild$AbstractBuildExecution.
> perform(AbstractBuild.java:779)
>
>                 at hudson.model.Build$BuildExecution.build(Build.java:205)
>
>                 at hudson.model.Build$BuildExecution.doRun(Build.java:162)
>
>                 at hudson.model.AbstractBuild$AbstractBuildExecution.run(
> AbstractBuild.java:534)
>
>                 at hudson.model.Run.execute(Run.java:1720)
>
>                 at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
>
>                 at hudson.model.ResourceController.execute(
> ResourceController.java:98)
>
>                 at hudson.model.Executor.run(Executor.java:404)
>
> Caused by: java.io.NotSerializableException: com.inedo.proget.jenkins.
> DownloadPackageBuilder
>
>                 at java.io.ObjectOutputStream.writeObject0(Unknown Source)
>
>                 at java.io.ObjectOutputStream.defaultWriteFields(Unknown
> Source)
>
>                 at java.io.ObjectOutputStream.writeSerialData(Unknown
> Source)
>
>                 at java.io.ObjectOutputStream.writeOrdinaryObject(Unknown
> Source)
>
>                 at java.io.ObjectOutputStream.writeObject0(Unknown Source)
>
>                 at java.io.ObjectOutputStream.writeObject(Unknown Source)
>
>                 at hudson.remoting.UserRequest._
> serialize(UserRequest.java:190)
>
>                 at hudson.remoting.UserRequest.serialize(UserRequest.java:
> 199)
>
>                 ... 12 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 [email protected].
> To view this discussion on the web visit https://groups.google.com/d/
> msgid/jenkinsci-dev/6bcb1974-23ca-4c49-8955-efd58cef74fa%
> 40googlegroups.com
> <https://groups.google.com/d/msgid/jenkinsci-dev/6bcb1974-23ca-4c49-8955-efd58cef74fa%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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 [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-dev/CACw%2B4snrX97J3He6itJD3sKeKCkH4WhFq1nknEo1DWYnjHhm5Q%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to