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

When plugin id specified, "gradle tasks" results in java.security.InvalidKeyException: EC parameters error #2421

Closed
bickelj opened this issue Jul 8, 2017 · 18 comments
Labels

Comments

@bickelj
Copy link

bickelj commented Jul 8, 2017

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)

  1. Create a build script with the following contents:

    plugins {
    id 'org.openrepose.gradle.plugins.jaxb' version '2.2.3'
    }

  2. 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

$ gradle -v

------------------------------------------------------------
Gradle 4.0.1
------------------------------------------------------------

Build time:   2017-07-07 14:02:41 UTC
Revision:     38e5dc0f772daecca1d2681885d3d85414eb6826

Groovy:       2.4.11
Ant:          Apache Ant(TM) version 1.9.6 compiled on June 29 2015
JVM:          1.7.0_131 (Oracle Corporation 24.131-b00)
OS:           Linux 4.8.12-gnu amd64


$ dpkg -l | grep '^ii  openjdk'
ii  openjdk-7-jdk:amd64                         7u131-2.6.9-0ubuntu0.14.04.2                        amd64        OpenJDK Development Kit (JDK)
ii  openjdk-7-jre:amd64                         7u131-2.6.9-0ubuntu0.14.04.2                        amd64        OpenJDK Java runtime, using Hotspot JIT
ii  openjdk-7-jre-headless:amd64                7u131-2.6.9-0ubuntu0.14.04.2                        amd64        OpenJDK Java runtime, using Hotspot JIT (headless)


$ java -version
java version "1.7.0_131"
OpenJDK Runtime Environment (IcedTea 2.6.9) (7u131-2.6.9-0ubuntu0.14.04.2)
OpenJDK 64-Bit Server VM (build 24.131-b00, mixed mode)


$ grep SunEC /usr/lib/jvm/java-7-openjdk-amd64/jre/lib/security/java.security
security.provider.3=sun.security.ec.SunEC


$ cp /usr/lib/jvm/java-7-openjdk-amd64/jre/lib/security/local_policy.jar . && unzip local_policy.jar && cat default_local.policy && rm *policy*
Archive:  local_policy.jar
   creating: META-INF/
 extracting: META-INF/MANIFEST.MF    
  inflating: default_local.policy    
// Country-specific policy file for countries with no limits on crypto strength.
grant {
    // There is no restriction to any algorithms.
    permission javax.crypto.CryptoAllPermission; 
};


$ cat build.gradle
plugins {
    id 'org.openrepose.gradle.plugins.jaxb' version '2.2.3'
}


$ gradle tasks --stacktrace

FAILURE: Build failed with an exception.

* Where:
Build file '/home/everybody/code/java/simple-gradle/build.gradle' line: 2

* What went wrong:
Error resolving plugin [id: 'org.openrepose.gradle.plugins.jaxb', version: '2.2.3']
> Could not GET 'https://plugins.gradle.org/api/gradle/4.0.1/plugin/use/org.openrepose.gradle.plugins.jaxb/2.2.3'.
   > java.security.ProviderException: java.security.InvalidKeyException: EC parameters error

* Try:
Run with --info or --debug option to get more log output.

* Exception is:
org.gradle.api.GradleException: Error resolving plugin [id: 'org.openrepose.gradle.plugins.jaxb', version: '2.2.3']
        at org.gradle.plugin.use.internal.DefaultPluginRequestApplicator.resolveToFoundResult(DefaultPluginRequestApplicator.java:234)
        at org.gradle.plugin.use.internal.DefaultPluginRequestApplicator.access$100(DefaultPluginRequestApplicator.java:64)
        at org.gradle.plugin.use.internal.DefaultPluginRequestApplicator$1.transform(DefaultPluginRequestApplicator.java:94)
        at org.gradle.plugin.use.internal.DefaultPluginRequestApplicator$1.transform(DefaultPluginRequestApplicator.java:91)
        at org.gradle.util.CollectionUtils.collect(CollectionUtils.java:201)
        at org.gradle.util.CollectionUtils.collect(CollectionUtils.java:196)
        at org.gradle.plugin.use.internal.DefaultPluginRequestApplicator.applyPlugins(DefaultPluginRequestApplicator.java:91)
        at org.gradle.configuration.DefaultScriptPluginFactory$ScriptPluginImpl.apply(DefaultScriptPluginFactory.java:167)
        at org.gradle.configuration.BuildOperationScriptPlugin$1.run(BuildOperationScriptPlugin.java:61)
        at org.gradle.internal.progress.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:317)
        at org.gradle.internal.progress.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:309)
        at org.gradle.internal.progress.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:185)
        at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:95)
        at org.gradle.configuration.BuildOperationScriptPlugin.apply(BuildOperationScriptPlugin.java:58)
        at org.gradle.configuration.project.BuildScriptProcessor.execute(BuildScriptProcessor.java:39)
        at org.gradle.configuration.project.BuildScriptProcessor.execute(BuildScriptProcessor.java:26)
        at org.gradle.configuration.project.ConfigureActionsProjectEvaluator.evaluate(ConfigureActionsProjectEvaluator.java:34)
        at org.gradle.configuration.project.LifecycleProjectEvaluator.doConfigure(LifecycleProjectEvaluator.java:63)
        at org.gradle.configuration.project.LifecycleProjectEvaluator.access$100(LifecycleProjectEvaluator.java:33)
        at org.gradle.configuration.project.LifecycleProjectEvaluator$ConfigureProject.run(LifecycleProjectEvaluator.java:103)
        at org.gradle.internal.progress.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:317)
        at org.gradle.internal.progress.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:309)
        at org.gradle.internal.progress.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:185)
        at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:95)
        at org.gradle.configuration.project.LifecycleProjectEvaluator.evaluate(LifecycleProjectEvaluator.java:49)
        at org.gradle.api.internal.project.DefaultProject.evaluate(DefaultProject.java:654)
        at org.gradle.api.internal.project.DefaultProject.evaluate(DefaultProject.java:132)
        at org.gradle.execution.TaskPathProjectEvaluator.configure(TaskPathProjectEvaluator.java:35)
        at org.gradle.execution.TaskPathProjectEvaluator.configureHierarchy(TaskPathProjectEvaluator.java:60)
        at org.gradle.configuration.DefaultBuildConfigurer.configure(DefaultBuildConfigurer.java:38)
        at org.gradle.initialization.DefaultGradleLauncher$ConfigureBuild.run(DefaultGradleLauncher.java:195)
        at org.gradle.internal.progress.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:317)
        at org.gradle.internal.progress.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:309)
        at org.gradle.internal.progress.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:185)
        at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:95)
        at org.gradle.initialization.DefaultGradleLauncher.doBuildStages(DefaultGradleLauncher.java:157)
        at org.gradle.initialization.DefaultGradleLauncher.access$200(DefaultGradleLauncher.java:44)
        at org.gradle.initialization.DefaultGradleLauncher$1.run(DefaultGradleLauncher.java:122)
        at org.gradle.internal.work.DefaultWorkerLeaseService$2.execute(DefaultWorkerLeaseService.java:124)
        at org.gradle.initialization.DefaultGradleLauncher.doBuild(DefaultGradleLauncher.java:116)
        at org.gradle.initialization.DefaultGradleLauncher.run(DefaultGradleLauncher.java:99)
        at org.gradle.launcher.exec.GradleBuildController.run(GradleBuildController.java:66)
        at org.gradle.tooling.internal.provider.ExecuteBuildActionRunner.run(ExecuteBuildActionRunner.java:28)
        at org.gradle.launcher.exec.ChainingBuildActionRunner.run(ChainingBuildActionRunner.java:35)
        at org.gradle.tooling.internal.provider.ValidatingBuildActionRunner.run(ValidatingBuildActionRunner.java:32)
        at org.gradle.launcher.exec.RunAsBuildOperationBuildActionRunner$1.run(RunAsBuildOperationBuildActionRunner.java:43)
        at org.gradle.internal.progress.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:317)
        at org.gradle.internal.progress.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:309)
        at org.gradle.internal.progress.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:185)
        at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:95)
        at org.gradle.launcher.exec.RunAsBuildOperationBuildActionRunner.run(RunAsBuildOperationBuildActionRunner.java:40)
        at org.gradle.tooling.internal.provider.SubscribableBuildActionRunner.run(SubscribableBuildActionRunner.java:51)
        at org.gradle.launcher.exec.InProcessBuildActionExecuter.execute(InProcessBuildActionExecuter.java:44)
        at org.gradle.launcher.exec.InProcessBuildActionExecuter.execute(InProcessBuildActionExecuter.java:28)
        at org.gradle.tooling.internal.provider.ContinuousBuildActionExecuter.execute(ContinuousBuildActionExecuter.java:75)
        at org.gradle.tooling.internal.provider.ContinuousBuildActionExecuter.execute(ContinuousBuildActionExecuter.java:49)
        at org.gradle.tooling.internal.provider.ServicesSetupBuildActionExecuter.execute(ServicesSetupBuildActionExecuter.java:51)
        at org.gradle.tooling.internal.provider.ServicesSetupBuildActionExecuter.execute(ServicesSetupBuildActionExecuter.java:32)
        at org.gradle.tooling.internal.provider.GradleThreadBuildActionExecuter.execute(GradleThreadBuildActionExecuter.java:36)
        at org.gradle.tooling.internal.provider.GradleThreadBuildActionExecuter.execute(GradleThreadBuildActionExecuter.java:25)
        at org.gradle.tooling.internal.provider.StartParamsValidatingActionExecuter.execute(StartParamsValidatingActionExecuter.java:64)
        at org.gradle.tooling.internal.provider.StartParamsValidatingActionExecuter.execute(StartParamsValidatingActionExecuter.java:29)
        at org.gradle.tooling.internal.provider.SessionFailureReportingActionExecuter.execute(SessionFailureReportingActionExecuter.java:55)
        at org.gradle.tooling.internal.provider.SessionFailureReportingActionExecuter.execute(SessionFailureReportingActionExecuter.java:42)
        at org.gradle.tooling.internal.provider.SetupLoggingActionExecuter.execute(SetupLoggingActionExecuter.java:50)
        at org.gradle.tooling.internal.provider.SetupLoggingActionExecuter.execute(SetupLoggingActionExecuter.java:30)
        at org.gradle.launcher.daemon.server.exec.ExecuteBuild.doBuild(ExecuteBuild.java:67)
        at org.gradle.launcher.daemon.server.exec.BuildCommandOnly.execute(BuildCommandOnly.java:36)
        at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:120)
        at org.gradle.launcher.daemon.server.exec.WatchForDisconnection.execute(WatchForDisconnection.java:37)
        at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:120)
        at org.gradle.launcher.daemon.server.exec.ResetDeprecationLogger.execute(ResetDeprecationLogger.java:26)
        at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:120)
        at org.gradle.launcher.daemon.server.exec.RequestStopIfSingleUsedDaemon.execute(RequestStopIfSingleUsedDaemon.java:34)
        at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:120)
        at org.gradle.launcher.daemon.server.exec.ForwardClientInput$2.call(ForwardClientInput.java:74)
        at org.gradle.launcher.daemon.server.exec.ForwardClientInput$2.call(ForwardClientInput.java:72)
        at org.gradle.util.Swapper.swap(Swapper.java:38)
        at org.gradle.launcher.daemon.server.exec.ForwardClientInput.execute(ForwardClientInput.java:72)
        at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:120)
        at org.gradle.launcher.daemon.server.exec.LogAndCheckHealth.execute(LogAndCheckHealth.java:55)
        at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:120)
        at org.gradle.launcher.daemon.server.exec.LogToClient.doBuild(LogToClient.java:62)
        at org.gradle.launcher.daemon.server.exec.BuildCommandOnly.execute(BuildCommandOnly.java:36)
        at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:120)
        at org.gradle.launcher.daemon.server.exec.EstablishBuildEnvironment.doBuild(EstablishBuildEnvironment.java:72)
        at org.gradle.launcher.daemon.server.exec.BuildCommandOnly.execute(BuildCommandOnly.java:36)
        at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:120)
        at org.gradle.launcher.daemon.server.exec.StartBuildOrRespondWithBusy$1.run(StartBuildOrRespondWithBusy.java:50)
        at org.gradle.launcher.daemon.server.DaemonStateCoordinator$1.run(DaemonStateCoordinator.java:297)
        at org.gradle.internal.concurrent.ExecutorPolicy$CatchAndRecordFailures.onExecute(ExecutorPolicy.java:63)
        at org.gradle.internal.concurrent.StoppableExecutorImpl$1.run(StoppableExecutorImpl.java:46)
        at org.gradle.internal.concurrent.ThreadFactoryImpl$ManagedThreadRunnable.run(ThreadFactoryImpl.java:55)
Caused by: org.gradle.internal.resource.transport.http.HttpRequestException: Could not GET 'https://plugins.gradle.org/api/gradle/4.0.1/plugin/use/org.openrepose.gradle.plugins.jaxb/2.2.3'.
        at org.gradle.internal.resource.transport.http.HttpClientHelper.performRequest(HttpClientHelper.java:89)
        at org.gradle.internal.resource.transport.http.HttpClientHelper.performRawGet(HttpClientHelper.java:73)
        at org.gradle.internal.resource.transport.http.HttpResourceAccessor.getRawResource(HttpResourceAccessor.java:58)
        at org.gradle.plugin.use.resolve.service.internal.HttpPluginResolutionServiceClient.request(HttpPluginResolutionServiceClient.java:86)
        at org.gradle.plugin.use.resolve.service.internal.HttpPluginResolutionServiceClient.queryPluginMetadata(HttpPluginResolutionServiceClient.java:66)
        at org.gradle.plugin.use.resolve.service.internal.PersistentCachingPluginResolutionServiceClient$1.create(PersistentCachingPluginResolutionServiceClient.java:60)
        at org.gradle.plugin.use.resolve.service.internal.PersistentCachingPluginResolutionServiceClient$1.create(PersistentCachingPluginResolutionServiceClient.java:58)
        at org.gradle.plugin.use.resolve.service.internal.PersistentCachingPluginResolutionServiceClient.fetch(PersistentCachingPluginResolutionServiceClient.java:110)
        at org.gradle.plugin.use.resolve.service.internal.PersistentCachingPluginResolutionServiceClient.maybeFetch(PersistentCachingPluginResolutionServiceClient.java:103)
        at org.gradle.plugin.use.resolve.service.internal.PersistentCachingPluginResolutionServiceClient.maybeFetch(PersistentCachingPluginResolutionServiceClient.java:91)
        at org.gradle.plugin.use.resolve.service.internal.PersistentCachingPluginResolutionServiceClient.queryPluginMetadata(PersistentCachingPluginResolutionServiceClient.java:67)
        at org.gradle.plugin.use.resolve.service.internal.InMemoryCachingPluginResolutionServiceClient$1.create(InMemoryCachingPluginResolutionServiceClient.java:47)
        at org.gradle.plugin.use.resolve.service.internal.InMemoryCachingPluginResolutionServiceClient$1.create(InMemoryCachingPluginResolutionServiceClient.java:45)
        at org.gradle.plugin.use.resolve.service.internal.InMemoryCachingPluginResolutionServiceClient.getResponse(InMemoryCachingPluginResolutionServiceClient.java:76)
        at org.gradle.plugin.use.resolve.service.internal.InMemoryCachingPluginResolutionServiceClient.queryPluginMetadata(InMemoryCachingPluginResolutionServiceClient.java:42)
        at org.gradle.plugin.use.resolve.service.internal.DeprecationListeningPluginResolutionServiceClient.queryPluginMetadata(DeprecationListeningPluginResolutionServiceClient.java:48)
        at org.gradle.plugin.use.resolve.service.internal.PluginResolutionServiceResolver.resolve(PluginResolutionServiceResolver.java:94)
        at org.gradle.plugin.use.resolve.internal.CompositePluginResolver.resolve(CompositePluginResolver.java:33)
        at org.gradle.plugin.use.resolve.internal.NotNonCorePluginOnClasspathCheckPluginResolver.resolve(NotNonCorePluginOnClasspathCheckPluginResolver.java:42)
        at org.gradle.plugin.use.internal.DefaultPluginRequestApplicator.resolveToFoundResult(DefaultPluginRequestApplicator.java:232)
        ... 92 more
Caused by: javax.net.ssl.SSLException: java.security.ProviderException: java.security.InvalidKeyException: EC parameters error
        at org.apache.http.conn.ssl.SSLConnectionSocketFactory.createLayeredSocket(SSLConnectionSocketFactory.java:394)
        at org.apache.http.conn.ssl.SSLConnectionSocketFactory.connectSocket(SSLConnectionSocketFactory.java:353)
        at org.apache.http.impl.conn.DefaultHttpClientConnectionOperator.connect(DefaultHttpClientConnectionOperator.java:134)
        at org.apache.http.impl.conn.PoolingHttpClientConnectionManager.connect(PoolingHttpClientConnectionManager.java:353)
        at org.apache.http.impl.execchain.MainClientExec.establishRoute(MainClientExec.java:380)
        at org.apache.http.impl.execchain.MainClientExec.execute(MainClientExec.java:236)
        at org.apache.http.impl.execchain.ProtocolExec.execute(ProtocolExec.java:184)
        at org.apache.http.impl.execchain.RetryExec.execute(RetryExec.java:88)
        at org.apache.http.impl.execchain.RedirectExec.execute(RedirectExec.java:110)
        at org.apache.http.impl.client.InternalHttpClient.doExecute(InternalHttpClient.java:184)
        at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:82)
        at org.gradle.internal.resource.transport.http.HttpClientHelper.performHttpRequest(HttpClientHelper.java:133)
        at org.gradle.internal.resource.transport.http.HttpClientHelper.performHttpRequest(HttpClientHelper.java:119)
        at org.gradle.internal.resource.transport.http.HttpClientHelper.executeGetOrHead(HttpClientHelper.java:96)
        at org.gradle.internal.resource.transport.http.HttpClientHelper.performRequest(HttpClientHelper.java:87)
        ... 111 more
Caused by: java.security.ProviderException: java.security.InvalidKeyException: EC parameters error
        ... 126 more
Caused by: java.security.InvalidKeyException: EC parameters error
        ... 126 more
Caused by: java.security.NoSuchProviderException: no such provider: SunEC
        ... 126 more


BUILD FAILED in 1s
@bmuschko
Copy link
Contributor

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.

@bickelj
Copy link
Author

bickelj commented Jul 11, 2017

@bmuschko Thanks for taking a look. Was that on Ubuntu 14.04?

I will keep looking in my java and system config.

@bmuschko
Copy link
Contributor

@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.

@bickelj
Copy link
Author

bickelj commented Jul 15, 2017

I also tried this on a second Trisquel 7 machine and a Debian 7 machine. Same issue occurs on those.

@bickelj
Copy link
Author

bickelj commented Jul 15, 2017

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.

@tbroyer
Copy link
Contributor

tbroyer commented Aug 1, 2017

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 services.gradle.org: https://travis-ci.org/tbroyer/gradle-apt-plugin/jobs/259570018

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 wget has no issue retrieving the distribution, but then the Gradle wrapper fails when trying to do the same)

Others could download from services.gradle.org 14 days ago (!) but the build then failed to resolve plugins from plugins.gradle.org: travis-ci/travis-ci#8109 (Ubuntu 12.04 (Precise), openjdk7; different error though, could possibly be due to Gradle version? or Precise vs Trusty?)

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 libsunec.so or sunec.jar) vs https://packages.ubuntu.com/xenial/amd64/openjdk-8-jre-headless/filelist (the openjdk8 used by Travis actually comes from https://launchpad.net/~openjdk-r/+archive/ubuntu/ppa, but I suppose it contains SunEC).

@jameskleeh
Copy link

@tbroyer Did you find any solution?

jameskleeh added a commit to grails/grails-core that referenced this issue Aug 3, 2017
@tbroyer
Copy link
Contributor

tbroyer commented Aug 3, 2017

@jameskleeh A workaround: running ./gradlew classes testClasses with openjdk8 prior to the actual build.

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))

@rtyley
Copy link

rtyley commented Aug 21, 2017

A workaround: running ./gradlew classes testClasses with openjdk8 prior to the actual build.

Good workaround - for me, using Codeship rather than Travis, my project build setup script was:

jdk_switcher home oraclejdk8
jdk_switcher use oraclejdk8
export GRADLE_VERSION=3.4.1
\curl -sSL https://raw.githubusercontent.com/codeship/scripts/master/packages/gradle.sh | bash -s
gradle classes testClasses
jdk_switcher home openjdk7
jdk_switcher use openjdk7

CodeShip doesn't have openjdk8 for some reason, so primed the pump with oraclejdk8.

@krmahadevan
Copy link

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 ?

@bickelj
Copy link
Author

bickelj commented Sep 2, 2017

@krmahadevan There are a few workarounds, any of these should work:

  • Use OpenJDK 8
  • Use BouncyCastle as a security provider prioritized over stock OpenJDK 7 providers (see https://bouncycastle.org/specifications.html)
  • Theoretically one could set up a proxy to gradle.org, exposing RSA cryptography instead of elliptic curve cryptography (probably overkill)
  • Wait for gradle.org to change the TLS settings on their site (unlikely, sounds like they use an edge provider, so may not be in their control)

krmahadevan added a commit to krmahadevan/testng that referenced this issue Sep 3, 2017
More details can be found in this issue:

gradle/gradle#2421
krmahadevan added a commit to krmahadevan/testng that referenced this issue Sep 3, 2017
More details can be found in this issue:

gradle/gradle#2421
yidongnan added a commit to grpc-ecosystem/grpc-spring that referenced this issue Sep 4, 2017
Fix OpenJDK7 failures on Travis
More details can be found in this issue:

gradle/gradle#2421
yidongnan added a commit to grpc-ecosystem/grpc-spring that referenced this issue Sep 4, 2017
psibre added a commit to psibre/marytts that referenced this issue Sep 5, 2017
psibre added a commit to psibre/marytts that referenced this issue Sep 5, 2017
workaround for java.security.InvalidKeyException
see gradle/gradle#2421
@jameskleeh
Copy link

@bickelj Do you have any resources on how to use BouncyCastle with Travis?

@bickelj
Copy link
Author

bickelj commented Sep 6, 2017

@jameskleeh Sorry, I haven't used that platform.

For Trisquel 7 (downstream of Ubuntu 14.04), it was a matter of

  1. Download and verify the latest bouncycastle provider from https://bouncycastle.org/latest_releases.html
  2. sudo cp bcprov-[version].jar /usr/lib/jvm/java-7-openjdk-amd64/jre/lib/ext
  3. Edit /etc/java-7-openjdk/security/java.security to have the following line: security.provider.1=org.bouncycastle.jce.provider.BouncyCastleProvider
  4. Edit /etc/java-7-openjdk/security/java.security to renumber all the other security.provider lines, bumping 1 to 2, 2 to 3, etc.

It probably would be fairly straightforward to automate, trickiest part being the sed or awk script to do step 4.

alvarosanchez added a commit to grails/grails-doc that referenced this issue Oct 17, 2017
tangiel added a commit to cloudendpoints/endpoints-java that referenced this issue Oct 17, 2017
sherter added a commit to sherter/google-java-format-gradle-plugin that referenced this issue Oct 18, 2017
Adds a workaround so that Gradle distribution and plugins can be
downloaded again (see gradle/gradle#2421).
sherter added a commit to sherter/google-java-format-gradle-plugin that referenced this issue Oct 18, 2017
Continue to build artifact with opendjdk7, but run tests with openjdk8
and oraclejdk8, so we can get around issue
gradle/gradle#2421
sherter added a commit to sherter/google-java-format-gradle-plugin that referenced this issue Oct 18, 2017
sherter added a commit to sherter/google-java-format-gradle-plugin that referenced this issue Oct 18, 2017
tangiel added a commit to cloudendpoints/endpoints-java that referenced this issue Oct 20, 2017
kazoni added a commit to kazoni/java-http-client that referenced this issue Oct 24, 2017
pforhan added a commit to pforhan/phrase that referenced this issue Oct 24, 2017
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
@javabrett
Copy link
Contributor

javabrett commented Oct 27, 2017

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.

sherter added a commit to sherter/google-java-format-gradle-plugin that referenced this issue Oct 28, 2017
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
jedichenbin pushed a commit to AusRegistry/ari-toolkit that referenced this issue Nov 19, 2017
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.
cwardgar added a commit to Unidata/gretty that referenced this issue Dec 1, 2017
* Run testAll with --info and --stacktrace
* Don't test on openjdk7, due to gradle/gradle#2421
holzingk pushed a commit to i2p/i2p.i2p that referenced this issue Dec 2, 2017
mattmoss pushed a commit to gpc/grails-excel-import that referenced this issue Dec 14, 2017
Artoria2e5 added a commit to sih4sing5hong5/han3_ji7_tsoo1_kian3 that referenced this issue Dec 28, 2017
Gradle 把 SSL 改成了什麼 EC 的東東,結果 openjdk7 不換密碼學套組的話不能用。要換的話要整 sudo 麻煩,另外考慮到 gradle 也不準備支援 java 7 了,就直接改成 java 8 看看能不能測過。

gradle/gradle#2421
psibre added a commit to psibre/marytts-voicebuilding that referenced this issue Jan 24, 2018
psibre added a commit to psibre/marytts-lexicon-pl that referenced this issue Feb 5, 2018
puneetbehl added a commit to grails-plugins/grails-spring-batch that referenced this issue Oct 5, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

10 participants