I'm running
Gerrit v 3.12.0 in a docker container and I'm developing a plugin to add a new ssh command to it.
I tried installing the
plugin example-simpleSshCommand on my instance but it failed with the following error:
[2025-10-09T13:54:27.089Z] [main] WARN com.google.gerrit.server.plugins.PluginLoader : Cannot load plugin example-simpleSshCommand
com.google.inject.ProvisionException: Unable to provision, see the following errors:
1) [Guice/ErrorInjectingConstructor]: NoSuchMethodError: PluginCommandModule: method 'void <init>()' not found
at SshModule.<init>(SshModule.java:19)
while locating SshModule
Learn more:
https://github.com/google/guice/wiki/ERROR_INJECTING_CONSTRUCTOR1 error
======================
Full classname legend:
======================
PluginCommandModule: "com.google.gerrit.sshd.PluginCommandModule"
SshModule: "com.googlesource.gerrit.plugins.examples.simplesshcommand.SshModule"
========================
End of classname legend:
========================
at com.google.inject.internal.InternalProvisionException.toProvisionException(InternalProvisionException.java:251)
at com.google.inject.internal.InjectorImpl$1.get(InjectorImpl.java:1151)
at com.google.inject.internal.InjectorImpl.getInstance(InjectorImpl.java:1186)
at com.google.gerrit.server.plugins.ServerPlugin.startPlugin(ServerPlugin.java:247)
at com.google.gerrit.server.plugins.ServerPlugin.start(ServerPlugin.java:195)
at com.google.gerrit.server.plugins.PluginLoader.runPlugin(PluginLoader.java:523)
at com.google.gerrit.server.plugins.PluginLoader.rescan(PluginLoader.java:444)
at com.google.gerrit.server.plugins.PluginLoader.start(PluginLoader.java:344)
at com.google.gerrit.lifecycle.LifecycleManager.start(LifecycleManager.java:95)
at com.google.gerrit.pgm.Daemon.start(Daemon.java:415)
at com.google.gerrit.pgm.Daemon.run(Daemon.java:303)
at com.google.gerrit.pgm.util.AbstractProgram.main(AbstractProgram.java:62)
at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:103)
at java.base/java.lang.reflect.Method.invoke(Method.java:580)
at com.google.gerrit.launcher.GerritLauncher.invokeProgram(GerritLauncher.java:251)
at com.google.gerrit.launcher.GerritLauncher.mainImpl(GerritLauncher.java:147)
at com.google.gerrit.launcher.GerritLauncher.main(GerritLauncher.java:92)
at Main.main(Main.java:30)
Caused by: java.lang.NoSuchMethodError: com.google.gerrit.sshd.PluginCommandModule: method 'void <init>()' not found
at com.googlesource.gerrit.plugins.examples.simplesshcommand.SshModule.<init>(SshModule.java:19)
at com.googlesource.gerrit.plugins.examples.simplesshcommand.SshModule$$FastClassByGuice$$47cb3bc7.GUICE$TRAMPOLINE(<generated>)
at com.googlesource.gerrit.plugins.examples.simplesshcommand.SshModule$$FastClassByGuice$$47cb3bc7.apply(<generated>)
at com.google.inject.internal.DefaultConstructionProxyFactory$FastClassProxy.newInstance(DefaultConstructionProxyFactory.java:82)
at com.google.inject.internal.ConstructorInjector.provision(ConstructorInjector.java:114)
at com.google.inject.internal.ConstructorInjector.construct(ConstructorInjector.java:91)
at com.google.inject.internal.ConstructorBindingImpl$Factory.get(ConstructorBindingImpl.java:300)
at com.google.inject.internal.InjectorImpl$1.get(InjectorImpl.java:1148)
... 16 more
It looks like com.google.gerrit.sshd.PluginCommandModule has changed or is missing a no-arg constructor.