Cannot load plugin gitblit

265 views
Skip to first unread message

Xav

unread,
Oct 25, 2013, 10:20:21 AM10/25/13
to repo-d...@googlegroups.com
I'm not able to load plugin gitblit on gerrit 2.6-rc3 neither gerrit 2.8. Gerrit exists with the following message:
Exception: Invalid signature file digest for Manifest main attributes

These are the steps done (http://www.slideshare.net/lucamilanesio/gitblit-plugin-for-gerrit-code-review), hoping that someone could help me.

I've downloaded & compiled the gitblit as followed
$ cd gitblit 
$ git rev-parse HEAD
=> 2a66cf4dbbedcbff9b10a4d3ca73302102ca9f8e 

To reach this status I had to update the pom file by adding:
<repository>
   <id>jgit-snapshot-repository</id>
   <snapshots>
     <enabled>true</enabled>
   </snapshots>
</repository>

Then compile 
$ mvn package
=> [INFO] Replacing original artifact with shaded artifact.
=> [INFO] Replacing /home/gerrit/gitblit/target/gitblit-plugin-2.8-SNAPSHOT.jar with /home/gerrit/gitblit/target/gitblit-plugin-2.8-SNAPSHOT-shaded.jar
=> [INFO] ------------------------------------------------------------------------
=> [INFO] BUILD SUCCESSFUL
=> [INFO] ------------------------------------------------------------------------

I've copied the war file on the gerrit plugins folder
cp ../gitblit/target/gitblit-plugin-2.8-SNAPSHOT.jar plugins/gitblit.jar

And I'm trying to update the gerrit.config file
$ java -jar gerrit-2.8-rc1.war init -d review/
[...] 
=> WARN: Cannot load and get plugin init step for /home/gerrit/review/plugins/gitblit.jar (Exception: Invalid signature file digest for Manifest main attributes)

and checking the log if trying to launch gerrit

[2013-10-24 00:15:28,612] WARN  com.google.gerrit.server.plugins.PluginLoader : Cannot load plugin gitblit
java.lang.SecurityException: Invalid signature file digest for Manifest main attributes
        at sun.security.util.SignatureFileVerifier.processImpl(SignatureFileVerifier.java:240)
        at sun.security.util.SignatureFileVerifier.process(SignatureFileVerifier.java:193)
        at java.util.jar.JarVerifier.processEntry(JarVerifier.java:305)
        at java.util.jar.JarVerifier.update(JarVerifier.java:216)
        at java.util.jar.JarFile.initializeVerifier(JarFile.java:345)
        at java.util.jar.JarFile.getInputStream(JarFile.java:412)
        at sun.misc.URLClassPath$JarLoader$2.getInputStream(URLClassPath.java:752)
        at sun.misc.Resource.cachedInputStream(Resource.java:77)
        at sun.misc.Resource.getByteBuffer(Resource.java:160)
        at java.net.URLClassLoader.defineClass(URLClassLoader.java:436)
        at java.net.URLClassLoader.access$100(URLClassLoader.java:71)
        at java.net.URLClassLoader$1.run(URLClassLoader.java:361)
        at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:423)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:356)
        at java.lang.Class.forName0(Native Method)
        at java.lang.Class.forName(Class.java:266)
        at com.google.gerrit.server.plugins.PluginLoader.load(PluginLoader.java:513)
        at com.google.gerrit.server.plugins.PluginLoader.loadPlugin(PluginLoader.java:471)
        at com.google.gerrit.server.plugins.PluginLoader.runPlugin(PluginLoader.java:359)
        at com.google.gerrit.server.plugins.PluginLoader.rescan(PluginLoader.java:343)
        at com.google.gerrit.server.plugins.PluginLoader.start(PluginLoader.java:256)
        at com.google.gerrit.lifecycle.LifecycleManager.start(LifecycleManager.java:74)
        at com.google.gerrit.pgm.Daemon.run(Daemon.java:190)
        at com.google.gerrit.pgm.util.AbstractProgram.main(AbstractProgram.java:67)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:601)
        at com.google.gerrit.launcher.GerritLauncher.invokeProgram(GerritLauncher.java:168)
        at com.google.gerrit.launcher.GerritLauncher.mainImpl(GerritLauncher.java:92)
        at com.google.gerrit.launcher.GerritLauncher.main(GerritLauncher.java:50)
        at Main.main(Main.java:25)

Does someone face the same issue?
Any idea is welcome


Bassem Rabil

unread,
Oct 29, 2013, 2:00:45 PM10/29/13
to repo-d...@googlegroups.com
It used to work for me with Gerrit 2.6.1 without any changes to pom files using the commit 1ecce49768f4001e8cc523a3ff9841e385597cae as head. Can you try reset your head to this commit and rebuild the plugin.

The configuration in gerrit.config for gitblit should look like:
[gitweb]
        type = custom
        url = plugins/
        linkname = gitblit
        project = gitblit/summary/?r=${project}
        revision = gitblit/commit/?r=${project}&h=${commit}
        branch = gitblit/log/?r=${project}&h=${branch}
        filehistory = gitblit/history/?f=${file}&r=${project}&h=${branch}

You can edit this in your current configurations before init the new war file. 

I hope this helps.

Regards
Bassem

Xav

unread,
Oct 31, 2013, 10:10:30 AM10/31/13
to repo-d...@googlegroups.com
Thanks Bassel for your help. The issue was not coming from the commit used but from an option missing in the pom file
I added the following lines for the maven-shade-plugin
          <filters>
            <filter>
              <artifact>*:*</artifact>
              <excludes>
                <exclude>META-INF/*.SF</exclude>
                <exclude>META-INF/*.DSA</exclude>
                <exclude>META-INF/*.RSA</exclude>
              </excludes>
            </filter>
          </filters>


I've also update the url for the google repo:
or 


depending on which API version you are building on.

Using the previous it is working fine for me.

Xavier
Reply all
Reply to author
Forward
0 new messages