Skip to main content

Error: class java.lang.StackOverflowError

When working with a document (e.g. when inserting an item from the price list), the operation crashes with an error: java.lang.StackOverflowError

Written by Petr Pech

How the issue manifests

When working with a document (e.g., when inserting an item from a price list), the operation crashes with the following error: java.lang.StackOverflowError

What the error means

This error indicates that a method call chain became too deeply nested, resulting in a stack overflow.

This can occur, for example:

  • due to a circular reference in data (infinite processing loop)

  • due to repeated event triggering in the user interface (GUI)

  • or generally due to an uncontrolled repetition of an operation

Examples


1. Fees in the price list

The following can be observed in the log:

cz.winstrom.service.dok.impl.PoplatkyHelper.refreshPoplatkyByCenik(PoplatkyHelper.java:100)
cz.winstrom.service.dok.impl.PolDoklBLImpl.fillPolDoklCenikem(PolDoklBLImpl.java:7067)
cz.winstrom.service.dok.impl.PoplatkyHelper.refreshPoplatkyByCenik(PoplatkyHelper.java:100)
cz.winstrom.service.dok.impl.PolDoklBLImpl.fillPolDoklCenikem(PolDoklBLImpl.java:7067)
  • an item has an assigned fee

  • that fee has another fee configured

  • which refers back to the original fee

How to resolve the issue

In the price list, remove the reference to the same fee.


2. Rendering issue (GUI)

The error can also occur when working with the interface, typically when displaying a large volume of data.

The log will then show repeated calls such as:

at java.awt.AWTEventMulticaster.componentMoved
at java.awt.AWTEventMulticaster.componentResized

👉 This means that:

  • a component is being repeatedly redrawn / recalculated

  • a loop is forming in GUI events

How to resolve the issue

  • reduce the amount of displayed data (apply a filter or a shorter date range)

  • close and reopen the agenda

Did this answer your question?