While trying to rebuild a project after reviewing changes from a team member, the compilation threw a Stack Overflow error (not the website) in the process of assembling the final JAR file.
Exception in thread "main" java.lang.StackOverflowError
at sun.nio.cs.SingleByte.withResult(SingleByte.java:44)
at sun.nio.cs.SingleByte.access$000(SingleByte.java:38)
at sun.nio.cs.SingleByte$Encoder.encodeArrayLoop(SingleByte.java:187)
at sun.nio.cs.SingleByte$Encoder.encodeLoop(SingleByte.java:219)
at java.nio.charset.CharsetEncoder.encode(CharsetEncoder.java:579)
at sun.nio.cs.StreamEncoder.implWrite(StreamEncoder.java:271)
at sun.nio.cs.StreamEncoder.write(StreamEncoder.java:125)
at java.io.OutputStreamWriter.write(OutputStreamWriter.java:207)
at java.io.BufferedWriter.flushBuffer(BufferedWriter.java:129)
at java.io.PrintStream.write(PrintStream.java:526)
at java.io.PrintStream.print(PrintStream.java:669)
at java.io.PrintStream.println(PrintStream.java:806)
at org.slf4j.impl.SimpleLogger.write(SimpleLogger.java:381)
at org.slf4j.impl.SimpleLogger.log(SimpleLogger.java:376)
at org.slf4j.impl.SimpleLogger.info(SimpleLogger.java:538)
at org.apache.maven.cli.logging.Slf4jLogger.info(Slf4jLogger.java:59)
at org.codehaus.plexus.archiver.AbstractArchiver$1.hasNext(AbstractArchiver.java:464)
at org.codehaus.plexus.archiver.AbstractArchiver$1.hasNext(AbstractArchiver.java:467)
at org.codehaus.plexus.archiver.AbstractArchiver$1.hasNext(AbstractArchiver.java:467)
Some suggestions included looking at the JRE memory heap. Another hinted at the thread stack size instead. Turns out that the latter was more correct. Naturally, setting the MAVEN_OPTS value in the System PATH variable did not help. Restarting Eclipse didn't help either.
To which, my next line of thought went towards wondering, what if the value was set into the JRE when executing the Maven build.
Here's what I did:
- Navigate to Eclipse
- Run Configurations > [Select build profile]
- JRE tab > VM arguments
- Input "-Xss2m"
- Apply and Run
No comments:
Post a Comment