Hi there
I have an Eclipse Gradle project that uses jOOQ to generate source from a schema.
I get a Null pointer exception when Eclipse tries to build (F5) my Java project.
The Gradle build is successful and the jOOQ source is successfully built and added to the classpath.
It is the Java build of some of the jOOQ generated code that is the problem I believe:
The full error is as follows:
eclipse.buildId=4.7.3.M20180330-0640
java.version=10.0.1
java.vendor=Oracle Corporation
BootLoader constants: OS=win32, ARCH=x86_64, WS=win32, NL=en_US
Framework arguments: -product org.eclipse.epp.package.java.product -product org.eclipse.epp.package.java.product
Command-line arguments: -os win32 -ws win32 -arch x86_64 -product org.eclipse.epp.package.java.product -data file:/C:/Users/Martin/eclipse-workspace/ -product org.eclipse.epp.package.java.product
org.eclipse.jdt.core
Error
Fri May 11 12:28:15 BST 2018
Errors running builder 'Java Builder' on project 'JooqTest'.
java.lang.NullPointerException
at org.eclipse.jdt.internal.compiler.problem.ProblemHandler.handle(ProblemHandler.java:145)
at org.eclipse.jdt.internal.compiler.problem.ProblemHandler.handle(ProblemHandler.java:226)
at org.eclipse.jdt.internal.compiler.problem.ProblemReporter.handle(ProblemReporter.java:2513)
at org.eclipse.jdt.internal.compiler.problem.ProblemReporter.deprecatedType(ProblemReporter.java:1831)
at org.eclipse.jdt.internal.compiler.problem.ProblemReporter.deprecatedType(ProblemReporter.java:1808)
at org.eclipse.jdt.internal.compiler.lookup.CompilationUnitScope.checkAndRecordImportBinding(CompilationUnitScope.java:960)
at org.eclipse.jdt.internal.compiler.lookup.CompilationUnitScope.faultInImports(CompilationUnitScope.java:471)
at org.eclipse.jdt.internal.compiler.lookup.CompilationUnitScope.faultInTypes(CompilationUnitScope.java:501)
at org.eclipse.jdt.internal.compiler.Compiler.process(Compiler.java:878)
at org.eclipse.jdt.internal.compiler.ProcessTaskManager.run(ProcessTaskManager.java:141)
at java.base/java.lang.Thread.run(Thread.java:844)
My gradle.build files is as follows:
plugins {
id "nu.studer.jooq" version "2.0.11"
}
task wrapper(type: Wrapper) {
gradleVersion = '4.7'
}
ext {
jooqVersion = "3.10.6"
postgresVersion = "42.2.2"
}
apply plugin: 'java'
apply plugin: 'nu.studer.jooq'
sourceCompatibility = 1.10
targetCompatibility = 1.10
repositories {
jcenter()
mavenCentral()
}
dependencies {
compile group: 'com.fasterxml.jackson.core', name: 'jackson-databind', version: '2.9.5'
compile group: 'com.fasterxml.jackson.core', name: 'jackson-core', version: '2.9.5'
compile "org.postgresql:postgresql:$postgresVersion"
compile "org.jooq.trial:jooq:$jooqVersion"
compile "com.sun.activation:javax.activation:1.2.0"
jooqRuntime "org.postgresql:postgresql:$postgresVersion"
jooqRuntime "com.sun.activation:javax.activation:1.2.0"
jooqRuntime "org.glassfish.jaxb:jaxb-runtime:2.2.11"
}
jooq {
version = '3.10.6' // Resolve using $jooqVersion
edition = 'OSS'
railyard(sourceSets.main) {
jdbc {
driver = "org.postgresql.Driver"
user = "ry"
password = "ry"
}
generator {
name = "org.jooq.util.DefaultGenerator"
strategy {
name = "org.jooq.util.DefaultGeneratorStrategy"
}
database {
name = "org.jooq.util.postgres.PostgresDatabase"
inputSchema = "public"
}
generate {
relations = true
deprecated = false
records = true
immutablePojos = true
fluentSetters = true
}
target {
packageName = "railyard.db"
}
}
}
}
and my gradle.properties file is as follows:
org.gradle.jvmargs=--add-modules java.xml.bind
Any solutions for this?
Best,
Martin