mysema/querydsl — Issue #91: too many scala files to compile
Author: khoran
Created: 2012-01-29 21:05:18+00:00
State: open

I have a large, old database with many schemas (>20) and many un-documented dependencies between them. Therefore I need to generate scala code for all of them as I don't know what will be used and what won't. With Beans off, this generates around 2200 scala files which compiles perfectly. But if I turn beans on, it generated 5437 files (in one directory ) and that fails to compile, with an error from the compiler, not the code being compiled. See below for the error. I don't know what the root cause of this is, but I wondered if the code generation mechanism could be modified to create a separate directory for each schema. Then no one directory would have too many files. I don't know if its the number of files per directory, or just the total number of files that is breaking it though. I tried issuing separate export commands, putting each schema in is own directory and package, but then dependencies between schemas break because needed classes from other schemas are not imported properly. I'm open to any ideas about how to get this to compile. Thanks.

[INFO] Scanning for projects...
[INFO] ------------------------------------------------------------------------
[INFO] Building Web Services Project
[INFO] task-segment: [compile]
[INFO] ------------------------------------------------------------------------
[INFO] [resources:resources {execution: default-resources}]
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 1 resource
[INFO] [resources:copy-resources {execution: default-copy-resources}]
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 0 resource
[INFO] [yuicompressor:compress {execution: default}]
[INFO] nb warnings: 0, nb errors: 0
[INFO] snapshot com.mysema.querydsl:querydsl-apt:2.3.0.BUILD-SNAPSHOT: checking for updates from defancea
[WARNING] repository metadata for: 'snapshot com.mysema.querydsl:querydsl-apt:2.3.0.BUILD-SNAPSHOT' could not be retrieved from repository: defancea due to an error: Authorization failed: Access denied to: http://defrancea-mvn-dep.goo
[INFO] Repository 'defancea' will be blacklisted
[INFO] [compiler:compile {execution: default-compile}]
[INFO] Nothing to compile - all classes are up to date
[INFO] [scala:compile {execution: default}]
[INFO] Checking for multiple versions of scala
[INFO] includes = [**/*.scala,**/*.java,]
[INFO] excludes = []
[INFO] /home/khoran/development/web_services/src/main/scala:-1: info: compiling
[INFO] Compiling 5437 source files to /home/khoran/development/web_services/target/classes at 1327869844590
[ERROR] error: java.lang.StackOverflowError
[INFO] at scala.tools.nsc.symtab.Scopes$Scope.enterInHash(Scopes.scala:143)
[INFO] at scala.tools.nsc.symtab.Scopes$Scope.enterInHash(Scopes.scala:144)
[INFO] at scala.tools.nsc.symtab.Scopes$Scope.enterInHash(Scopes.scala:144)
- 1000 lines ommitted
INFO] at scala.tools.nsc.symtab.Scopes$Scope.enterInHash(Scopes.scala:144)
[INFO] at scala.tools.nsc.symtab.Scopes$Scope.enterInHash(Scopes.scala:144)
[INFO] at scala.tools.nsc.symtab.Scopes$Scope.enterInHash(Scopes.scala:144)
[INFO] at scala.tools.nsc.symtab.Scopes$Scope.enterInHash(Scopes.scala:144)
[INFO]
[INFO] java.lang.reflect.InvocationTargetException
[INFO] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
[INFO] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
[INFO] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
[INFO] at java.lang.reflect.Method.invoke(Method.java:616)
[INFO] at org_scala_tools_maven_executions.MainHelper.runMain(MainHelper.java:161)
[INFO] at org_scala_tools_maven_executions.MainWithArgsInFile.main(MainWithArgsInFile.java:26)
[ERROR] Caused by: java.lang.StackOverflowError
[INFO] at scala.tools.nsc.symtab.Scopes$Scope.enterInHash(Scopes.scala:143)
[INFO] at scala.tools.nsc.symtab.Scopes$Scope.enterInHash(Scopes.scala:144)
[INFO] at scala.tools.nsc.symtab.Scopes$Scope.enterInHash(Scopes.scala:144)
[INFO] at scala.tools.nsc.symtab.Scopes$Scope.enterInHash(Scopes.scala:144)
[INFO] at scala.tools.nsc.symtab.Scopes$Scope.enterInHash(Scopes.scala:144)
- 1000 lines ommitted
INFO] at scala.tools.nsc.symtab.Scopes$Scope.enterInHash(Scopes.scala:144)
[INFO] at scala.tools.nsc.symtab.Scopes$Scope.enterInHash(Scopes.scala:144)
[INFO] at scala.tools.nsc.symtab.Scopes$Scope.enterInHash(Scopes.scala:144)
[INFO] at scala.tools.nsc.symtab.Scopes$Scope.enterInHash(Scopes.scala:144)
[INFO] ------------------------------------------------------------------------
[ERROR] BUILD ERROR
[INFO] ------------------------------------------------------------------------
[INFO] wrap: org.apache.commons.exec.ExecuteException: Process exited with an error: 240(Exit value: 240)

[INFO] ------------------------------------------------------------------------
[INFO] For more information, run Maven with the -e switch
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 39 seconds
[INFO] Finished at: Sun Jan 29 12:44:39 PST 2012
[INFO] Final Memory: 48M/335M
[INFO] ------------------------------------------------------------------------