Here are some references for you:

https://support.cloudbees.com/hc/en-us/articles/230612967-Pipeline-The-pipeline-even-if-successful-ends-with-java-io-NotSerializableException

https://github.com/jenkinsci/pipeline-plugin/blob/master/TUTORIAL.md#serializing-local-variables

https://issues.jenkins-ci.org/browse/JENKINS-35140




On Sunday, November 13, 2016 at 11:13:35 PM UTC-6, Ganesh Kumbhar wrote:
>
> Hello All,
>
> I am new to Jenkins pipeline and recently started to use it for my project 
> build.
>
> So, from Jenkins file I am calling a method from other .groovy file which 
> is simple script having some functions defined and in those functions I am 
> creating antbuilder object -> "@Field AntBuilder antBuilder = new 
> AntBuilder()"
> But the problem is, I am not able to call any ant targets using antbuilder 
> object, simply calling echo using this object like -> " antBuilder.echo 
> 'print 
> statement' "  gives *"NotSerializableException"*exception.
>
> java.io.NotSerializableException: org.apache.tools.ant.taskdefs.Echo
>
>       at 
> org.jboss.marshalling.river.RiverMarshaller.doWriteObject(RiverMarshaller.java:860)
>       at 
> org.jboss.marshalling.river.RiverMarshaller.doWriteFields(RiverMarshaller.java:1032)
>       at 
> org.jboss.marshalling.river.RiverMarshaller.doWriteSerializableObject(RiverMarshaller.java:988)
>       at 
> org.jboss.marshalling.river.RiverMarshaller.doWriteObject(RiverMarshaller.java:854)
>       at 
> org.jboss.marshalling.river.RiverMarshaller.doWriteFields(RiverMarshaller.java:1032)
>       at 
> org.jboss.marshalling.river.RiverMarshaller.doWriteSerializableObject(RiverMarshaller.java:988)
>       at 
> org.jboss.marshalling.river.RiverMarshaller.doWriteObject(RiverMarshaller.java:854)
>       at 
> org.jboss.marshalling.river.RiverMarshaller.doWriteFields(RiverMarshaller.java:1032)
>       at 
> org.jboss.marshalling.river.RiverMarshaller.doWriteSerializableObject(RiverMarshaller.java:988)
>       at 
> org.jboss.marshalling.river.RiverMarshaller.doWriteObject(RiverMarshaller.java:854)
>
>
> So please guide me to resolve this problem if anyone had faced this issue 
> or have any idea about it.
> Any help is appreciated!
> Thank you very much!
> Ganesh K.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Jenkins Users" 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-users/2b760da3-e4d8-4da4-a554-dbfca8576d86%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to