Stack overflow error when generating Java code?

53 views
Skip to first unread message

Daniel Einspanjer

unread,
Jan 6, 2017, 5:05:41 PM1/6/17
to jOOQ User Group
I've been working fine with the 3.9 version for a while.  Just a little bit ago, I added a couple of new tables to my Postgres database, and then tried to regenerate, and now I'm getting a stack overflow error:

Exception in thread "main" java.lang.StackOverflowError
at org.jooq.util.AbstractDatabase.isArrayType(AbstractDatabase.java:1710)
at org.jooq.util.JavaGenerator.getType(JavaGenerator.java:5206)
at org.jooq.util.JavaGenerator.getType(JavaGenerator.java:5214)
at org.jooq.util.JavaGenerator.getType(JavaGenerator.java:5214)
at org.jooq.util.JavaGenerator.getType(JavaGenerator.java:5214)
at org.jooq.util.JavaGenerator.getType(JavaGenerator.java:5214)

I'm trying to figure out how to debug this and see what I might have done to trigger it, but any help in that regard would be greatly appreciated.

-Daniel

Daniel Einspanjer

unread,
Jan 6, 2017, 5:19:22 PM1/6/17
to jOOQ User Group
Okay, I tracked down the SQL that changed which was triggering it.  Here is the table definition.  Given the line of code in the error is about parsing an array, I'm suspecting that last column in the table.

BEGIN;

CREATE TABLE usage_current (
device_id INT UNIQUE NOT NULL DEFAULT 0,
device_key JSONB PRIMARY KEY,
observation_time TIMESTAMPTZ NOT NULL,
occupied_audio_ports INT NOT NULL,
occupied_video_ports INT NOT NULL,
data_lineage JSONB NOT NULL,
data_lineage_ids INT[] NOT NULL
);

COMMIT;

Lukas Eder

unread,
Jan 9, 2017, 9:50:21 AM1/9/17
to jooq...@googlegroups.com
Hi Daniel,

Thanks for the report and the heads up on what could be causing this. We have plenty of integration tests checking code generator support for PostgreSQL arrays, so even if the issue might be related to arrays, I cannot reproduce it yet with your table. Do you perhaps have some <forcedTypes/> and/or <userTypes/> that modify this table?

Best Regards,
Lukas

--
You received this message because you are subscribed to the Google Groups "jOOQ User Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jooq-user+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Daniel Einspanjer

unread,
Jan 9, 2017, 10:23:00 PM1/9/17
to jooq...@googlegroups.com

I am using forced types. I will be happy to try to put together a test case and share it when I get some time.

Thank you for looking.


To unsubscribe from this group and stop receiving emails from it, send an email to jooq-user+...@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to a topic in the Google Groups "jOOQ User Group" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/jooq-user/QtdD24F9v8g/unsubscribe.
To unsubscribe from this group and all its topics, send an email to jooq-user+...@googlegroups.com.

Daniel Einspanjer

unread,
Oct 8, 2017, 1:34:21 PM10/8/17
to jOOQ User Group
I've hit this stack-overflow error again, this time in 3.10.0:
org.jooq.util.JavaGenerator.getType(JavaGenerator.java:5670)

but running the generator in debug shows it seems to be on an INT[] field.

One point that I don't know if I omitted before or if at that time I wasn't doing is that I am running the PostgresDatabase to XMLDatabase generator.
Given that, I was able to create a simple test case and I've logged github issue https://github.com/jOOQ/jOOQ/issues/6646


On Monday, January 9, 2017 at 10:23:00 PM UTC-5, Daniel Einspanjer wrote:

I am using forced types. I will be happy to try to put together a test case and share it when I get some time.

Thank you for looking.


On Mon, Jan 9, 2017, 9:50 AM Lukas Eder <lukas...@gmail.com> wrote:
Hi Daniel,

Thanks for the report and the heads up on what could be causing this. We have plenty of integration tests checking code generator support for PostgreSQL arrays, so even if the issue might be related to arrays, I cannot reproduce it yet with your table. Do you perhaps have some <forcedTypes/> and/or <userTypes/> that modify this table?

Best Regards,
Lukas

2017-01-06 23:19 GMT+01:00 Daniel Einspanjer <daniel.einspanjer@designet.com>:
Okay, I tracked down the SQL that changed which was triggering it.  Here is the table definition.  Given the line of code in the error is about parsing an array, I'm suspecting that last column in the table.

BEGIN;

CREATE TABLE usage_current (
device_id INT UNIQUE NOT NULL DEFAULT 0,
device_key JSONB PRIMARY KEY,
observation_time TIMESTAMPTZ NOT NULL,
occupied_audio_ports INT NOT NULL,
occupied_video_ports INT NOT NULL,
data_lineage JSONB NOT NULL,
data_lineage_ids INT[] NOT NULL
);

COMMIT;

--
You received this message because you are subscribed to the Google Groups "jOOQ User Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jooq-user+unsubscribe@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to a topic in the Google Groups "jOOQ User Group" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/jooq-user/QtdD24F9v8g/unsubscribe.
To unsubscribe from this group and all its topics, send an email to jooq-user+unsubscribe@googlegroups.com.

Lukas Eder

unread,
Oct 9, 2017, 6:26:20 AM10/9/17
to jooq...@googlegroups.com
Hi Daniel,

Thanks for your message. I think that XMLDatabase bit was the missing piece. We'll fix this ASAP for 3.11, 3.10.1, and 3.9.7. Thanks for documenting the workarounds in #6646. The original problem you're running into is probably not the stack overflow error itself, but the fact that arrays are not exported correctly by the XMLGenerator, which I've registered as a separate issue:

Thanks,
Lukas

2017-10-08 19:34 GMT+02:00 Daniel Einspanjer <daniel.e...@designet.com>:
I've hit this stack-overflow error again, this time in 3.10.0:
org.jooq.util.JavaGenerator.getType(JavaGenerator.java:5670)

but running the generator in debug shows it seems to be on an INT[] field.

One point that I don't know if I omitted before or if at that time I wasn't doing is that I am running the PostgresDatabase to XMLDatabase generator.
Given that, I was able to create a simple test case and I've logged github issue https://github.com/jOOQ/jOOQ/issues/6646


On Monday, January 9, 2017 at 10:23:00 PM UTC-5, Daniel Einspanjer wrote:

I am using forced types. I will be happy to try to put together a test case and share it when I get some time.

Thank you for looking.


On Mon, Jan 9, 2017, 9:50 AM Lukas Eder <lukas...@gmail.com> wrote:
Hi Daniel,

Thanks for the report and the heads up on what could be causing this. We have plenty of integration tests checking code generator support for PostgreSQL arrays, so even if the issue might be related to arrays, I cannot reproduce it yet with your table. Do you perhaps have some <forcedTypes/> and/or <userTypes/> that modify this table?

Best Regards,
Lukas

Reply all
Reply to author
Forward
0 new messages