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

New error during generation with PostgresDatabase to XMLDatabase generator in 3.10.0 #6645

Closed
deinspanjer opened this issue Oct 7, 2017 · 2 comments

Comments

@deinspanjer
Copy link

Expected behavior and actual behavior:

Expect to be able to use the maven plugin to generate from a Postgres database same as in 3.9
Actual behavior the following error is shown during generation:

[ERROR] Error while fetching indexes
java.lang.NullPointerException
	at org.jooq.util.DefaultIndexColumnDefinition.<init>(DefaultIndexColumnDefinition.java:54)
	at org.jooq.util.postgres.PostgresDatabase$1.<init>(PostgresDatabase.java:199)
	at org.jooq.util.postgres.PostgresDatabase.getIndexes0(PostgresDatabase.java:186)
	at org.jooq.util.AbstractDatabase.getIndexes(AbstractDatabase.java:1722)
	at org.jooq.util.XMLGenerator.generate(XMLGenerator.java:140)
        ...

Steps to reproduce the problem:

Run the maven plugin with a database specified in the jdbc url and an inputCatalog configured in the generator:

<configuration>
  <!--<logging>DEBUG</logging>-->
  <jdbc>
    <driver>org.postgresql.Driver</driver>
    <url>jdbc:postgresql://localhost:5432/mydb</url>
    <user>${jooq-codegen.user}</user>
    <password>${jooq-codegen.password}</password>
  </jdbc>
  <generator>
    <database>
      <name>org.jooq.util.postgres.PostgresDatabase</name>
      <!-- comment out this element for 3.10.0 compatibility -->
      <!--<inputCatalog>mydb</inputCatalog>-->
      <outputCatalog>myoutputdb</outputCatalog>
      <inputSchema>myschema</inputSchema>
      <includes>.*</includes>
    </database>
  </generator>
</configuration>

In 3.9.2 and earlier, this generates fine, it reads all the objects in the "myschema" schema of the "mydb" database.
In 3.10.0, if index generation is not turned off with the <includeIndexes>false</includeIndexes> configuration element, the above error will be displayed. It appears that the XMLDatabase is still generated okay despite it though.

Versions:

  • jOOQ: 3.10.0
  • Java: 8
  • Database (include vendor): Postgres 9.6.2
  • JDBC Driver (include name if inofficial driver): official
@lukaseder
Copy link
Member

Thanks for your report. This has already been fixed: #6620

@lukaseder
Copy link
Member

The fix for this issue has now been released in 3.10.1

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

No branches or pull requests

2 participants