AIX build failure after switch to JDK 8


(Brian Johnson) #1

After upgrading the JDK on our AIX 6.1 box to JDK 8, Gradle builds are now failing. If I revert back to JDK 7 on the same box things work fine. Judging by the stack trace it’s happening in Gradle’s initialization, not a code compile problem. I will include all the relevant details below. Any one have any idea what’s going wrong here?

$ java -version                                                                                                                                                       java version "1.8.0"
Java(TM) SE Runtime Environment (build pap6480sr2fp10-20160108_01(SR2 FP10))
IBM J9 VM (build 2.8, JRE 1.8.0 AIX ppc64-64 Compressed References 20160106_284759 (JIT enabled, AOT enabled)
J9VM - R28_20160106_1341_B284759
JIT  - tr.r14.java_20151209_107110.02
GC   - R28_20160106_1341_B284759_CMPRSS
J9CL - 20160106_284759)
JCL - 20151231_01 based on Oracle jdk8u71-b15

$ gradle -v

------------------------------------------------------------
Gradle 2.11
------------------------------------------------------------

Build time:   2016-02-08 07:59:16 UTC
Build number: none
Revision:     584db1c7c90bdd1de1d1c4c51271c665bfcba978

Groovy:       2.4.4
Ant:          Apache Ant(TM) version 1.9.3 compiled on December 23 2013
JVM:          1.8.0 (IBM Corporation 2.8)
OS:           AIX 6.1 ppc64

$ gradle --stacktrace --debug build
11:24:18.833 [DEBUG] [org.gradle.internal.nativeintegration.services.NativeServices] Native-platform is not available.
11:24:19.118 [DEBUG] [org.gradle.internal.nativeintegration.filesystem.services.FileSystemServices] Native-platform file system integration is not available. Continuing with fallback.
11:24:19.122 [DEBUG] [org.gradle.internal.nativeintegration.filesystem.services.FileSystemServices] Using UnsupportedSymlink implementation.
11:24:19.130 [DEBUG] [org.gradle.internal.nativeintegration.filesystem.services.FileSystemServices] Using JDK 7 file service org.gradle.internal.nativeintegration.filesystem.jdk7.PosixJdk7FilePermissionHandler
11:24:19.170 [ERROR] [org.gradle.BuildExceptionReporter]
11:24:19.173 [ERROR] [org.gradle.BuildExceptionReporter] FAILURE: Build failed with an exception.
11:24:19.174 [ERROR] [org.gradle.BuildExceptionReporter]
11:24:19.178 [ERROR] [org.gradle.BuildExceptionReporter] * What went wrong:
11:24:19.179 [ERROR] [org.gradle.BuildExceptionReporter] Could not create service of type FileSystem using FileSystemServices.createFileSystem().
11:24:19.180 [ERROR] [org.gradle.BuildExceptionReporter]
11:24:19.181 [ERROR] [org.gradle.BuildExceptionReporter] * Exception is:
11:24:19.185 [ERROR] [org.gradle.BuildExceptionReporter] org.gradle.internal.service.ServiceCreationException: Could not create service of type FileSystem using FileSystemServices.createFileSystem().
11:24:19.186 [ERROR] [org.gradle.BuildExceptionReporter]        at org.gradle.internal.service.DefaultServiceRegistry$FactoryMethodService.invokeMethod(DefaultServiceRegistry.java:741)
11:24:19.187 [ERROR] [org.gradle.BuildExceptionReporter]        at org.gradle.internal.service.DefaultServiceRegistry$FactoryService.create(DefaultServiceRegistry.java:695)
11:24:19.188 [ERROR] [org.gradle.BuildExceptionReporter]        at org.gradle.internal.service.DefaultServiceRegistry$ManagedObjectProvider.getInstance(DefaultServiceRegistry.java:537)
11:24:19.190 [ERROR] [org.gradle.BuildExceptionReporter]        at org.gradle.internal.service.DefaultServiceRegistry$SingletonService.get(DefaultServiceRegistry.java:577)
11:24:19.191 [ERROR] [org.gradle.BuildExceptionReporter]        at org.gradle.internal.service.DefaultServiceRegistry.doGet(DefaultServiceRegistry.java:393)
11:24:19.192 [ERROR] [org.gradle.BuildExceptionReporter]        at org.gradle.internal.service.DefaultServiceRegistry.get(DefaultServiceRegistry.java:374)
11:24:19.193 [ERROR] [org.gradle.BuildExceptionReporter]        at org.gradle.internal.nativeintegration.services.FileSystems.getDefault(FileSystems.java:22)
11:24:19.194 [ERROR] [org.gradle.BuildExceptionReporter]        at org.gradle.api.internal.file.IdentityFileResolver.<init>(IdentityFileResolver.java:32)
11:24:19.195 [ERROR] [org.gradle.BuildExceptionReporter]        at org.gradle.launcher.daemon.configuration.DaemonParameters.<init>(DaemonParameters.java:43)
11:24:19.196 [ERROR] [org.gradle.BuildExceptionReporter]        at org.gradle.launcher.daemon.configuration.DaemonParameters.<init>(DaemonParameters.java:52)
11:24:19.197 [ERROR] [org.gradle.BuildExceptionReporter]        at org.gradle.launcher.cli.Parameters.<init>(Parameters.java:31)
11:24:19.198 [ERROR] [org.gradle.BuildExceptionReporter]        at org.gradle.launcher.cli.BuildActionsFactory.createAction(BuildActionsFactory.java:56)
11:24:19.199 [ERROR] [org.gradle.BuildExceptionReporter]        at org.gradle.launcher.cli.CommandLineActionFactory$ParseAndBuildAction.createAction(CommandLineActionFactory.java:242)
11:24:19.200 [ERROR] [org.gradle.BuildExceptionReporter]        at org.gradle.launcher.cli.CommandLineActionFactory$ParseAndBuildAction.execute(CommandLineActionFactory.java:232)
11:24:19.201 [ERROR] [org.gradle.BuildExceptionReporter]        at org.gradle.launcher.cli.CommandLineActionFactory$ParseAndBuildAction.execute(CommandLineActionFactory.java:210)
11:24:19.203 [ERROR] [org.gradle.BuildExceptionReporter]        at org.gradle.launcher.cli.JavaRuntimeValidationAction.execute(JavaRuntimeValidationAction.java:35)
11:24:19.204 [ERROR] [org.gradle.BuildExceptionReporter]        at org.gradle.launcher.cli.JavaRuntimeValidationAction.execute(JavaRuntimeValidationAction.java:24)
11:24:19.205 [ERROR] [org.gradle.BuildExceptionReporter]        at org.gradle.launcher.cli.CommandLineActionFactory$WithLogging.execute(CommandLineActionFactory.java:206)
11:24:19.206 [ERROR] [org.gradle.BuildExceptionReporter]        at org.gradle.launcher.cli.CommandLineActionFactory$WithLogging.execute(CommandLineActionFactory.java:169)
11:24:19.207 [ERROR] [org.gradle.BuildExceptionReporter]        at org.gradle.launcher.cli.ExceptionReportingAction.execute(ExceptionReportingAction.java:33)
11:24:19.208 [ERROR] [org.gradle.BuildExceptionReporter]        at org.gradle.launcher.cli.ExceptionReportingAction.execute(ExceptionReportingAction.java:22)
11:24:19.209 [ERROR] [org.gradle.BuildExceptionReporter]        at org.gradle.launcher.Main.doAction(Main.java:33)
11:24:19.210 [ERROR] [org.gradle.BuildExceptionReporter]        at org.gradle.launcher.bootstrap.EntryPoint.run(EntryPoint.java:45)
11:24:19.211 [ERROR] [org.gradle.BuildExceptionReporter]        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
11:24:19.212 [ERROR] [org.gradle.BuildExceptionReporter]        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:95)
11:24:19.213 [ERROR] [org.gradle.BuildExceptionReporter]        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:55)
11:24:19.214 [ERROR] [org.gradle.BuildExceptionReporter]        at java.lang.reflect.Method.invoke(Method.java:507)
11:24:19.215 [ERROR] [org.gradle.BuildExceptionReporter]        at org.gradle.launcher.bootstrap.ProcessBootstrap.runNoExit(ProcessBootstrap.java:54)
11:24:19.216 [ERROR] [org.gradle.BuildExceptionReporter]        at org.gradle.launcher.bootstrap.ProcessBootstrap.run(ProcessBootstrap.java:35)
11:24:19.217 [ERROR] [org.gradle.BuildExceptionReporter]        at org.gradle.launcher.GradleMain.main(GradleMain.java:23)
11:24:19.218 [ERROR] [org.gradle.BuildExceptionReporter] Caused by: java.lang.NullPointerException
11:24:19.221 [ERROR] [org.gradle.BuildExceptionReporter]        at java.security.SecureRandom.nextBytes(SecureRandom.java:471)
11:24:19.222 [ERROR] [org.gradle.BuildExceptionReporter]        at java.util.UUID.randomUUID(UUID.java:156)
11:24:19.223 [ERROR] [org.gradle.BuildExceptionReporter]        at org.gradle.internal.nativeintegration.filesystem.services.GenericFileSystem.generateUniqueContent(GenericFileSystem.java:94)
11:24:19.224 [ERROR] [org.gradle.BuildExceptionReporter]        at org.gradle.internal.nativeintegration.filesystem.services.GenericFileSystem.<init>(GenericFileSystem.java:80)
11:24:19.225 [ERROR] [org.gradle.BuildExceptionReporter]        at org.gradle.internal.nativeintegration.filesystem.services.FileSystemServices.createFileSystem(FileSystemServices.java:60)
11:24:19.226 [ERROR] [org.gradle.BuildExceptionReporter]        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
11:24:19.227 [ERROR] [org.gradle.BuildExceptionReporter]        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:95)
11:24:19.228 [ERROR] [org.gradle.BuildExceptionReporter]        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:55)
11:24:19.229 [ERROR] [org.gradle.BuildExceptionReporter]        at java.lang.reflect.Method.invoke(Method.java:507)
11:24:19.231 [ERROR] [org.gradle.BuildExceptionReporter]        at org.gradle.internal.reflect.JavaMethod.invoke(JavaMethod.java:75)
11:24:19.232 [ERROR] [org.gradle.BuildExceptionReporter]        at org.gradle.internal.service.DefaultServiceRegistry.invoke(DefaultServiceRegistry.java:426)
11:24:19.233 [ERROR] [org.gradle.BuildExceptionReporter]        at org.gradle.internal.service.DefaultServiceRegistry.access$1200(DefaultServiceRegistry.java:62)
11:24:19.234 [ERROR] [org.gradle.BuildExceptionReporter]        at org.gradle.internal.service.DefaultServiceRegistry$FactoryMethodService.invokeMethod(DefaultServiceRegistry.java:739)
11:24:19.235 [ERROR] [org.gradle.BuildExceptionReporter]        ... 29 more
11:24:19.236 [ERROR] [org.gradle.BuildExceptionReporter]

(Lari Hotari) #2

I’m not sure what the problem is. Googling the error message shows situations where java.ext.dirs has been overridden and that is causing a problem for IBM JDK. It’s worth checking that JAVA_HOME is pointing to the correct JDK and that $JAVA_HOME/jre/lib/ext/IBMSecureRandom.jar exists.


(Brian Johnson) #3

Thanks for the help Lari!

I verified that JAVA_HOME is correct, IBMSecureRandom.jar is there, and with a small test program I verified that java.ext.dirs points to $JAVA_HOME/jre/lib/ext correctly.

Any other suggestions on how I can debug this further?


(Brian Johnson) #4

Not sure if this is helpful or not but gradle build and gradle dependencies both fail, but gradle -v works.


(Lari Hotari) #5

Does it fail for any build scripts or just the build script in the project?

Could you test with a simple build.gradle, for example something like:

echo "task hello << { println 'hello' }" > build.gradle
gradle hello

What Gradle version are you using? Could you test it with the recent stable (2.11) and something older, for example 2.4?

Since the error message was originating from a failed java.util.UUID.randomUUID() call, could you test that this works for the installed JVM in a standalone Java app:

echo "public class UUIDTest { public static void main(String[] args) { System.out.println(java.util.UUID.randomUUID()); } }" > UUIDTest.java
javac UUIDTest.java
java UUIDTest

(Igor Ganapolsky) #6

I tried with gradle 2.11, and still getting the same error:

An exception has occurred in the compiler (1.8.0_73). Please file a bug at the Java Bug Database (http://bugreport.java.com/bugreport/) after checking the database for duplicates. Include your program and the following diagnostic in your report. Thank you.
com.sun.tools.javac.code.Symbol$CompletionFailure: class file for java.lang.invoke.MethodType not found
:app:compileDebugJavaWithJavac FAILED


(Brian Johnson) #7

Using your sample UUIDTest code I determined that it was a problem with my JDK/JRE installation on AIX. We were missing some security related files: java.policy,java.security, and javaws.policy that are supposed to found at $JAVA_HOME/jre/lib/security but weren’t. After getting those files put in place everything is working as expected.

Thanks for your help Lari!