scalaxb with complex xsd, slows down my ide and finaly results in an StackOverflowError

37 views
Skip to first unread message

san...@sanderschouten.nl

unread,
Sep 19, 2018, 6:23:00 AM9/19/18
to scalaxb
I have used scalaxb with maven to generate the scala code from my XSD's. and used this to generate an XML, this works, but my IDE becomes very slow and hangs sometimes with a StackOverflowError.
I believe this has something to do with implicit types, then the scala compiler becomes slow.
I was hoping this would be solved by a workaround  in a newer version of scalaxb?
Because maven uses a plugin, i cannot change the scalaxb version, and it doesn't seem to use version 1.7.0 (latest).
So I tried the command, but that seems to use version 1.5.2
Finally i used the SBT way of generating the code, but than my IDE totally hangs when i try to copy the generated files into my project.

is scalacb suitable for generating classes based on a big complex XSD schema?
now i'm thinking of using 'plan B', scala-xml for generating the XML for messaging.

san...@sanderschouten.nl

unread,
Sep 19, 2018, 7:19:48 AM9/19/18
to scalaxb
When compiling in IntelliJ (same as when i compile from maven:

Information:9/19/18 1:17 PM - Compilation completed with 134 errors and 0 warnings in 1m 1s 513ms
Error:scalac: Error: org.jetbrains.jps.incremental.scala.remote.ServerException
java.lang.StackOverflowError
    at scala.tools.nsc.transform.Erasure$Eraser.adaptMember(Erasure.scala:686)
    at scala.tools.nsc.transform.Erasure$Eraser.typed1(Erasure.scala:773)
    at scala.tools.nsc.typechecker.Typers$Typer.runTyper$1(Typers.scala:5584)
    at scala.tools.nsc.typechecker.Typers$Typer.typedInternal(Typers.scala:5616)
    at scala.tools.nsc.typechecker.Typers$Typer.body$2(Typers.scala:5557)
    at scala.tools.nsc.typechecker.Typers$Typer.typed(Typers.scala:5562)
    at scala.tools.nsc.typechecker.Typers$Typer.$anonfun$typed1$38(Typers.scala:4708)
    at scala.tools.nsc.typechecker.Typers$Typer.silent(Typers.scala:698)
    at scala.tools.nsc.typechecker.Typers$Typer.normalTypedApply$1(Typers.scala:4710)
    at scala.tools.nsc.typechecker.Typers$Typer.typedApply$1(Typers.scala:4757)
    at scala.tools.nsc.typechecker.Typers$Typer.typedInAnyMode$1(Typers.scala:5530)
    at scala.tools.nsc.typechecker.Typers$Typer.typed1(Typers.scala:5547)
    at scala.tools.nsc.transform.Erasure$Eraser.typed1(Erasure.scala:773)
    at scala.tools.nsc.typechecker.Typers$Typer.runTyper$1(Typers.scala:5584)
    at scala.tools.nsc.typechecker.Typers$Typer.typedInternal(Typers.scala:5616)
    at scala.tools.nsc.typechecker.Typers$Typer.body$2(Typers.scala:5557)
    at scala.tools.nsc.typechecker.Typers$Typer.typed(Typers.scala:5562)
    at scala.tools.nsc.typechecker.Typers$Typer.typedQualifier(Typers.scala:5667)
    at scala.tools.nsc.typechecker.Typers$Typer.typedQualifier(Typers.scala:5675)
    at scala.tools.nsc.transform.Erasure$Eraser.adaptMember(Erasure.scala:698)
  ...
    ...endless

san...@sanderschouten.nl

unread,
Sep 19, 2018, 7:52:40 AM9/19/18
to scalaxb

In maven repo, the latest version of scala-maven-plugin is 1.5.0 from Oct, 2016 :(

<!-- https://mvnrepository.com/artifact/org.scalaxb/scalaxb-maven-plugin -->
<dependency>
    <groupId>org.scalaxb</groupId>
    <artifactId>scalaxb-maven-plugin</artifactId>
    <version>1.5.0</version>
</dependency>

Reply all
Reply to author
Forward
0 new messages