Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NullPointerException when Database.setOnError(null) is called #10335

Closed
lukaseder opened this issue Jul 1, 2020 · 1 comment
Closed

NullPointerException when Database.setOnError(null) is called #10335

lukaseder opened this issue Jul 1, 2020 · 1 comment

Comments

@lukaseder
Copy link
Member

When Configuration.onError is null, then an unrelated NullPointerException is thrown:

12:32:36,184 [ERROR] Error while generating table X
java.lang.NullPointerException
    at org.jooq.meta.AbstractDatabase.onError (AbstractDatabase.java:2552)
    at org.jooq.meta.AbstractDatabase.getRelations (AbstractDatabase.java:2020)
    at org.jooq.meta.DefaultColumnDefinition.getPrimaryKey (DefaultColumnDefinition.java:91)
    at org.jooq.meta.AbstractTableDefinition.getPrimaryKey (AbstractTableDefinition.java:86)
    at org.jooq.codegen.JavaGenerator.generateTable (JavaGenerator.java:4297)
    at org.jooq.codegen.JavaGenerator.generateTable (JavaGenerator.java:4291)
    at org.jooq.codegen.JavaGenerator.generateTables (JavaGenerator.java:4278)
    at org.jooq.codegen.JavaGenerator.generate (JavaGenerator.java:548)
    at org.jooq.codegen.JavaGenerator.generate (JavaGenerator.java:503)
    at org.jooq.codegen.JavaGenerator.generate (JavaGenerator.java:424)
    at org.jooq.codegen.GenerationTool.run0 (GenerationTool.java:866)
    at org.jooq.codegen.GenerationTool.run (GenerationTool.java:227)
    at org.jooq.codegen.GenerationTool.generate (GenerationTool.java:222)
    at org.jooq.codegen.maven.Plugin.execute (Plugin.java:207)

We should just implement the default behaviour of OnError.FAIL

@lukaseder
Copy link
Member Author

This is unlikely to happen in client code, which doesn't call these methods explicitly, programmatically.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
No open projects
Development

No branches or pull requests

1 participant