Reputation: 1399
When I run or debug a unit test within NetBeans which uses the H2 database I get a StackOverflowError:
...
Caused by: java.lang.StackOverflowError
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
at sun.misc.Launcher$ExtClassLoader.findClass(Launcher.java:229)
at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
at java.lang.ClassLoader.loadClass(ClassLoader.java:295)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
at org.h2.command.Command.executeUpdate(Command.java:230)
at org.h2.command.CommandList.update(CommandList.java:44)
at org.h2.command.CommandList.executeRemaining(CommandList.java:39)
at org.h2.command.CommandList.update(CommandList.java:45)
at org.h2.command.CommandList.executeRemaining(CommandList.java:39)
at org.h2.command.CommandList.update(CommandList.java:45)
at org.h2.command.CommandList.executeRemaining(CommandList.java:39)
at org.h2.command.CommandList.update(CommandList.java:45)
at org.h2.command.CommandList.executeRemaining(CommandList.java:39)
at org.h2.command.CommandList.update(CommandList.java:45)
at org.h2.command.CommandList.executeRemaining(CommandList.java:39)
at org.h2.command.CommandList.update(CommandList.java:45)
at org.h2.command.CommandList.executeRemaining(CommandList.java:39)
at org.h2.command.CommandList.update(CommandList.java:45)
at org.h2.command.CommandList.executeRemaining(CommandList.java:39)
... etc
When I run the complete set of unit test from ant I have no problem. Also running the single unit test from IntelliJ works fine.
Help is appreciated. Please refrain from answers like "switch to IntelliJ", I'd like to keep using my favorite IDE.
Upvotes: 0
Views: 575
Reputation: 1399
Solved by increasing the stack size of the JVM. In the File->Project properties->Run I set the VM Options with -Xss to a bigger value.
Upvotes: 2