我正在测试将JOOQ从3.9升级到3.11.2。它在编译时失败,并在Maven中抛出以下错误跟踪:
Error running jOOQ code generation tool: Error generating code for catalog: Error generating code for schema XXX: NullPointerException
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.jooq.pro:jooq-codegen-maven:3.11.2:generate (default) on project xxx_xxx: Error running jOOQ code generation tool
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:213)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:154)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:146)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:117)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:81)
at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build(SingleThreadedBuilder.java:51)
at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:128)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:309)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:194)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:107)
at org.apache.maven.cli.MavenCli.execute(MavenCli.java:993)
at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:345)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:191)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:289)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:229)
at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:415)
at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:356)
Caused by: org.apache.maven.plugin.MojoExecutionException: Error running jOOQ code generation tool
at org.jooq.codegen.maven.Plugin.execute(Plugin.java:198)
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:134)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:208)
... 20 more
Caused by: org.jooq.codegen.GeneratorException: Error generating code for catalog
at org.jooq.codegen.JavaGenerator.generate(JavaGenerator.java:385)
at org.jooq.codegen.GenerationTool.run(GenerationTool.java:750)
at org.jooq.codegen.GenerationTool.generate(GenerationTool.java:220)
at org.jooq.codegen.maven.Plugin.execute(Plugin.java:195)
... 22 more
Caused by: org.jooq.codegen.GeneratorException: Error generating code for schema XXX
at org.jooq.codegen.JavaGenerator.generate(JavaGenerator.java:463)
at org.jooq.codegen.JavaGenerator.generate(JavaGenerator.java:380)
... 25 more
Caused by: java.lang.NullPointerException
at org.jooq.meta.DefaultIndexColumnDefinition.<init>(DefaultIndexColumnDefinition.java:54)
at org.jooq.meta.oracle.OracleIndexDefinition.getIndexColumns0(OracleIndexDefinition.java:85)
at org.jooq.meta.AbstractIndexDefinition.getIndexColumns(AbstractIndexDefinition.java:91)
at org.jooq.codegen.JavaGenerator.printIndex(JavaGenerator.java:965)
at org.jooq.codegen.JavaGenerator.generateIndexes(JavaGenerator.java:930)
at org.jooq.codegen.JavaGenerator.generate(JavaGenerator.java:524)
at org.jooq.codegen.JavaGenerator.generate(JavaGenerator.java:458)
... 26 more
我更改了maven配置中某些元素的软件包名称。模式(XXX)的名称为大写,这是配置:
<generator>
<name>org.jooq.codegen.JavaGenerator</name>
<strategy>
<name>org.jooq.codegen.DefaultGeneratorStrategy</name>
</strategy>
<database>
<name>org.jooq.meta.oracle.OracleDatabase</name>
<includes>
Tables and procedures...
</includes>
<includeExcludeColumns>true</includeExcludeColumns>
<inputSchema>XXX</inputSchema>
<forcedTypes>
<forcedType>
<name>VARCHAR2</name>
<types>NUMBER</types>
</forcedType>
<forcedType>
<name>VARCHAR2</name>
<types>DATE</types>
</forcedType>
</forcedTypes>
</database>
<generate>
<relations>true</relations>
<daos>false</daos>
<pojos>true</pojos>
<records>true</records>
<globalObjectReferences>true</globalObjectReferences>
<fluentSetters>false</fluentSetters>
</generate>
<target>
<packageName>com.model</packageName>
<directory>src/main/java</directory>
</target>
</generator>
有人可以帮我吗?
预先感谢
答案 0 :(得分:0)
这绝对是一个错误: https://github.com/jOOQ/jOOQ/issues/7824
它与先前将jOOQ引入索引的错误类似:https://github.com/jOOQ/jOOQ/issues/6620
似乎Oracle集成仍然受到影响。您可以放心地忽略堆栈跟踪,因为它不会对代码生成产生任何影响,也可以使用以下命令关闭索引信息的生成:
<generator>
...
<database>
...
<includeIndexes>false</includeIndexes>
</database>
...
</generator>