-
Notifications
You must be signed in to change notification settings - Fork 669
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Init failure on Gerrit plugin #1413
Comments
What Java version is this running on? This sounds like a problem that comes up with moving to Java 9 or higher. From Java 9 on some classes were not part of the JVE anymore and need to be included as an explicit dependency. That is why the dependency to |
Java 11. I have this dependency. |
ping? |
I would love to help, but I don't build the plugin or run a Gerrit instance. So I don't know how else to help. From experience and from the error message, it is a missing dependency that is not present in your server's runtime class path. I cannot think of anything else but to make sure that the java.activation JAR is preset in the class path that is used for the server. |
Were you able to get more debug information or other information? Like check if the JAR is present at runtime? |
I have a simple way to reproduce, if it helps. This is a jar I built with the change linked above, and latest gerrit 3.5: gitblit.zip. Rename it to jar, then run:
This is the output I'm getting:
|
How did you manage to build it? I tried to build the plugin, but it complains about downloading wicket-extensions from maven central. Edit:
|
Do you have all the submodules checked out? Run |
I take you build this on Linux? Because I am getting nowhere with macOS. |
Well, as expected the resulting gitblit.jar plugin does not contain the javax.activation classes. Anyhow, if I add below patch, it builds and runs in Gerrit. Well, it starts. I have no idea how to see if it actually works then. diff --git a/BUILD b/BUILD
index 2593ebd..91d3db3 100644
--- a/BUILD
+++ b/BUILD
@@ -22,6 +22,7 @@ gerrit_plugin(
"@groovy//jar",
"@httpcore//jar:neverlink",
"@ivy//jar",
+ "@javax-activation//jar",
"@jdom//jar",
"@libpam4j//jar",
"@lucene-core//jar:neverlink",
diff --git a/external_plugin_deps.bzl b/external_plugin_deps.bzl
index cc73bca..86800b8 100644
--- a/external_plugin_deps.bzl
+++ b/external_plugin_deps.bzl
@@ -106,6 +106,12 @@ def external_plugin_deps():
sha1 = '08210b4af6f055ada934753facd27d7abf9d01a8',
)
+ maven_jar(
+ name = 'javax-activation',
+ artifact = 'com.sun.activation:javax.activation:1.2.0',
+ sha1 = 'bf744c1e2776ed1de3c55c8dac1057ec331ef744',
+ )
+
maven_jar(
name = 'ivy',
artifact = 'org.apache.ivy:ivy:2.2.0', |
While we are at it, is there a way for Gitblit to know that it runs as a Gerrit plugin? |
@flaix Thanks for the hint. Looks better, but it now fails with another error:
|
In order to build, you need to replace cd plugins
ln -sf gitblit/external_plugin_deps.bzl .
cd ..
bazel build plugins/gitblit |
Yeah, I did that according to the Readme, but I could not get it compiled on macOS. The build didn't like the clang C compiler. So I switched to a Linux VM. |
I guess now come the hard problems as we have reached the realms of class loaders. How can one put some repositories in the container to see that? |
Here is a new build for 3.7: gitblit.zip Rename gitblit.war, use this docker-compose.yml and run version: '3'
services:
gerrit:
image: gerritcodereview/gerrit:3.7.0
ports:
- "8070:8080"
volumes:
- ./gitblit.jar:/var/gerrit/plugins/gitblit.jar
- gerrit-etc:/var/gerrit/etc
- gerrit-git:/var/gerrit/git
- gerrit-db:/var/gerrit/db
- gerrit-index:/var/gerrit/index
- gerrit-cache:/var/gerrit/cache
environment:
- CANONICAL_WEB_URL=http://localhost:8070
volumes:
gerrit-etc:
gerrit-git:
gerrit-db:
gerrit-index:
gerrit-cache: There are 2 repositories that are created automatically, All-Projects and All-Users. You can reproduce the issue just by opening http://your-server:8080/plugins/gitblit/repositories/ I pushed my latest changes here: https://github.com/orgads/gerrit-gitblit-plugin, on branch master. Switched back to building gitblit from source, and using MAVEN_LOCAL. |
I have to say I'm really confused about orgads/gerrit-gitblit-plugin@d0357a6#diff-7065071696a179130d4c9022da41d3b5ca979899627876119e6c88e2573a6a25R140. How come 2 calls to the same function ( |
@lucamilanesio @paladox @davido Maybe you'll have ideas regarding #1413 (comment)? |
When I run with your docker compose file, I don't get the error about class loaders you pasted. But I do get the class cast exception. |
I'm trying to revive the gitblit plugin for Gerrit 3.5. I built it successfully, but when I'm trying to load it, I get the following exception:
I tried replacing
NotificationManager
contents withNoopNotificationManager
, and it worked, so I guess it's something in the class implementation.The text was updated successfully, but these errors were encountered: