Handler processing failed; nested exception is java.lang.StackOverflowError Handler processing failed; nested exception is java.lang.StackOverflowError selenium selenium

Handler processing failed; nested exception is java.lang.StackOverflowError


I spent few hours struggling with stackoverflow error ... hope this helps someone

i made a silly mistake

please see below code snippet :-

Incorrect code :-

Map abcWithKey = new HashMap<>();abcWithKey.put("key_1", abcWithKey);

Correct Code :-

Map abcWithKey = new HashMap<>();abcWithKey.put("key_1", abc);

where abc is a map , so instead of adding abc(different map) i was adding same map recursively.


Each thread in a Java application has its own stack, a place where method calls and local variables are stored. The error you mention usually happens when this stack is full, basically the current thread makes a lot of calls to certain methods (this is the happy case; another facet would be an infinite loop).

Try to run the java process with a higher stack size and see if the error happens again. This can be set using the -Xss property: -Xss4m