Re: Gerrit X-Docs plugin

360 views
Skip to first unread message

Luca Milanesio

unread,
Nov 13, 2014, 5:32:18 AM11/13/14
to Kempin, Edwin, Michael Florea, repo-d...@googlegroups.com, Festività in Germania
Hi Edwin,
I'll add it this morning.

I will roll out as well the YAML configuration files for Jenkins CI build for Gerrit, so that adding new projects will be possible by submitting a YAML file to Gerrit :-)

On 13 Nov 2014, at 07:31, Kempin, Edwin <edwin....@sap.com> wrote:

> I'm wondering if there may exist a prebuilt x-docs plugin for Gerrit 2.9.1.
No, at the moment there is no prebuilt version of the x-docs plugin available.
Luca has setup a Jenkins server that builds the plugins [1], but the x-docs plugin is still missing there.
@Luca, can you add it?

> I am having some trouble building it following the instructions in build.md
This is expected. The x-docs plugin depends on quite some Gerrit core changes which are only available
in Gerrit master, which will become Gerrit 2.11. This means the x-docs plugin can neither work with
Gerrit 2.9 nor Gerrit 2.10.

Yep, will build it for Gerrit master :-)

Luca.

Edwin Kempin

unread,
Nov 13, 2014, 5:56:10 AM11/13/14
to Luca Milanesio, Kempin, Edwin, Michael Florea, repo-d...@googlegroups.com
Thanks :)
 

Luca.

--
--
To unsubscribe, email repo-discuss...@googlegroups.com
More info at http://groups.google.com/group/repo-discuss?hl=en

---
You received this message because you are subscribed to the Google Groups "Repo and Gerrit Discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to repo-discuss...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Luca Milanesio

unread,
Nov 13, 2014, 7:31:57 AM11/13/14
to Edwin Kempin, Kempin, Edwin, Michael Florea, repo-d...@googlegroups.com

Luca Milanesio

unread,
Nov 13, 2014, 8:56:25 AM11/13/14
to Edwin Kempin, Kempin, Edwin, Michael Florea, repo-d...@googlegroups.com
... but doesn't load for me :-(

[2014-11-13 13:55:12,760] WARN  com.google.gerrit.server.plugins.PluginLoader : Cannot load plugin xdocs
java.lang.NoClassDefFoundError: com/google/gerrit/httpd/resources/Resource
at com.googlesource.gerrit.plugins.xdocs.XDocLoader$Module$1.configure(XDocLoader.java:183)
at com.google.inject.AbstractModule.configure(AbstractModule.java:62)
at com.google.inject.spi.Elements$RecordingBinder.install(Elements.java:230)
at com.google.inject.AbstractModule.install(AbstractModule.java:122)
at com.googlesource.gerrit.plugins.xdocs.XDocLoader$Module.configure(XDocLoader.java:180)
at com.google.inject.AbstractModule.configure(AbstractModule.java:62)
at com.google.inject.spi.Elements$RecordingBinder.install(Elements.java:230)
at com.google.inject.AbstractModule.install(AbstractModule.java:122)
at com.googlesource.gerrit.plugins.xdocs.Module.configure(Module.java:47)
at com.google.inject.AbstractModule.configure(AbstractModule.java:62)
at com.google.inject.spi.Elements$RecordingBinder.install(Elements.java:230)
at com.google.inject.spi.Elements.getElements(Elements.java:103)
at com.google.inject.internal.InjectorShell$Builder.build(InjectorShell.java:136)
at com.google.inject.internal.InternalInjectorCreator.build(InternalInjectorCreator.java:104)
at com.google.inject.internal.InjectorImpl.createChildInjector(InjectorImpl.java:230)
at com.google.inject.internal.InjectorImpl.createChildInjector(InjectorImpl.java:237)
at com.google.gerrit.server.plugins.JarPlugin.startPlugin(JarPlugin.java:144)
at com.google.gerrit.server.plugins.JarPlugin.start(JarPlugin.java:127)
at com.google.gerrit.server.plugins.PluginLoader.runPlugin(PluginLoader.java:430)
at com.google.gerrit.server.plugins.PluginLoader.rescan(PluginLoader.java:400)
at com.google.gerrit.server.plugins.PluginLoader.start(PluginLoader.java:311)
at com.google.gerrit.lifecycle.LifecycleManager.start(LifecycleManager.java:74)
at com.google.gerrit.pgm.Daemon.start(Daemon.java:288)
at com.google.gerrit.pgm.Daemon.run(Daemon.java:200)
at com.google.gerrit.pgm.util.AbstractProgram.main(AbstractProgram.java:63)
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:606)
at com.google.gerrit.launcher.GerritLauncher.invokeProgram(GerritLauncher.java:167)
at com.google.gerrit.launcher.GerritLauncher.mainImpl(GerritLauncher.java:94)
at com.google.gerrit.launcher.GerritLauncher.main(GerritLauncher.java:51)
at Main.main(Main.java:25)
Caused by: java.lang.ClassNotFoundException: com.google.gerrit.httpd.resources.Resource
at java.net.URLClassLoader$1.run(URLClassLoader.java:366)
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:425)
at java.lang.ClassLoader.loadClass(ClassLoader.java:358)
... 33 more

Edwin Kempin

unread,
Nov 13, 2014, 9:00:53 AM11/13/14
to Luca Milanesio, Kempin, Edwin, Michael Florea, repo-d...@googlegroups.com
2014-11-13 14:56 GMT+01:00 Luca Milanesio <luca.mi...@gmail.com>:
... but doesn't load for me :-(
Have a deployed it on a Gerrit Server that is running lastest Gerrit master?

Luca Milanesio

unread,
Nov 13, 2014, 9:11:21 AM11/13/14
to Edwin Kempin, Kempin, Edwin, Michael Florea, repo-d...@googlegroups.com
I moved to the "lastest and greatest" from this morning build :-)

Now it loads correctly *BUT* when I display the list of projects, the XDoc plugin throw a NPE:
Caused by: java.lang.NullPointerException
at org.eclipse.jgit.lib.ObjectId.fromString(ObjectId.java:231)
at com.googlesource.gerrit.plugins.xdocs.XDocResourceKey.fromString(XDocResourceKey.java:106)
at com.googlesource.gerrit.plugins.xdocs.XDocLoader.load(XDocLoader.java:82)
at com.googlesource.gerrit.plugins.xdocs.XDocLoader.load(XDocLoader.java:57)
at com.google.gerrit.server.cache.h2.H2CacheImpl$Loader.load(H2CacheImpl.java:229)
at com.google.gerrit.server.cache.h2.H2CacheImpl$Loader.load(H2CacheImpl.java:209)
at com.google.common.cache.LocalCache$LoadingValueReference.loadFuture(LocalCache.java:3527)
at com.google.common.cache.LocalCache$Segment.loadSync(LocalCache.java:2319)
at com.google.common.cache.LocalCache$Segment.lockedGetOrLoad(LocalCache.java:2282)
at com.google.common.cache.LocalCache$Segment.get(LocalCache.java:2197)
... 60 more

Seems like it is looking for a null Object ID in the repo: any clue?

Luca.

Edwin Kempin

unread,
Nov 13, 2014, 9:23:04 AM11/13/14
to Luca Milanesio, Kempin, Edwin, Michael Florea, repo-d...@googlegroups.com
Did you run an old version of the plugin before?
The cache key has changed over time. Can you try clearing the cache, e.g.
  rm -rf review_site/cache/xdocs*
and then restart Gerrit?

Luca Milanesio

unread,
Nov 13, 2014, 9:24:54 AM11/13/14
to Michael Florea, repo-discuss
Done already and all config is in place :-)

I guess there is a null default for the revision, see the relevant code below:

  public static XDocResourceKey fromString(String str) {
    String[] s = str.split("/");
    String formatter = null;
    String project = null;
    String file = null;
    String revision = null;
    String metaConfigRevision = null;
    if (s.length > 0) {
      formatter = IdString.fromUrl(s[0]).get();
    }
    if (s.length > 1) {
      project = IdString.fromUrl(s[1]).get();
    }
    if (s.length > 2) {
      file = IdString.fromUrl(s[2]).get();
    }
    if (s.length > 3) {
      revision = s[3];
    }
    if (s.length > 4) {
      metaConfigRevision = s[4];
    }
    return new XDocResourceKey(formatter, new Project.NameKey(project), file,
        ObjectId.fromString(revision), ObjectId.fromString(metaConfigRevision));
  }

However I would say that the plugin builds and loads correctly ... now there are some bugs to be fixed :-)

Luca.

On 13 Nov 2014, at 14:16, Michael Florea <mfl...@amplify.com> wrote:

I had to run gerrit init at that point. Xdocs then generated it's
config. Schema updated 2 versions and it loaded.

Take care,
Michael Florea

Luca Milanesio

unread,
Nov 13, 2014, 9:27:08 AM11/13/14
to Edwin Kempin, Kempin, Edwin, Michael Florea, repo-d...@googlegroups.com
Let me try that as well again ....

Luca.

Luca Milanesio

unread,
Nov 13, 2014, 9:32:43 AM11/13/14
to Edwin Kempin, Kempin, Edwin, Michael Florea, repo-d...@googlegroups.com
I did:

./bin/gerrit.sh stop
rm -Rf cache/* tmp/* logs/*
java -jar bin/gerrit.war init --batch
java -jar bin/gerrit.war reindex
./bin/gerrit.sh start

... and then again I've got (when visiting the URL <gerrit>/#/admin/projects/

Caused by: java.lang.NullPointerException
        at org.eclipse.jgit.lib.ObjectId.fromString(ObjectId.java:231)
        at com.googlesource.gerrit.plugins.xdocs.XDocResourceKey.fromString(XDocResourceKey.java:106)
        at com.googlesource.gerrit.plugins.xdocs.XDocLoader.load(XDocLoader.java:82)
        at com.googlesource.gerrit.plugins.xdocs.XDocLoader.load(XDocLoader.java:57)
        at com.google.gerrit.server.cache.h2.H2CacheImpl$Loader.load(H2CacheImpl.java:229)
        at com.google.gerrit.server.cache.h2.H2CacheImpl$Loader.load(H2CacheImpl.java:209)
        at com.google.common.cache.LocalCache$LoadingValueReference.loadFuture(LocalCache.java:3527)
        at com.google.common.cache.LocalCache$Segment.loadSync(LocalCache.java:2319)
        at com.google.common.cache.LocalCache$Segment.lockedGetOrLoad(LocalCache.java:2282)
        at com.google.common.cache.LocalCache$Segment.get(LocalCache.java:2197)
        ... 60 more

Can you try on your side as well?

Luca.

Edwin Kempin

unread,
Nov 13, 2014, 10:06:32 AM11/13/14
to Luca Milanesio, Michael Florea, repo-d...@googlegroups.com
2014-11-13 15:32 GMT+01:00 Luca Milanesio <luca.mi...@gmail.com>:
I did:

./bin/gerrit.sh stop
rm -Rf cache/* tmp/* logs/*
java -jar bin/gerrit.war init --batch
java -jar bin/gerrit.war reindex
./bin/gerrit.sh start

... and then again I've got (when visiting the URL <gerrit>/#/admin/projects/

Caused by: java.lang.NullPointerException
        at org.eclipse.jgit.lib.ObjectId.fromString(ObjectId.java:231)
        at com.googlesource.gerrit.plugins.xdocs.XDocResourceKey.fromString(XDocResourceKey.java:106)
        at com.googlesource.gerrit.plugins.xdocs.XDocLoader.load(XDocLoader.java:82)
        at com.googlesource.gerrit.plugins.xdocs.XDocLoader.load(XDocLoader.java:57)
        at com.google.gerrit.server.cache.h2.H2CacheImpl$Loader.load(H2CacheImpl.java:229)
        at com.google.gerrit.server.cache.h2.H2CacheImpl$Loader.load(H2CacheImpl.java:209)
        at com.google.common.cache.LocalCache$LoadingValueReference.loadFuture(LocalCache.java:3527)
        at com.google.common.cache.LocalCache$Segment.loadSync(LocalCache.java:2319)
        at com.google.common.cache.LocalCache$Segment.lockedGetOrLoad(LocalCache.java:2282)
        at com.google.common.cache.LocalCache$Segment.get(LocalCache.java:2197)
        ... 60 more

Can you try on your side as well?
Sure, but I'm not getting this exception and it seems to work fine.
Do you have any project which doesn't have a refs/meta/config branch?
Looking at the code this could explain the exception.

Luca Milanesio

unread,
Nov 13, 2014, 10:16:51 AM11/13/14
to Edwin Kempin, Michael Florea, repo-d...@googlegroups.com
Rebuilding it right now with the patch you've just uploaded.

It could be that some of the project do not have yet a refs/meta/config: some have been imported from other Git repos (bare without Gerrit).
They do inherit anyway the All-Projects settings and thus they work anyway :-)

Luca.

Luca Milanesio

unread,
Nov 13, 2014, 10:23:57 AM11/13/14
to Edwin Kempin, Michael Florea, repo-d...@googlegroups.com
Getting there :-)

The previous error has disappeared but there is another NPE on:

/**
   * Returns the content of the specified file from the "<plugin-name>/" folder
   * of the ref/meta/config branch.
   *
   * @param projectName the name of the project
   * @param fileName the name of the file in the "<plugin-name>/" folder
   * @return the file content, <code>null</code> if the file doesn't exist
   */
  public String getMetaConfigFile(String projectName, String fileName) {
    try {
      Repository repo =
          repoManager.openRepository(new Project.NameKey(projectName));
      try {
        RevWalk rw = new RevWalk(repo);
        try {
          RevCommit commit = rw.parseCommit(repo.resolve(RefNames.REFS_CONFIG));
          RevTree tree = commit.getTree();
          TreeWalk tw = new TreeWalk(repo);
          try {
            tw.addTree(tree);
            tw.setRecursive(true);
            tw.setFilter(PathFilter.create(pluginName + "/" + fileName));
            if (!tw.next()) {
              return null;
            }
            ObjectId objectId = tw.getObjectId(0);
            ObjectLoader loader = repo.open(objectId);
            byte[] raw = loader.getBytes(Integer.MAX_VALUE);
            return new String(raw, UTF_8);
          } finally {
            tw.release();
          }
        } finally {
          rw.release();
        }
      } finally {
        repo.close();
      }
    } catch (IOException e) {
      return null;
    }
  }
}

Will check on all repos to find out the ones without a refs/meta/config.

Luca.

Edwin Kempin

unread,
Nov 13, 2014, 10:29:42 AM11/13/14
to Luca Milanesio, Michael Florea, repo-d...@googlegroups.com


2014-11-13 16:23 GMT+01:00 Luca Milanesio <luca.mi...@gmail.com>:
Getting there :-)
Yes, looks like we are getting closer :)
I've uploaded another patch set to handle the null case also in this place.

Luca Milanesio

unread,
Nov 13, 2014, 10:31:45 AM11/13/14
to Edwin Kempin, Michael Florea, repo-d...@googlegroups.com
Wow, great :-)

Will check again now ...

Luca.

Luca Milanesio

unread,
Nov 13, 2014, 10:37:02 AM11/13/14
to Edwin Kempin, Michael Florea, repo-d...@googlegroups.com
Bingoooo :-) works like a charm :-)
I have to say that ... I loved this plugin from the first time I saw it at the hackathon @Google in March!

Well done Edwin, good job!

The JAR (with patches) is available for those who want to use it on Gerrit 2.11-MASTER at:

Luca.

Edwin Kempin

unread,
Nov 13, 2014, 10:40:44 AM11/13/14
to Luca Milanesio, Michael Florea, repo-d...@googlegroups.com
Thanks for verifing the fix :)

Luca Milanesio

unread,
Nov 13, 2014, 10:59:06 AM11/13/14
to Edwin Kempin, Michael Florea, repo-d...@googlegroups.com
Done.
Where is the "works like a charm" button? :o)

Luca.

Ray Pelkey

unread,
May 25, 2018, 7:53:37 AM5/25/18
to Repo and Gerrit Discussion
After a 2.14.7 update, viewing jpeg files throws a server error.  any one else seeing this?

[2018-05-25 10:29:10,338] [HTTP-75327] ERROR com.google.gerrit.pgm.http.jetty.HiddenErrorHandler : Error in GET /plugins/x-docs/project/ivi%2Fmobile%2Fapps%2Fandroid-reference/rev/8ab2a742b6d6d01dc06970ffc3ceec174b6f12c2%3C-refs%2Fchanges%2F83%2F737483%2F1/mobile/src/main/res/drawable/background_above_1.jpeg?formatImage
com.google.common.util.concurrent.ExecutionError: java.lang.NoClassDefFoundError: org/eclipse/core/runtime/IProgressMonitor
        at com.google.common.cache.LocalCache$Segment.get(LocalCache.java:2216)
        at com.google.common.cache.LocalCache.get(LocalCache.java:4147)
        at com.google.common.cache.LocalCache.getOrLoad(LocalCache.java:4151)
        at com.google.common.cache.LocalCache$LocalLoadingCache.get(LocalCache.java:5140)
        at com.google.gerrit.server.cache.h2.H2CacheImpl.get(H2CacheImpl.java:127)
        at com.google.common.cache.AbstractLoadingCache.getUnchecked(AbstractLoadingCache.java:50)
        at com.googlesource.gerrit.plugins.xdocs.XDocCache.get(XDocCache.java:52)
        at com.googlesource.gerrit.plugins.xdocs.XDocServlet.service(XDocServlet.java:166)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:729)
        at com.google.inject.servlet.ServletDefinition.doServiceImpl(ServletDefinition.java:286)
        at com.google.inject.servlet.ServletDefinition.doService(ServletDefinition.java:276)
        at com.google.inject.servlet.ServletDefinition.service(ServletDefinition.java:181)
        at com.google.inject.servlet.ManagedServletPipeline.service(ManagedServletPipeline.java:91)
        at com.google.inject.servlet.ManagedFilterPipeline.dispatch(ManagedFilterPipeline.java:120)
        at com.google.inject.servlet.GuiceFilter.doFilter(GuiceFilter.java:135)
        at com.google.gerrit.httpd.plugins.HttpPluginServlet.service(HttpPluginServlet.java:248)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:729)
        at com.google.inject.servlet.ServletDefinition.doServiceImpl(ServletDefinition.java:286)
        at com.google.inject.servlet.ServletDefinition.doService(ServletDefinition.java:276)
        at com.google.inject.servlet.ServletDefinition.service(ServletDefinition.java:181)
        at com.google.inject.servlet.ManagedServletPipeline.service(ManagedServletPipeline.java:91)
        at com.google.gerrit.httpd.raw.StaticModule$PolyGerritFilter.doFilter(StaticModule.java:451)
        at com.google.gerrit.httpd.GetUserFilter.doFilter(GetUserFilter.java:75)
        at com.google.gerrit.httpd.RequireSslFilter.doFilter(RequireSslFilter.java:73)
        at com.google.gerrit.httpd.RunAsFilter.doFilter(RunAsFilter.java:111)
        at com.google.gwtexpui.server.CacheControlFilter.doFilter(CacheControlFilter.java:70)
        at com.google.gerrit.httpd.RequestMetricsFilter.doFilter(RequestMetricsFilter.java:57)
        at com.google.gerrit.httpd.AllRequestFilter$FilterProxy$1.doFilter(AllRequestFilter.java:133)
        at com.google.gerrit.httpd.AllRequestFilter$FilterProxy.doFilter(AllRequestFilter.java:135)
        at com.google.gerrit.httpd.RequestContextFilter.doFilter(RequestContextFilter.java:72)
        at com.google.inject.servlet.ManagedFilterPipeline.dispatch(ManagedFilterPipeline.java:120)
        at com.google.inject.servlet.GuiceFilter.doFilter(GuiceFilter.java:135)
        at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1759)
        at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:582)
        at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:224)
        at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1180)
        at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:512)
        at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:185)
        at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1112)
        at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:141)
        at org.eclipse.jetty.server.handler.RequestLogHandler.handle(RequestLogHandler.java:56)
        at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:134)
        at org.eclipse.jetty.server.Server.handle(Server.java:534)
        at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:320)
        at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:251)
        at org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:283)
        at org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:108)
        at org.eclipse.jetty.io.SelectChannelEndPoint$2.run(SelectChannelEndPoint.java:93)
        at org.eclipse.jetty.util.thread.strategy.ExecuteProduceConsume.executeProduceConsume(ExecuteProduceConsume.java:303)
        at org.eclipse.jetty.util.thread.strategy.ExecuteProduceConsume.produceConsume(ExecuteProduceConsume.java:148)
        at org.eclipse.jetty.util.thread.strategy.ExecuteProduceConsume.run(ExecuteProduceConsume.java:136)
        at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:671)
        at org.eclipse.jetty.util.thread.QueuedThreadPool$2.run(QueuedThreadPool.java:589)
        at java.lang.Thread.run(Thread.java:745)
Caused by: java.lang.NoClassDefFoundError: org/eclipse/core/runtime/IProgressMonitor
        at org.outerj.daisy.diff.html.HTMLDiffer.diff(HTMLDiffer.java:65)
        at org.outerj.daisy.diff.html.HTMLDiffer.diff(HTMLDiffer.java:44)
        at com.googlesource.gerrit.plugins.xdocs.XDocLoader.diffHtml(XDocLoader.java:259)
        at com.googlesource.gerrit.plugins.xdocs.XDocLoader.load(XDocLoader.java:126)
        at com.googlesource.gerrit.plugins.xdocs.XDocLoader.load(XDocLoader.java:84)
        at com.google.gerrit.server.cache.h2.H2CacheImpl$Loader.load(H2CacheImpl.java:235)
        at com.google.gerrit.server.cache.h2.H2CacheImpl$Loader.load(H2CacheImpl.java:215)
        at com.google.common.cache.LocalCache$LoadingValueReference.loadFuture(LocalCache.java:3708)
        at com.google.common.cache.LocalCache$Segment.loadSync(LocalCache.java:2416)
        at com.google.common.cache.LocalCache$Segment.lockedGetOrLoad(LocalCache.java:2299)
        at com.google.common.cache.LocalCache$Segment.get(LocalCache.java:2212)
        ... 53 more
Caused by: java.lang.ClassNotFoundException: org.eclipse.core.runtime.IProgressMonitor
        at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
        ... 64 more

David Ostrovsky

unread,
May 26, 2018, 1:44:20 AM5/26/18
to Repo and Gerrit Discussion

On Friday, May 25, 2018 at 1:53:37 PM UTC+2, Ray Pelkey wrote:
After a 2.14.7 update, viewing jpeg files throws a server error.  any one else seeing this?

[2018-05-25 10:29:10,338] [HTTP-75327] ERROR com.google.gerrit.pgm.http.jetty.HiddenErrorHandler : Error in GET /plugins/x-docs/project/ivi%2Fmobile%2Fapps%2Fandroid-reference/rev/8ab2a742b6d6d01dc06970ffc3ceec174b6f12c2%3C-refs%2Fchanges%2F83%2F737483%2F1/mobile/src/main/res/drawable/background_above_1.jpeg?formatImage
com.google.common.util.concurrent.ExecutionError: java.lang.NoClassDefFoundError: org/eclipse/core/runtime/IProgressMonitor

In fact, DaiyDiff library that is used by this plugin transitively depends on
eclipse runtime, e.g.: [1]. As the matter of fact, this transitive dependency
was always missing. I don't use this plugin, and cannot verify this fix here,
so, untested: [2].


Ray Pelkey

unread,
May 30, 2018, 6:40:55 AM5/30/18
to Repo and Gerrit Discussion
Thanks David Ostrovsky,

new plugin build did resolve the issue.

On Thursday, November 13, 2014 at 5:32:18 AM UTC-5, lucamilanesio wrote:

Sebastian Schuberth

unread,
Jun 28, 2018, 2:34:24 AM6/28/18
to Repo and Gerrit Discussion
On Saturday, May 26, 2018 at 7:44:20 AM UTC+2, David Ostrovsky wrote:

On Friday, May 25, 2018 at 1:53:37 PM UTC+2, Ray Pelkey wrote:
After a 2.14.7 update, viewing jpeg files throws a server error.  any one else seeing this?

[2018-05-25 10:29:10,338] [HTTP-75327] ERROR com.google.gerrit.pgm.http.jetty.HiddenErrorHandler : Error in GET /plugins/x-docs/project/ivi%2Fmobile%2Fapps%2Fandroid-reference/rev/8ab2a742b6d6d01dc06970ffc3ceec174b6f12c2%3C-refs%2Fchanges%2F83%2F737483%2F1/mobile/src/main/res/drawable/background_above_1.jpeg?formatImage
com.google.common.util.concurrent.ExecutionError: java.lang.NoClassDefFoundError: org/eclipse/core/runtime/IProgressMonitor

In fact, DaiyDiff library that is used by this plugin transitively depends on
eclipse runtime, e.g.: [1]. As the matter of fact, this transitive dependency
was always missing. I don't use this plugin, and cannot verify this fix here,
so, untested: [2].


Interesting, thanks for the change. Out of curiosity, could you elaborate a bit more why this is necessary? It can't be that Bazel is not able to resolve transitive dependencies automatically, or?

Regards,
Sebastian

David Ostrovsky

unread,
Jun 28, 2018, 2:53:13 AM6/28/18
to Repo and Gerrit Discussion
Bazel doesn't offer any built in feature to resolve transitive Maven dependency.
So that gerrit/plugin developers should investigate any new dependency, dump
transitive dependency tree, e.g. using:

  $ mvn dependency:tree

resolve every needed dependency and add them excplicitly to the WORKSPACE
file. There are some third party tools for Bazel that simplify this setting, but I havn't
used them: [1], [2], [3].

[1] https://github.com/bazelbuild/migration-tooling#transitive_maven_jar
[2] https://docs.bazel.build/versions/master/generate-workspace.html
[3] https://github.com/johnynek/bazel-deps

Sebastian Schuberth

unread,
Jun 28, 2018, 3:01:40 AM6/28/18
to david.o...@gmail.com, repo-d...@googlegroups.com
On Thu, Jun 28, 2018 at 8:53 AM David Ostrovsky
<david.o...@gmail.com> wrote:

> Bazel doesn't offer any built in feature to resolve transitive Maven dependency.
> So that gerrit/plugin developers should investigate any new dependency, dump
> transitive dependency tree, e.g. using:
>
> $ mvn dependency:tree
>
> resolve every needed dependency and add them excplicitly to the WORKSPACE
> file. There are some third party tools for Bazel that simplify this setting, but I havn't
> used them: [1], [2], [3].

Wow, that's... jaw-dropping. Sorry for being heretical and beating a
dead horse, but for me this sounds like such an essential missing
feature that I have a hard time understanding why Bazel was chosen to
replace Buck to build a Java project like Gerrit instead of switching
to, say, Gradle.

--
Sebastian Schuberth

David Ostrovsky

unread,
Jun 28, 2018, 4:02:53 AM6/28/18
to Repo and Gerrit Discussion

For one, Bazel team aware of that and external dependency and recursive
workspaces are the highest priority for them. For another, as you may know,
Bazel is open source version of Google's internal Blaze build tool, and
many Google's OS projects like Protobuf, gRPC, rules_closure that Gerrit
depends on, provide Bazel build tool chain that we can just re-use out of
the box. OTOH, non supporting transitive dependency has its own charm:
you must pick every single artifact on your own, and doing that you must
check the license and make sure it is compliant with your project's license
requirements. So that sometimes less magic could also be a feature and
not a bug.

Moreover Gerrit developer community has very strong Python backround.
Personally, I wouldn't be interested to write any code in Groovy.

In addition, other Gerrit ecosystem projects like JGit and Gitiles also
offer Bazel build tool chain, and developers can integrate them and
link JGit into Gerrit build to short cut build/deploy cycle, see dev-bazel
documentation for details.

Last but not least, Bazel Team is very supportive, for example they are
maintaining Gerrit CI-Build on Bazel@HEAD on 3 platforms to make sure
their changes don't break Gerrit build tool chain.

Sebastian Schuberth

unread,
Apr 23, 2019, 10:07:36 AM4/23/19
to Repo and Gerrit Discussion

On Thursday, June 28, 2018 at 8:53:13 AM UTC+2, David Ostrovsky wrote:

Bazel doesn't offer any built in feature to resolve transitive Maven dependency.
So that gerrit/plugin developers should investigate any new dependency, dump
transitive dependency tree, e.g. using:

  $ mvn dependency:tree

resolve every needed dependency and add them excplicitly to the WORKSPACE
file.

For reference, that luckily seems to have changed recently, see


Are there any plans to make use of the new "rules_jvm_external" in Gerrit?

Regards,
Sebastian

Reply all
Reply to author
Forward
0 new messages