Uploaded image for project: 'Groovy'
  1. Groovy
  2. GROOVY-2097

StackOverflowError with Java sources that have no package declarations

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Blocker
    • Resolution: Cannot Reproduce
    • 1.0
    • 1.1-beta-3
    • parser
    • None
    • Windows XP, Grails 0.6, groovy 1.0, Java 1.6

    Description

      I experienced a problem with a Grails application that I believe is caused by a Groovy bug.

      When running the Grails app, the following StackOverflowError was thrown:

      Error executing script RunApp: null
      java.lang.StackOverflowError
      at org.codehaus.groovy.control.ResolveVisitor.resolve(ResolveVisitor.java:178)
      at org.codehaus.groovy.control.ResolveVisitor.resolveAliasFromModule(ResolveVisitor.java:381)
      at org.codehaus.groovy.control.ResolveVisitor.resolveFromModule(ResolveVisitor.java:412)
      at org.codehaus.groovy.control.ResolveVisitor.resolve(ResolveVisitor.java:191)
      at org.codehaus.groovy.control.ResolveVisitor.resolveAliasFromModule(ResolveVisitor.java:381)
      at org.codehaus.groovy.control.ResolveVisitor.resolveFromModule(ResolveVisitor.java:412)
      at org.codehaus.groovy.control.ResolveVisitor.resolve(ResolveVisitor.java:191)
      .... etc etc repeating

      After some to and fro on the grails user ml, it was established that the cause of this was some Java sources that I had in the root of the Grails project /src/java and /src/groovy folders. Some of the Grails developers suspect it is a problem with the Java stub generator used by the Groovy compiler with Java
      sources that have no package declarations, as the error was originating from a StackOverflowError in the parsing phase of Groovy code. I was advised to raise the issue here as a blocker, and hence am doing so.

      Once I moved those sources into a package structure, the app worked as expected.

      Attachments

        Activity

          People

            blackdrag Jochen Theodorou
            jondo Darryl Pentz
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: