Skip to content
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

Don't load in last jenkins server #12

Open
Asgoret opened this issue Jun 25, 2020 · 17 comments
Open

Don't load in last jenkins server #12

Asgoret opened this issue Jun 25, 2020 · 17 comments

Comments

@Asgoret
Copy link

Asgoret commented Jun 25, 2020

Hi! After the last update module doesn't load in the last jenkins docker image based on Centos latest.
Java version:

openjdk version "1.8.0_252"
OpenJDK Runtime Environment (build 1.8.0_252-b09)
OpenJDK 64-Bit Server VM (build 25.252-b09, mixed mode)

Is there any way to fix it?

UPD#1: Jenkins doesn't support java 14.
Documentation: https://www.jenkins.io/doc/administration/requirements/java/
Error:


SEVERE: Running with Java class version 58 which is not in the list of supported versions: [52, 55]. Run with the --enable-future-java flag to enable such behavior. See https://jenkins.io/redirect/java-support/
--
  | java.lang.UnsupportedClassVersionError: 58.0
  | at Main.verifyJavaVersion(Main.java:174)
  | at Main.main(Main.java:142)
  |  
  | Jenkins requires Java versions [8, 11] but you are running with Java 14 from /usr/lib/jvm/java-14-openjdk-14.0.1.7-2.rolling.el8.x86_64
  | java.lang.UnsupportedClassVersionError: 58.0
  | at Main.verifyJavaVersion(Main.java:174)
  | at Main.main(Main.java:142)

UPD#2: Plugin error:

java.io.IOException: Failed to load: Outbound WebHook for build events (0.3.0)
 - Java (14) or higher required

cc @tylerlong @jamiewastin @jc21

@Asgoret Asgoret closed this as completed Jun 25, 2020
@Asgoret Asgoret reopened this Jun 25, 2020
@antonystevens20
Copy link

@Asgoret if you install JDK 14 and follow the instructions for "Run with the --enable-future-java flag" per the instructions, Jenkins does run. It appears this plugin won't run otherwise.

@tsunamaru
Copy link

A quick and dirty solution is to downgrade dependencies.

diff --git a/build.gradle b/build.gradle
index 67c07bf..2b42e5f 100644
--- a/build.gradle
+++ b/build.gradle
@@ -4,7 +4,7 @@ plugins {
 }
 
 group 'org.jenkins-ci.plugins'
-version '0.3.0'
+version '0.3.1'
 description 'Outbound WebHook for Jenkins build events'
 
 jenkinsPlugin {
@@ -30,6 +30,6 @@ repositories {
 }
 
 dependencies {
-    compile 'com.alibaba:fastjson:1.2.71'
-    compile 'com.squareup.okhttp3:okhttp:4.7.2'
+    compile 'com.alibaba:fastjson:1.2.34'
+    compile 'com.squareup.okhttp3:okhttp:3.8.1'
 }

Although it's worked for me, I didn't test it much, so use at your own peril.

@marianobenes
Copy link

Im having the same issue, is there any way to redownload an old version of the plugin?

@Asgoret
Copy link
Author

Asgoret commented Jul 13, 2020

Im having the same issue, is there any way to redownload an old version of the plugin?

Use unsupported javas via --enable-future-java flag. We simply move from this plugin. Jenkins stability is a more high priority.

@tsunamaru
Copy link

@marianobenes you can download previous versions from releases page. Alternatively, you can use latest version with my patch above. Compile it by yourself or download my precompiled .xpi
Then simply go to Manage Plugins > Advanced > Upload plugin and click on downloaded .xpi

@Asgoret

Use unsupported javas via --enable-future-java flag

Very bad idea!

@Asgoret
Copy link
Author

Asgoret commented Jul 13, 2020

@marianobenes you can download previous versions from releases page. Alternatively, you can use latest version with my patch above. Compile it by yourself or download my precompiled .xpi
Then simply go to Manage Plugins > Advanced > Upload plugin and click on downloaded .xpi

@Asgoret

Use unsupported javas via --enable-future-java flag

Very bad idea!

Well... not my ;D

@antonystevens20
Copy link

Hey, don't blame me. That's literally the only way to get this plugin working on the latest code revision.

In other words, don't run this in production.

@Asgoret
Copy link
Author

Asgoret commented Jul 14, 2020

Hey, don't blame me. That's literally the only way to get this plugin working on the latest code revision.

In other words, don't run this in production.

Not blaming anyone. Sorry if I offend you. As a workaround it's fine.

@vwbusguy
Copy link

Is Java 14 a hard dependency? Is the plugin really not compatible with 8+ or was it just compiled with Java 14 without backward compatibility enabled in the compiler?

@vwbusguy
Copy link

It looks like ./gradlew build works with Java 8, so there doesn't appear to be a good reason for the hard Java 14 requirement. It looks like it just needs to be rebuilt and republished with backward compatibility or with jdk8.

@vwbusguy
Copy link

vwbusguy commented Aug 19, 2020

Here's the workaround. From a machine with jdk8 installed (check by running java -version - you may need to change your alternatives if you have jdk8 installed and there's a different version reported):

  • Clone this repo
  • Run ./gradlew build
  • In Jenkins go to Manage Jenkins-> Manage Plugins-> Advanced-> Upload plugin
  • Upload the build/libs/outbound-webhook.hpi file
  • Restart Jenkins when it finishes installing

It should now be loaded successfully:
image

@Asgoret
Copy link
Author

Asgoret commented Aug 24, 2020

Here's the workaround. From a machine with jdk8 installed (check by running java -version - you may need to change your alternatives if you have jdk8 installed and there's a different version reported):

  • Clone this repo
  • Run ./gradlew build
  • In Jenkins go to Manage Jenkins-> Manage Plugins-> Advanced-> Upload plugin
  • Upload the build/libs/outbound-webhook.hpi file
  • Restart Jenkins when it finishes installing

It should now be loaded successfully:
image

This workaroun breaks jenkins casc installations when you specify jenkins plugins via plugins installer and added several manual steps.

@vwbusguy
Copy link

That very well may be, but the plugin as it is is broken for all Jenkins installations on a supported Java version. If the author would recompile this with a supported JDK compatibility and release a new version, it would work for everyone.

@sidyhe
Copy link

sidyhe commented Sep 17, 2020

the latest docker image jenkins:lts was with java8, the plugin cannot work.

@karololszacki
Copy link

I forked this repo since its on MIT LICENSE, available here: https://github.com/karololszacki/outbound-webhook-plugin

I also compiled my changes with java8, I used steps by @vwbusguy and uploaded the hpi here:
https://github.com/karololszacki/outbound-webhook-plugin/releases/tag/0.3.1

@gheine
Copy link

gheine commented May 5, 2021

Can we get an official release of @karololszacki's fix please so that we can use this plugin with the docker version of jenkins again?

@d4rky-pl
Copy link

@tylerlong any chance you could take a look? This plugin is not actively maintained (I'm guessing since it's more or less feature-complete) but it would be nice if this problem could be solved.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

9 participants