Alexander Kleinhans
Alexander Kleinhans

Reputation: 6258

Groovy NullPointerException on "gradle appRun"

I am trying to run the plain Java Auth0 starter which is a gradle app started with ./gradlew clean appRun.

I'm receiving the error which is certainly groovy related:

Exception in thread "main" java.lang.NullPointerException: Cannot invoke method getText() on null object
        at org.codehaus.groovy.runtime.NullObject.invokeMethod(NullObject.java:91)
        at org.codehaus.groovy.runtime.callsite.PogoMetaClassSite.call(PogoMetaClassSite.java:48)
        at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:48)
        at org.codehaus.groovy.runtime.callsite.NullCallSite.call(NullCallSite.java:35)
        at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:48)

Before this I've received the warnings:

WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by org.codehaus.groovy.reflection.CachedClass (file:/Users/xijinping/.gradle/caches/modules-2/files-2.1/org.codehaus.groovy/groovy/2.4.11/52a60df8b4cbfe39469171a42ca77a3e4eb4e737/groovy-2.4.11.jar) to method java.lang.Object.finalize()
WARNING: Please consider reporting this to the maintainers of org.codehaus.groovy.reflection.CachedClass
WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
WARNING: All illegal access operations will be denied in a future release

I'm running Java 13:

$ java --version
openjdk 13 2019-09-17
OpenJDK Runtime Environment (build 13+33)
OpenJDK 64-Bit Server VM (build 13+33, mixed mode, sharing)
$ javac --version
javac 13

I'm not sure if this is a bug on my side or something to do with gradle.

Upvotes: 1

Views: 437

Answers (1)

Thomas K.
Thomas K.

Reputation: 6780

I'm running Java 13

Well, that's the problem. The quickstart build with Gradle 3.3 (see gradle-wrapper.properties on GitHub). Java 13 support has been added to Gradle with the 6.0 release (Gradle 6.0 Release Notes).

The quickstart samples are intended to be run with Java 8.

Upvotes: 2

Related Questions