xmlscalajaxbscalaxb

scalaxb generated code causes stack overflow during compilation


I'm using scalaxb to generate Scala code from an XSD. (In particular I am using the maven scalaxb plugin.) The code generation phase runs without a hitch, and eyeballing them, the generated scala files look good. But when I try to compile I am getting a stack overflow on:

[ERROR] error: java.lang.StackOverflowError
[INFO]  at scala.tools.nsc.ast.Trees$Transformer.transform(Trees.scala:754)
[INFO]  at scala.tools.nsc.matching.MatrixAdditions$MatchMatrixOptimizer$lxtt$2$.transform(MatrixAdditions.scala:113)
[INFO]  at scala.tools.nsc.ast.Trees$Transformer.transform(Trees.scala:845)
[INFO]  at scala.tools.nsc.matching.MatrixAdditions$MatchMatrixOptimizer$lxtt$2$.transform(MatrixAdditions.scala:113)
[INFO]  at scala.tools.nsc.ast.Trees$Transformer.transform(Trees.scala:837)
[INFO]  at scala.tools.nsc.matching.MatrixAdditions$MatchMatrixOptimizer$lxtt$2$.transform(MatrixAdditions.scala:113)
[INFO]  at scala.tools.nsc.ast.Trees$Transformer.transform(Trees.scala:821)
[INFO]  at scala.tools.nsc.matching.MatrixAdditions$MatchMatrixOptimizer$lxtt$2$.transform(MatrixAdditions.scala:113)
[INFO]  at scala.tools.nsc.ast.Trees$Transformer.transform(Trees.scala:821)
[INFO]  at scala.tools.nsc.matching.MatrixAdditions$MatchMatrixOptimizer$lxtt$2$.transform(MatrixAdditions.scala:113)
[INFO]  at scala.tools.nsc.ast.Trees$Transformer.transform(Trees.scala:821)
[INFO]  at scala.tools.nsc.matching.MatrixAdditions$MatchMatrixOptimizer$lxtt$2$.transform(MatrixAdditions.scala:113)

...

[INFO]  at scala.collection.mutable.ListBuffer$$anon$1.foreach(ListBuffer.scala:311)
[INFO]  at scala.tools.nsc.Global$GlobalPhase.run(Global.scala:294)
[INFO]  at scala.tools.nsc.transform.ExplicitOuter$Phase.run(ExplicitOuter.scala:539)
[INFO]  at scala.tools.nsc.Global$Run.compileSources(Global.scala:949)
[INFO]  at scala.tools.nsc.Global$Run.compile(Global.scala:1034)
[INFO]  at scala.tools.nsc.Main$.process(Main.scala:106)
[INFO]  at scala.tools.nsc.Main$.main(Main.scala:123)
[INFO]  at scala.tools.nsc.Main.main(Main.scala)
[INFO]  ... 6 more
[INFO] ------------------------------------------------------------------------
[ERROR] BUILD ERROR
[INFO] ------------------------------------------------------------------------

The xsd I am using has been tested and works with jaxb.

Scala version is 2.9.0-1, scalaxb is 0.6.2.


Solution

  • So, according to the OP, the problem was resolved by putting -Xss2048k in the jvmArg.