Gradle fails to configure build or hangs after upgrading to IBM JDK 8.0.5.10

Hello,

My environments uses IBM JDK for building. Recently when the environments were upgraded from IBM JDK 8.0.5.5 to 8.0.5.10, various Gradle based builds started to have problems. Some are running fine, while others are failing to start the build. Also had a few cases where it’s just stuck.

Does anyone else here use IBM JDK? Have you run into this yet? The build that fails to start has this error:

* What went wrong:
A problem occurred configuring project ':sst-fixture'.
> Exception thrown while executing model rule: PublishingPlugin.Rules#publishing
   > java.lang.ExceptionInInitializerError

Running the build with stacktrace shows this:

* Exception is:
org.gradle.api.ProjectConfigurationException: A problem occurred configuring project ':sst-fixture'.
	at org.gradle.execution.TaskNameResolver.discoverTasks(TaskNameResolver.java:100)
	at org.gradle.execution.TaskNameResolver.access$100(TaskNameResolver.java:32)
	at org.gradle.execution.TaskNameResolver$MultiProjectTaskSelectionResult.collect(TaskNameResolver.java:171)
	at org.gradle.execution.TaskNameResolver$MultiProjectTaskSelectionResult.collect(TaskNameResolver.java:181)
	at org.gradle.execution.TaskNameResolver$MultiProjectTaskSelectionResult.collectTasks(TaskNameResolver.java:166)
	at org.gradle.execution.TaskNameResolver.selectWithName(TaskNameResolver.java:55)
	at org.gradle.execution.TaskSelector.getSelection(TaskSelector.java:87)
	at org.gradle.execution.TaskSelector.getSelection(TaskSelector.java:75)
	at org.gradle.execution.commandline.CommandLineTaskParser.parseTasks(CommandLineTaskParser.java:42)
	at org.gradle.execution.TaskNameResolvingBuildConfigurationAction.configure(TaskNameResolvingBuildConfigurationAction.java:44)
	at org.gradle.execution.DefaultBuildConfigurationActionExecuter.configure(DefaultBuildConfigurationActionExecuter.java:48)
	at org.gradle.execution.DefaultBuildConfigurationActionExecuter.access$000(DefaultBuildConfigurationActionExecuter.java:25)
	at org.gradle.execution.DefaultBuildConfigurationActionExecuter$1.proceed(DefaultBuildConfigurationActionExecuter.java:54)
	at org.gradle.execution.DefaultTasksBuildExecutionAction.configure(DefaultTasksBuildExecutionAction.java:44)
	at org.gradle.execution.DefaultBuildConfigurationActionExecuter.configure(DefaultBuildConfigurationActionExecuter.java:48)
	at org.gradle.execution.DefaultBuildConfigurationActionExecuter.access$000(DefaultBuildConfigurationActionExecuter.java:25)
	at org.gradle.execution.DefaultBuildConfigurationActionExecuter$1.proceed(DefaultBuildConfigurationActionExecuter.java:54)
	at org.gradle.execution.ExcludedTaskFilteringBuildConfigurationAction.configure(ExcludedTaskFilteringBuildConfigurationAction.java:47)
	at org.gradle.execution.DefaultBuildConfigurationActionExecuter.configure(DefaultBuildConfigurationActionExecuter.java:48)
	at org.gradle.execution.DefaultBuildConfigurationActionExecuter.select(DefaultBuildConfigurationActionExecuter.java:36)
	at org.gradle.initialization.DefaultGradleLauncher$3.run(DefaultGradleLauncher.java:143)
	at org.gradle.internal.Factories$1.create(Factories.java:22)
	at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:90)
	at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:52)
	at org.gradle.initialization.DefaultGradleLauncher.doBuildStages(DefaultGradleLauncher.java:140)
	at org.gradle.initialization.DefaultGradleLauncher.access$200(DefaultGradleLauncher.java:32)
	at org.gradle.initialization.DefaultGradleLauncher$1.create(DefaultGradleLauncher.java:99)
	at org.gradle.initialization.DefaultGradleLauncher$1.create(DefaultGradleLauncher.java:93)
	at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:90)
	at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:62)
	at org.gradle.initialization.DefaultGradleLauncher.doBuild(DefaultGradleLauncher.java:93)
	at org.gradle.initialization.DefaultGradleLauncher.run(DefaultGradleLauncher.java:82)
	at org.gradle.launcher.exec.InProcessBuildActionExecuter$DefaultBuildController.run(InProcessBuildActionExecuter.java:94)
	at org.gradle.tooling.internal.provider.ExecuteBuildActionRunner.run(ExecuteBuildActionRunner.java:28)
	at org.gradle.launcher.exec.ChainingBuildActionRunner.run(ChainingBuildActionRunner.java:35)
	at org.gradle.launcher.exec.InProcessBuildActionExecuter.execute(InProcessBuildActionExecuter.java:43)
	at org.gradle.launcher.exec.InProcessBuildActionExecuter.execute(InProcessBuildActionExecuter.java:28)
	at org.gradle.launcher.exec.ContinuousBuildActionExecuter.execute(ContinuousBuildActionExecuter.java:75)
	at org.gradle.launcher.exec.ContinuousBuildActionExecuter.execute(ContinuousBuildActionExecuter.java:45)
	at org.gradle.launcher.exec.DaemonUsageSuggestingBuildActionExecuter.execute(DaemonUsageSuggestingBuildActionExecuter.java:51)
	at org.gradle.launcher.exec.DaemonUsageSuggestingBuildActionExecuter.execute(DaemonUsageSuggestingBuildActionExecuter.java:28)
	at org.gradle.launcher.cli.RunBuildAction.run(RunBuildAction.java:43)
	at org.gradle.internal.Actions$RunnableActionAdapter.execute(Actions.java:170)
	at org.gradle.launcher.cli.CommandLineActionFactory$ParseAndBuildAction.execute(CommandLineActionFactory.java:237)
	at org.gradle.launcher.cli.CommandLineActionFactory$ParseAndBuildAction.execute(CommandLineActionFactory.java:210)
	at org.gradle.launcher.cli.JavaRuntimeValidationAction.execute(JavaRuntimeValidationAction.java:35)
	at org.gradle.launcher.cli.JavaRuntimeValidationAction.execute(JavaRuntimeValidationAction.java:24)
	at org.gradle.launcher.cli.CommandLineActionFactory$WithLogging.execute(CommandLineActionFactory.java:206)
	at org.gradle.launcher.cli.CommandLineActionFactory$WithLogging.execute(CommandLineActionFactory.java:169)
	at org.gradle.launcher.cli.ExceptionReportingAction.execute(ExceptionReportingAction.java:33)
	at org.gradle.launcher.cli.ExceptionReportingAction.execute(ExceptionReportingAction.java:22)
	at org.gradle.launcher.Main.doAction(Main.java:33)
	at org.gradle.launcher.bootstrap.EntryPoint.run(EntryPoint.java:45)
	at org.gradle.launcher.bootstrap.ProcessBootstrap.runNoExit(ProcessBootstrap.java:54)
	at org.gradle.launcher.bootstrap.ProcessBootstrap.run(ProcessBootstrap.java:35)
	at org.gradle.launcher.GradleMain.main(GradleMain.java:23)
	at org.gradle.wrapper.BootstrapMainStarter.start(BootstrapMainStarter.java:30)
	at org.gradle.wrapper.WrapperExecutor.execute(WrapperExecutor.java:127)
	at org.gradle.wrapper.GradleWrapperMain.main(GradleWrapperMain.java:61)
Caused by: org.gradle.model.internal.core.ModelRuleExecutionException: Exception thrown while executing model rule: PublishingPlugin.Rules#publishing
	at org.gradle.model.internal.registry.DefaultModelRegistry.fireAction(DefaultModelRegistry.java:451)
	at org.gradle.model.internal.registry.DefaultModelRegistry.access$600(DefaultModelRegistry.java:41)
	at org.gradle.model.internal.registry.DefaultModelRegistry$RunModelAction.apply(DefaultModelRegistry.java:1145)
	at org.gradle.model.internal.registry.DefaultModelRegistry.transitionTo(DefaultModelRegistry.java:351)
	at org.gradle.model.internal.registry.DefaultModelRegistry.transition(DefaultModelRegistry.java:430)
	at org.gradle.model.internal.registry.DefaultModelRegistry.atStateOrMaybeLater(DefaultModelRegistry.java:194)
	at org.gradle.model.internal.registry.DefaultModelRegistry.atStateOrLater(DefaultModelRegistry.java:181)
	at org.gradle.api.internal.tasks.DefaultTaskContainer.discoverTasks(DefaultTaskContainer.java:200)
	at org.gradle.execution.TaskNameResolver.discoverTasks(TaskNameResolver.java:98)
	... 58 more
Caused by: : java.lang.ExceptionInInitializerError
	at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:116)
	at org.gradle.api.internal.project.ant.BasicAntBuilder.nodeCompleted(BasicAntBuilder.java:78)
	at org.gradle.api.internal.project.ant.BasicAntBuilder.doInvokeMethod(BasicAntBuilder.java:93)
	at build_9mty8z53e0lgph7rw3oxfwbxq.getNextFvtIvyBuildNumber(/root/commerce-self-serve/master/build.gradle:75)
	at org.gradle.api.internal.BeanDynamicObject$GroovyObjectAdapter.invokeMethod(BeanDynamicObject.java:279)
	at org.gradle.api.internal.BeanDynamicObject.invokeMethod(BeanDynamicObject.java:130)
	at org.gradle.api.internal.ConfigureDelegate.invokeMethod(ConfigureDelegate.java:78)
	at build_9mty8z53e0lgph7rw3oxfwbxq$_run_closure5$_closure14$_closure19$_closure21.doCall(/root/commerce-self-serve/master/build.gradle:159)
	at org.gradle.api.internal.ClosureBackedAction.execute(ClosureBackedAction.java:67)
	at org.gradle.api.internal.AbstractPolymorphicDomainObjectContainer.create(AbstractPolymorphicDomainObjectContainer.java:61)
	at org.gradle.api.internal.PolymorphicDomainObjectContainerConfigureDelegate._configure(PolymorphicDomainObjectContainerConfigureDelegate.java:46)
	at org.gradle.api.internal.ConfigureDelegate.invokeMethod(ConfigureDelegate.java:73)
	at build_9mty8z53e0lgph7rw3oxfwbxq$_run_closure5$_closure14$_closure19.doCall(/root/commerce-self-serve/master/build.gradle:154)
	at org.gradle.api.internal.ClosureBackedAction.execute(ClosureBackedAction.java:67)
	at org.gradle.util.ConfigureUtil.configure(ConfigureUtil.java:130)
	at org.gradle.util.ConfigureUtil.configure(ConfigureUtil.java:91)
	at org.gradle.api.internal.AbstractNamedDomainObjectContainer.configure(AbstractNamedDomainObjectContainer.java:68)
	at org.gradle.api.internal.AbstractNamedDomainObjectContainer.configure(AbstractNamedDomainObjectContainer.java:24)
	at org.gradle.api.internal.ClosureBackedAction.execute(ClosureBackedAction.java:59)
	at org.gradle.api.publish.internal.DefaultPublishingExtension.publications(DefaultPublishingExtension.java:48)
	at org.gradle.api.publish.internal.DefaultPublishingExtension_Decorated.publications(Unknown Source)
	at build_9mty8z53e0lgph7rw3oxfwbxq$_run_closure5$_closure14.doCall(/root/commerce-self-serve/master/build.gradle:153)
	at org.gradle.api.internal.ClosureBackedAction.execute(ClosureBackedAction.java:67)
	at org.gradle.listener.ActionBroadcast.execute(ActionBroadcast.java:39)
	at org.gradle.api.internal.plugins.ExtensionsStorage$DeferredConfigurableExtensionHolder.configureNow(ExtensionsStorage.java:183)
	at org.gradle.api.internal.plugins.ExtensionsStorage$DeferredConfigurableExtensionHolder.get(ExtensionsStorage.java:162)
	at org.gradle.api.internal.plugins.ExtensionsStorage.getByType(ExtensionsStorage.java:77)
	at org.gradle.api.internal.plugins.DefaultConvention.getByType(DefaultConvention.java:116)
	at org.gradle.api.publish.plugins.PublishingPlugin$Rules.publishing(PublishingPlugin.java:79)
	at org.gradle.model.internal.method.WeaklyTypeReferencingMethod.invoke(WeaklyTypeReferencingMethod.java:98)
	at org.gradle.model.internal.inspect.DefaultModelRuleInvoker.invoke(DefaultModelRuleInvoker.java:35)
	at org.gradle.model.internal.inspect.UnmanagedModelCreationRuleExtractor$UnmanagedElementCreationAction.execute(UnmanagedModelCreationRuleExtractor.java:77)
	at org.gradle.model.internal.inspect.ModelRuleExtractor$DefaultExtractedRuleSource$2$1.execute(ModelRuleExtractor.java:419)
	at org.gradle.model.internal.registry.DefaultModelRegistry$4.run(DefaultModelRegistry.java:446)
	at org.gradle.model.internal.registry.RuleContext.run(RuleContext.java:42)
	at org.gradle.model.internal.registry.DefaultModelRegistry.fireAction(DefaultModelRegistry.java:443)
	... 66 more
Caused by: java.lang.ExceptionInInitializerError
	at com.ibm.jsse2.P.h(P.java:150)
	at com.ibm.jsse2.P.a(P.java:104)
	at com.ibm.jsse2.o$c.a(o$c.java:7)
	at com.ibm.jsse2.o.a(o.java:346)
	at com.ibm.jsse2.p.a(p.java:40)
	at com.ibm.jsse2.p.h(p.java:73)
	at com.ibm.jsse2.au.a(au.java:529)
	at com.ibm.jsse2.au.<init>(au.java:589)
	at com.ibm.jsse2.SSLSocketFactoryImpl.createSocket(SSLSocketFactoryImpl.java:6)
	at com.ibm.net.ssl.www2.protocol.https.c.createSocket(c.java:81)
	at com.ibm.net.ssl.www2.protocol.https.c.<init>(c.java:29)
	at com.ibm.net.ssl.www2.protocol.https.c.a(c.java:45)
	at com.ibm.net.ssl.www2.protocol.https.d.getNewHttpClient(d.java:39)
	at com.ibm.net.ssl.www2.protocol.https.d.connect(d.java:38)
	at com.ibm.net.ssl.www2.protocol.https.b.getResponseCode(b.java:3)
	at org.apache.ivy.util.url.BasicURLHandler.checkStatusCode(BasicURLHandler.java:131)
	at org.apache.ivy.util.url.BasicURLHandler.getURLInfo(BasicURLHandler.java:73)
	at org.apache.ivy.util.url.BasicURLHandler.getURLInfo(BasicURLHandler.java:54)
	at org.apache.ivy.util.url.URLHandlerDispatcher.getURLInfo(URLHandlerDispatcher.java:66)
	at org.apache.ivy.plugins.repository.url.URLResource.init(URLResource.java:68)
	at org.apache.ivy.plugins.repository.url.URLResource.exists(URLResource.java:84)
	at org.apache.ivy.plugins.resolver.IBiblioResolver.listRevisionsWithMavenMetadata(IBiblioResolver.java:446)
	at org.apache.ivy.plugins.resolver.IBiblioResolver.listTokenValues(IBiblioResolver.java:353)
	at org.apache.ivy.plugins.resolver.AbstractPatternsBasedResolver.resolveTokenValues(AbstractPatternsBasedResolver.java:232)
	at org.apache.ivy.plugins.resolver.AbstractPatternsBasedResolver.listTokenValues(AbstractPatternsBasedResolver.java:172)
	at org.apache.ivy.core.search.SearchEngine.listModules(SearchEngine.java:242)
	at org.apache.ivy.ant.IvyBuildNumber.doExecute(IvyBuildNumber.java:182)
	at org.apache.ivy.ant.IvyTask.execute(IvyTask.java:271)
	at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:292)
	at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
	... 101 more
Caused by: java.lang.SecurityException: Cannot set up certs for trusted CAs
	... 131 more
Caused by: java.lang.SecurityException: Cannot locate policy or framework files!
	... 131 more

I found out that one of the changes this update includes how security policy files are used.

https://www.ibm.com/support/knowledgecenter/en/SSYKE2_8.0.0/com.ibm.java.security.component.80.doc/security-component/sdkpolicyfiles.html

The other builds that hangs or fails to also contains similar error in the stack trace: Cannot locate policy or framework files.

I had contacted IBM JDK and they requested a trace with this option enabled: -Djavax.net.debug=true. So, I ran my Gradle build using this command sh gradlew clean build -Djavax.net.debug=true --debug but apparently this does not contain the information the IBM JDK team is looking for.

Am I not setting the debug option properly?

This turned out to be an issue with the RedHat package that is used for installing that particluar Java version. The package had installation bug that resulted in this issue.