-
Notifications
You must be signed in to change notification settings - Fork 4.7k
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
When plugin id specified, "gradle tasks" results in java.security.InvalidKeyException: EC parameters error #2421
Comments
This works fine for me. My guess is that you have some misconfigured environment though I wouldn't be able to point you to the exact problem. |
@bmuschko Thanks for taking a look. Was that on Ubuntu 14.04? I will keep looking in my java and system config. |
@bickelj No, I tried on Mac. I doubt there's a general issue as we test resolution of plugins with the plugin DSL on Ubuntu and an Windows. It's probably an issue with your Java configuration. |
I also tried this on a second Trisquel 7 machine and a Debian 7 machine. Same issue occurs on those. |
By following instructions at https://bouncycastle.org/specifications.html under "6.0 Bouncy Castle Provider" and making BouncyCastle the number 1 provider, the issue is worked around. So this could be an issue with OpenJDK or Debian. But it would be extra nice if the TLS endpoint at plugins.gradle.org would work with openjdk 7 on these platforms out of the box, probably would be some configuration change to use something other than EC. |
FWIW, I have the same error on Travis CI (Ubuntu 14.04 (Trusty)) with OpenJDK 7, when the wrapper attempts to download the distribution from Googling a bit, I found that others have had the same error as far back as 2 months ago: https://gitlab.com/gitlab-org/gitlab-ci-multi-runner/issues/2479 (openjdk 7 too, if the ruby:2.1 docker image is the one from the Docker Hub, then it was based on Debian Jessie; in the log, you'll see that Others could download from It looks like Cloudflare would use an ECDHE cipher with Java 7, but the EC cipher suites aren't supported by default on OpenJDK 7 (at least as packaged by Debian and Ubuntu). Compare https://packages.ubuntu.com/trusty/amd64/openjdk-7-jre-headless/filelist (no |
@tbroyer Did you find any solution? |
@jameskleeh A workaround: running install:
- JAVA_HOME=$(jdk_switcher home openjdk8) ./gradlew classes testClasses And I couldn't just switch to oraclejdk7 because of travis-ci/travis-ci#7884 (which appears unlikely to ever be fixed travis-ci/travis-ci#7884 (comment)) |
Good workaround - for me, using Codeship rather than Travis, my project build setup script was:
CodeShip doesn't have openjdk8 for some reason, so primed the pump with oraclejdk8. |
I am seeing the same problem for the TestNG builds as well. https://travis-ci.org/cbeust/testng/jobs/271191856 Can someone please tell me what should be done to get this sorted out ? |
@krmahadevan There are a few workarounds, any of these should work:
|
More details can be found in this issue: gradle/gradle#2421
More details can be found in this issue: gradle/gradle#2421
Fix OpenJDK7 failures on Travis More details can be found in this issue: gradle/gradle#2421
Switch the JDK 7 build to OpenJDK travis-ci/travis-ci#7884 gradle/gradle#2421
workaround for java.security.InvalidKeyException see gradle/gradle#2421
@bickelj Do you have any resources on how to use BouncyCastle with Travis? |
@jameskleeh Sorry, I haven't used that platform. For Trisquel 7 (downstream of Ubuntu 14.04), it was a matter of
It probably would be fairly straightforward to automate, trickiest part being the sed or awk script to do step 4. |
Adds a workaround so that Gradle distribution and plugins can be downloaded again (see gradle/gradle#2421).
Continue to build artifact with opendjdk7, but run tests with openjdk8 and oraclejdk8, so we can get around issue gradle/gradle#2421
Openjdk7 broken, see gradle/gradle#2421
Oracle JDK 7 no longer available; openJDK7 is missing an EC crypto provider needed to download gradle plugins, so I just removed the 7 compiler. We could pursue workarounds but they're a bit messy, see https://github.com/uber-java/tally/blob/2cea75ecc2f896dfd5e32b94bff71f211c8bde56/ci/before_install.sh#L6-L12 and gradle/gradle#2421
For Travis there is an issue tracking this travis-ci/travis-ci#8503 . I posted a BouncyCastle JCE provider solution using a Dockerfile over there. |
We still compile with "targetCompatibility = 1.7", but don't run integration tests on Java 7 JVMs. This also takes care of gradle/gradle#2421
Travis CI has problem on these two building environments, 1. In oraclejdk7 env, './gradlew assemble' failed due to "JAVA_HOME is set to an invalid directory: /usr/lib/jvm/java-7-oracle" 2. In openjdk7 env, './gradlew assemble' failed due to "java.security.NoSuchProviderException: no such provider: SunEC". The first issue is because Trusty no longer supports Oracle Java 7, according to travis-ci/travis-ci#7884. The second issue is a problem between JVMs and Gradle Inc. servers (`services.gradle.org` and `plugins.gradle.org`), that can only be solved by JVM or server configuration changes. The first approach requires the manipulation of java security providers. The second option is unlikely to happen because it decreases security, and more importantly the servers are managed by a third party. Refer to: gradle/gradle#2421 In the gradle script we actually already force both source compatibility and target compatibility to be 1.6, which means the build will fail if the source code is not 1.6 compatible, also it guarantees the generated class files would be able to run on Java 6+. That being said, we don't really need to run the builds on JDK7 env. So this change is to decommission the two build env in Travis CI.
* Run testAll with --info and --stacktrace * Don't test on openjdk7, due to gradle/gradle#2421
Workaround for travis-ci/travis-ci#8503, gradle/gradle#2421. Solution taken from bugsnag/bugsnag-java#66.
Gradle 把 SSL 改成了什麼 EC 的東東,結果 openjdk7 不換密碼學套組的話不能用。要換的話要整 sudo 麻煩,另外考慮到 gradle 也不準備支援 java 7 了,就直接改成 java 8 看看能不能測過。 gradle/gradle#2421
…s with openjdk8
Expected Behavior
Running "gradle tasks" should successfully retrieve the plugin specified, then show the list of tasks.
Current Behavior
Running "gradle tasks" results in "FAILURE: Build failed with an exception." ... Error resolving plugin [id: ...> Could not GET 'https://plugins.gradle.org/...' ... > java.security.ProviderException: java.security.InvalidKeyException: EC parameters error
When I run --stacktrace, the root exception appears to be:
Caused by: java.security.NoSuchProviderException: no such provider: SunEC
Context
I am trying to use a plugin: id 'org.openrepose.gradle.plugins.jaxb' version '2.2.3' in a build script to run a simple example.
Steps to Reproduce (for bugs)
Create a build script with the following contents:
plugins {
id 'org.openrepose.gradle.plugins.jaxb' version '2.2.3'
}
run any gradle command, such as
gradle tasks
Your Environment
Trisquel GNU/Linux 7.0 amd64 (Similar to Ubuntu 14.04)
openjdk 7u131 amd64
Particulars
The text was updated successfully, but these errors were encountered: