[Plugin] Exception while saving configuration for custom plugin

13 views
Skip to first unread message

Rupp, Moritz (Software Services)

unread,
Aug 18, 2016, 4:47:05 AM8/18/16
to jenkin...@googlegroups.com

Hello Jenkins developers,

 

I’m currently developing a Jenkins plugin for deploying artifacts to a proprietary software by Hewlett Packard Enterprise. Therefore, I’m using the software’s Java API.

The initial configuration of the job and the post-build step are working fine. The deployment works as well.

 

But when I open the job’s configuration again, I’m receiving an exception once I click on apply or save. I’m receiving a NoClassDefFoundError for a proprietary class of the API.

 

My question is: why is it even using the API on saving the configuration? What exactly happens when I click save? I only use the API in my perform method.

 

Here is the exception:

javax.servlet.ServletException: java.lang.NoClassDefFoundError: com/hp/ucmdb/protocol/schema/Protocol

    at org.kohsuke.stapler.Stapler.tryInvoke(Stapler.java:796)

    at org.kohsuke.stapler.Stapler.invoke(Stapler.java:876)

    at org.kohsuke.stapler.MetaClass$6.doDispatch(MetaClass.java:249)

    at org.kohsuke.stapler.NameBasedDispatcher.dispatch(NameBasedDispatcher.java:53)

    at org.kohsuke.stapler.Stapler.tryInvoke(Stapler.java:746)

    at org.kohsuke.stapler.Stapler.invoke(Stapler.java:876)

    at org.kohsuke.stapler.Stapler.invoke(Stapler.java:649)

    at org.kohsuke.stapler.Stapler.service(Stapler.java:238)

    at javax.servlet.http.HttpServlet.service(HttpServlet.java:790)

    at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:812)

    at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1669)

    at hudson.util.PluginServletFilter$1.doFilter(PluginServletFilter.java:132)

    at hudson.util.PluginServletFilter.doFilter(PluginServletFilter.java:123)

   at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1652)

    at hudson.security.csrf.CrumbFilter.doFilter(CrumbFilter.java:49)

    at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1652)

    at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:84)

    at hudson.security.ChainedServletFilter.doFilter(ChainedServletFilter.java:76)

    at hudson.security.HudsonFilter.doFilter(HudsonFilter.java:171)

    at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1652)

    at org.kohsuke.stapler.compression.CompressionFilter.doFilter(CompressionFilter.java:49)

    at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1652)

    at hudson.util.CharacterEncodingFilter.doFilter(CharacterEncodingFilter.java:81)

    at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1652)

    at org.kohsuke.stapler.DiagnosticThreadNameFilter.doFilter(DiagnosticThreadNameFilter.java:30)

    at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1652)

    at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:585)

    at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:143)

    at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:553)

    at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:223)

    at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1127)

    at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:515)

    at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:185)

    at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1061)

    at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:141)

    at org.eclipse.jetty.server.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:215)

    at org.eclipse.jetty.server.handler.HandlerCollection.handle(HandlerCollection.java:110)

    at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:97)

    at org.eclipse.jetty.server.Server.handle(Server.java:499)

    at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:311)

    at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:257)

    at org.eclipse.jetty.io.AbstractConnection$2.run(AbstractConnection.java:544)

    at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:635)

    at org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:555)

    at java.lang.Thread.run(Thread.java:745)

Caused by: java.lang.NoClassDefFoundError: com/hp/ucmdb/protocol/schema/Protocol

    at java.lang.Class.getDeclaredMethods0(Native Method)

    at java.lang.Class.privateGetDeclaredMethods(Class.java:2701)

    at java.lang.Class.getDeclaredMethod(Class.java:2128)

    at com.thoughtworks.xstream.converters.reflection.SerializationMethodInvoker.getMethod(SerializationMethodInvoker.java:165)

    at com.thoughtworks.xstream.converters.reflection.SerializationMethodInvoker.getMethod(SerializationMethodInvoker.java:149)

    at com.thoughtworks.xstream.converters.reflection.SerializationMethodInvoker.callWriteReplace(SerializationMethodInvoker.java:86)

    at hudson.util.RobustReflectionConverter.marshal(RobustReflectionConverter.java:100)

    at com.thoughtworks.xstream.core.AbstractReferenceMarshaller.convert(AbstractReferenceMarshaller.java:69)

    at com.thoughtworks.xstream.core.TreeMarshaller.convertAnother(TreeMarshaller.java:58)

    at com.thoughtworks.xstream.core.AbstractReferenceMarshaller$1.convertAnother(AbstractReferenceMarshaller.java:84)

    at hudson.util.RobustReflectionConverter.marshallField(RobustReflectionConverter.java:224)

    at hudson.util.RobustReflectionConverter$2.writeField(RobustReflectionConverter.java:211)

    at hudson.util.RobustReflectionConverter$2.visit(RobustReflectionConverter.java:183)

    at com.thoughtworks.xstream.converters.reflection.PureJavaReflectionProvider.visitSerializableFields(PureJavaReflectionProvider.java:138)

    at hudson.util.RobustReflectionConverter.doMarshal(RobustReflectionConverter.java:168)

    at hudson.util.RobustReflectionConverter.marshal(RobustReflectionConverter.java:109)

    at com.thoughtworks.xstream.core.AbstractReferenceMarshaller.convert(AbstractReferenceMarshaller.java:69)

    at com.thoughtworks.xstream.core.TreeMarshaller.convertAnother(TreeMarshaller.java:58)

    at com.thoughtworks.xstream.core.AbstractReferenceMarshaller$1.convertAnother(AbstractReferenceMarshaller.java:84)

    at hudson.util.RobustReflectionConverter.marshallField(RobustReflectionConverter.java:224)

    at hudson.util.RobustReflectionConverter$2.writeField(RobustReflectionConverter.java:211)

    at hudson.util.RobustReflectionConverter$2.visit(RobustReflectionConverter.java:183)

    at com.thoughtworks.xstream.converters.reflection.PureJavaReflectionProvider.visitSerializableFields(PureJavaReflectionProvider.java:138)

    at hudson.util.RobustReflectionConverter.doMarshal(RobustReflectionConverter.java:168)

    at hudson.util.RobustReflectionConverter.marshal(RobustReflectionConverter.java:109)

    at com.thoughtworks.xstream.core.AbstractReferenceMarshaller.convert(AbstractReferenceMarshaller.java:69)

    at com.thoughtworks.xstream.core.TreeMarshaller.convertAnother(TreeMarshaller.java:58)

    at com.thoughtworks.xstream.core.AbstractReferenceMarshaller$1.convertAnother(AbstractReferenceMarshaller.java:84)

    at hudson.util.RobustReflectionConverter.marshallField(RobustReflectionConverter.java:224)

    at hudson.util.RobustReflectionConverter$2.writeField(RobustReflectionConverter.java:211)

    at hudson.util.RobustReflectionConverter$2.visit(RobustReflectionConverter.java:183)

    at com.thoughtworks.xstream.converters.reflection.PureJavaReflectionProvider.visitSerializableFields(PureJavaReflectionProvider.java:138)

    at hudson.util.RobustReflectionConverter.doMarshal(RobustReflectionConverter.java:168)

    at hudson.util.RobustReflectionConverter.marshal(RobustReflectionConverter.java:109)

    at com.thoughtworks.xstream.core.AbstractReferenceMarshaller.convert(AbstractReferenceMarshaller.java:69)

    at com.thoughtworks.xstream.core.TreeMarshaller.convertAnother(TreeMarshaller.java:58)

    at com.thoughtworks.xstream.core.TreeMarshaller.convertAnother(TreeMarshaller.java:43)

    at com.thoughtworks.xstream.core.AbstractReferenceMarshaller$1.convertAnother(AbstractReferenceMarshaller.java:88)

    at com.thoughtworks.xstream.converters.collections.AbstractCollectionConverter.writeItem(AbstractCollectionConverter.java:64)

    at hudson.util.DescribableList$ConverterImpl.marshal(DescribableList.java:269)

    at com.thoughtworks.xstream.core.AbstractReferenceMarshaller.convert(AbstractReferenceMarshaller.java:69)

    at com.thoughtworks.xstream.core.TreeMarshaller.convertAnother(TreeMarshaller.java:58)

    at com.thoughtworks.xstream.core.AbstractReferenceMarshaller$1.convertAnother(AbstractReferenceMarshaller.java:84)

    at hudson.util.RobustReflectionConverter.marshallField(RobustReflectionConverter.java:224)

    at hudson.util.RobustReflectionConverter$2.writeField(RobustReflectionConverter.java:211)

    at hudson.util.RobustReflectionConverter$2.visit(RobustReflectionConverter.java:183)

    at com.thoughtworks.xstream.converters.reflection.PureJavaReflectionProvider.visitSerializableFields(PureJavaReflectionProvider.java:138)

    at hudson.util.RobustReflectionConverter.doMarshal(RobustReflectionConverter.java:168)

    at hudson.util.RobustReflectionConverter.marshal(RobustReflectionConverter.java:109)

    at com.thoughtworks.xstream.core.AbstractReferenceMarshaller.convert(AbstractReferenceMarshaller.java:69)

    at com.thoughtworks.xstream.core.TreeMarshaller.convertAnother(TreeMarshaller.java:58)

    at com.thoughtworks.xstream.core.TreeMarshaller.convertAnother(TreeMarshaller.java:43)

    at com.thoughtworks.xstream.core.TreeMarshaller.start(TreeMarshaller.java:82)

    at com.thoughtworks.xstream.core.AbstractTreeMarshallingStrategy.marshal(AbstractTreeMarshallingStrategy.java:37)

    at com.thoughtworks.xstream.XStream.marshal(XStream.java:1026)

    at com.thoughtworks.xstream.XStream.marshal(XStream.java:1015)

    at com.thoughtworks.xstream.XStream.toXML(XStream.java:988)

    at hudson.XmlFile.write(XmlFile.java:178)

    at hudson.model.AbstractItem.save(AbstractItem.java:513)

    at hudson.model.Job.save(Job.java:177)

    at hudson.model.AbstractProject.save(AbstractProject.java:306)

    at hudson.model.AbstractItem.setDisplayName(AbstractItem.java:168)

    at hudson.model.Job.doConfigSubmit(Job.java:1186)

    at hudson.model.AbstractProject.doConfigSubmit(AbstractProject.java:796)

    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)

    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

    at java.lang.reflect.Method.invoke(Method.java:498)

    at org.kohsuke.stapler.Function$InstanceFunction.invoke(Function.java:298)

    at org.kohsuke.stapler.Function.bindAndInvoke(Function.java:161)

    at org.kohsuke.stapler.Function.bindAndInvokeAndServeResponse(Function.java:96)

    at org.kohsuke.stapler.MetaClass$1.doDispatch(MetaClass.java:121)

    at org.kohsuke.stapler.NameBasedDispatcher.dispatch(NameBasedDispatcher.java:53)

    at org.kohsuke.stapler.Stapler.tryInvoke(Stapler.java:746)

    ... 44 more

Caused by: java.lang.ClassNotFoundException: Failed to load class com.hp.ucmdb.protocol.schema.Protocol

    at com.hp.ucmdb.api.client.http.bootstrap.SDKClassLoader.findClass(SDKClassLoader.java:69)

    at java.lang.ClassLoader.loadClass(ClassLoader.java:424)

    at com.hp.ucmdb.api.client.http.bootstrap.SDKClassLoader.loadClass(SDKClassLoader.java:38)

    at java.lang.ClassLoader.loadClass(ClassLoader.java:357)

    ... 118 more

Caused by: java.io.IOException: Got response code 404 for URL http://c9w18498.itcs.hpecorp.net:8080/ucmdb-api/classes/com/hp/ucmdb/protocol/schema/Protocol.class

    at com.hp.ucmdb.api.client.http.bootstrap.SDKClassLoader.downloadClassByteCode(SDKClassLoader.java:119)

    at com.hp.ucmdb.api.client.http.bootstrap.SDKClassLoader.downloadClassByteCode(SDKClassLoader.java:88)

    at com.hp.ucmdb.api.client.http.bootstrap.SDKClassLoader.findClass(SDKClassLoader.java:65)

    ... 121 more

 

I’m also seeing an error on the server-side of the software: 2016-08-17 13:23:41,456  ERROR  [qtp1548928899-112733] (ApiServlet.java:126) - Denied downloading of class com/hp/ucmdb/protocol/schema/Protocol.class

 

I really want to understand what happens when I click the save button? Why is Jenkins trying to connect to the server and using the API?

 

Any help is highly appreciated. If you need further information, I’m happy to provide them.

 

Thanks and best regards

Moritz

 

Moritz Rupp

Technical Consultant
Software Services


+49 172 542 65 34  
Mobile

+49 7031 306 4178  Office
Herrenberger Strasse 140, 71034 Böblingen

morit...@hpe.com

 

HPE_logoemail

Geschäftsführer: Heiko Meyer (Vorsitzender), Thomas Bässler, Volkhard Bregulla, Michael Eberhardt,
Angelika Gifford, Ernst Reichart. Vorsitzender des Aufsichtsrats: Jörg Menno Harms
Sitz der Gesellschaft: Böblingen, Amtsgericht Stuttgart HRB 244081
WEEE-Reg.-Nr. DE 30409072

 

image001.png
Reply all
Reply to author
Forward
0 new messages