Closed hansjoergschurr closed 9 years ago
I think this is caused by using an old version of protobuf. protobuf-java-2.5.0.jar
does not contain a ProtocolStringList.class
but protobuf-java-2.6.1.jar
does.
We have two ways of specifying the version of protobuf to use: one in third_party, and one in the Jenkins plugin's pom.xml file. If they don't match, they should be made to.
After upgrading to protobuf 2.6.1 I get the following error:
FATAL: com/google/devtools/kythe/proto/AnyOuterClass
java.lang.NoClassDefFoundError: com/google/devtools/kythe/proto/AnyOuterClass
at com.google.devtools.kythe.proto.Analysis.<clinit>(Analysis.java:9628)
at com.google.shipshape.proto.ShipshapeContextProto.<clinit>(ShipshapeContextProto.java:4411)
at com.google.shipshape.proto.ShipshapeRpcProto.<clinit>(ShipshapeRpcProto.java:6079)
at com.google.shipshape.proto.ShipshapeRpcProto$ShipshapeRequest.internalGetFieldAccessorTable(ShipshapeRpcProto.java:4368)
at com.google.protobuf.GeneratedMessage.getAllFieldsMutable(GeneratedMessage.java:107)
at com.google.protobuf.GeneratedMessage.getAllFields(GeneratedMessage.java:155)
at com.google.protobuf.TextFormat$Printer.print(TextFormat.java:298)
at com.google.protobuf.TextFormat$Printer.access$400(TextFormat.java:273)
at com.google.protobuf.TextFormat.print(TextFormat.java:76)
at com.google.protobuf.TextFormat.printToString(TextFormat.java:143)
at com.google.protobuf.AbstractMessage.toString(AbstractMessage.java:79)
at java.util.Formatter$FormatSpecifier.printString(Formatter.java:2886)
at java.util.Formatter$FormatSpecifier.print(Formatter.java:2763)
at java.util.Formatter.format(Formatter.java:2520)
at java.util.Formatter.format(Formatter.java:2455)
at java.lang.String.format(String.java:2928)
at com.google.jenkins.plugins.analysis.ShipshapeSlave.call(ShipshapeSlave.java:155)
at com.google.jenkins.plugins.analysis.ShipshapeSlave.call(ShipshapeSlave.java:47)
at hudson.FilePath.act(FilePath.java:1076)
at com.google.jenkins.plugins.analysis.AnalysisRunner.perform(AnalysisRunner.java:118)
at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:20)
at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:761)
at hudson.model.Build$BuildExecution.build(Build.java:203)
at hudson.model.Build$BuildExecution.doRun(Build.java:160)
at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:536)
at hudson.model.Run.execute(Run.java:1741)
at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
at hudson.model.ResourceController.execute(ResourceController.java:98)
at hudson.model.Executor.run(Executor.java:374)
Caused by: java.lang.ClassNotFoundException: com.google.devtools.kythe.proto.AnyOuterClass
at jenkins.util.AntClassLoader.findClassInComponents(AntClassLoader.java:1375)
at jenkins.util.AntClassLoader.findClass(AntClassLoader.java:1325)
at jenkins.util.AntClassLoader.loadClass(AntClassLoader.java:1078)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
... 29 more
The current version for protobuf in third_party
is 3.0.0-alpha-1
, so I guess it's best to update the dependency in pom.xml
to that version.
Protobuf 3.0.0-alpha-1
is not available on maven-central, but alpha-2
and alpha-3
are available.
Kythe defines its own Any message in third_party/kythe/proto/any.proto
. Is that what the ClassNotFoundException is related to?
The libany_proto_java.jar
is missing in the Maven build for the Jenkins plugin.
After adding libany_proto_java.jar
to the build I seem to get past the ClassNotFoundException
. Now I'm getting unrelated problems (docker not available in my test Jenkins).
[Shipshape] Running cmd: [docker, -H, unix:///var/run/docker.sock, pull, gcr.ioshipshape_releases/service:prod]
[Shipshape] Running command failed: Cannot run program "docker": error=2, No such file or directory
[Shipshape] Error: null
java.lang.NullPointerException
at com.google.jenkins.plugins.analysis.ShipshapeSlave.runCommand(ShipshapeSlave.java:485)
at com.google.jenkins.plugins.analysis.ShipshapeSlave.makeShippingContainerRequest(ShipshapeSlave.java:287)
at com.google.jenkins.plugins.analysis.ShipshapeSlave.call(ShipshapeSlave.java:156)
at com.google.jenkins.plugins.analysis.ShipshapeSlave.call(ShipshapeSlave.java:47)
at hudson.FilePath.act(FilePath.java:1076)
at com.google.jenkins.plugins.analysis.AnalysisRunner.perform(AnalysisRunner.java:118)
at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:20)
at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:761)
at hudson.model.Build$BuildExecution.build(Build.java:203)
at hudson.model.Build$BuildExecution.doRun(Build.java:160)
at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:536)
at hudson.model.Run.execute(Run.java:1741)
at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
at hudson.model.ResourceController.execute(ResourceController.java:98)
at hudson.model.Executor.run(Executor.java:374)
Build step 'Google Analysis Plugin' marked build as failure
Note: I'm running Jenkins in the Jenkins docker image.
Cool! I can review the patch to add the missing jar file.
I tried to build and run the Jenkins plug-in. After building and uploading the plug-in I was able to configure a build step (PRE_BUILD stage), but forcing a build results in the following error:
This seems not to be specific to my setup