-
Bug
-
Resolution: Unresolved
-
Major
-
None
-
Jenkins Version: 2.204.2
Docker Plugin Version: 1.1.9
Calls to https://<jenkins-host>/job/<JobName>/api/json result in an exception with the message DockerTemplate doesn’t have @ExportBean.
This occurs when the “Define a Docker template” option is used in the job configuration.
Stacktrace: org.kohsuke.stapler.export.NotExportableException: class com.nirima.jenkins.plugins.docker.DockerTemplate doesn't have @ExportedBean at org.kohsuke.stapler.export.Property.writeValue(Property.java:298) at org.kohsuke.stapler.export.Property.writeValue(Property.java:168) at org.kohsuke.stapler.export.Property.writeTo(Property.java:153) at org.kohsuke.stapler.export.Model.writeNestedObjectTo(Model.java:223) at org.kohsuke.stapler.export.Property.writeValue(Property.java:302) at org.kohsuke.stapler.export.Property.writeBuffered(Property.java:174) at org.kohsuke.stapler.export.Property.writeValue(Property.java:234) at org.kohsuke.stapler.export.Property.writeValue(Property.java:168) at org.kohsuke.stapler.export.Property.writeTo(Property.java:153) at org.kohsuke.stapler.export.Model.writeNestedObjectTo(Model.java:223) at org.kohsuke.stapler.export.Model.writeNestedObjectTo(Model.java:219) at org.kohsuke.stapler.export.Model.writeNestedObjectTo(Model.java:219) at org.kohsuke.stapler.export.Model.writeNestedObjectTo(Model.java:219) at org.kohsuke.stapler.export.Model.writeTo(Model.java:194) at org.kohsuke.stapler.ResponseImpl.writeOne(ResponseImpl.java:287) at org.kohsuke.stapler.ResponseImpl.serveExposedBean(ResponseImpl.java:278) at org.kohsuke.stapler.ResponseImpl.serveExposedBean(ResponseImpl.java:234) at hudson.model.Api.doJson(Api.java:223) at java.lang.invoke.MethodHandle.invokeWithArguments(MethodHandle.java:627) at org.kohsuke.stapler.Function$MethodFunction.invoke(Function.java:396) at org.kohsuke.stapler.Function$InstanceFunction.invoke(Function.java:408) at org.kohsuke.stapler.Function.bindAndInvoke(Function.java:212) at org.kohsuke.stapler.Function.bindAndInvokeAndServeResponse(Function.java:145) at org.kohsuke.stapler.MetaClass$11.doDispatch(MetaClass.java:535) at org.kohsuke.stapler.NameBasedDispatcher.dispatch(NameBasedDispatcher.java:58) at org.kohsuke.stapler.Stapler.tryInvoke(Stapler.java:747)
Well, you're 100% correct that it doesn't have an @ExportedBean annotation.
...but, as far as I am aware, it never has done and previously never needed one, so I'm unclear as to what it is, why it's now needed, and where (and in what form) it should be added.
If anyone can point readers in the direction of some good documentation explaining how/why/when ExportedBean should be used then that'll help someone (maybe me, maybe someone else) create a PR that adds this into the right places within the docker-plugin.