Uploaded image for project: 'Spring Tool Suite'
  1. Spring Tool Suite
  2. STS-2329

Groovy debugging: "Conditional Breakpoint Error / An exception occurred durring evalution." when groovy project contains references to other projects and conditional breakpoints are used

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Complete
    • Affects Version/s: 2.8.1.RELEASE
    • Fix Version/s: 2.9.0.M2
    • Component/s: GRAILS
    • Labels:
    • Environment:
      eclipse.buildId=2.8.1.201111221000-RELEASE
      java.version=1.6.0_27
      GRECLIPSE 2.6.0.xx-20111207-0800-e37

      Description

      I'm working with Grails (2.0.x) source code.

      I tried to use conditional breakpoints in debugging, but project references don't get added to classpath in GroovyJDIEvaluator .
      (handling is missing for IClasspathEntry types of 2 (=CPE_PROJECT))

      To reproduce:

      • clone grails git repo
      • ./gradlew cleanEclipse eclipse
      • import grails projects to new eclipse workspace
      • fix build problems (reorder grails-web classpath and fix grails-scripts sourcepath or apply patch https://github.com/grails/grails-core/pull/122)
      • add conditional breakpoint to /grails-plugin-gsp/src/main/groovy/org/codehaus/groovy/grails/plugins/web/taglib/ApplicationTagLib.groovy line 148
        • condition: "grails_logo.png".equals(attrs.get("file"))
      • create empty new grails app and run it in grails-debug mode /
      • attach debugger to app. add all grails projects to remote debugger configuration's source path.
      • go to url http://localhost:8080

      full stacktrace of error:

      org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed:
      ____Eval.groovy: 8: unable to resolve class org.codehaus.groovy.grails.commons.GrailsApplication
       @ line 8, column 43.
         odehaus.groovy.grails.commons.GrailsAppl
                                       ^
      
      ____Eval.groovy: 9: unable to resolve class org.codehaus.groovy.grails.plugins.GrailsPluginManager
       @ line 9, column 43.
         odehaus.groovy.grails.plugins.GrailsPlug
                                       ^
      
      ____Eval.groovy: 4: unable to resolve class grails.artefact.Artefact
       @ line 4, column 24.
         import grails.artefact.Artefact;
                                ^
      
      ____Eval.groovy: 11: unable to resolve class org.codehaus.groovy.grails.web.mapping.LinkGenerator
       @ line 11, column 47.
         aus.groovy.grails.web.mapping.LinkGenera
                                       ^
      
      ____Eval.groovy: 16: unable to resolve class org.springframework.beans.factory.annotation.Autowired
       @ line 16, column 53.
         work.beans.factory.annotation.Autowired;
                                       ^
      
      ____Eval.groovy: 18: unable to resolve class org.springframework.context.ApplicationContextAware
       @ line 18, column 36.
         import org.springframework.context.ApplicationContextAware;
                                            ^
      
      ____Eval.groovy: 7: unable to resolve class org.apache.commons.io.FilenameUtils
       @ line 7, column 30.
         import org.apache.commons.io.FilenameUtils;
                                      ^
      
      ____Eval.groovy: 12: unable to resolve class org.codehaus.groovy.grails.web.mapping.UrlMappingsHolder
       @ line 12, column 47.
         aus.groovy.grails.web.mapping.UrlMapping
                                       ^
      
      ____Eval.groovy: 5: unable to resolve class grails.util.GrailsUtil
       @ line 5, column 20.
         import grails.util.GrailsUtil;
                            ^
      
      ____Eval.groovy: 17: unable to resolve class org.springframework.context.ApplicationContext
       @ line 17, column 36.
         import org.springframework.context.ApplicationContext;
                                            ^
      
      ____Eval.groovy: 6: unable to resolve class grails.util.Metadata
       @ line 6, column 20.
         import grails.util.Metadata;
                            ^
      
      ____Eval.groovy: 10: unable to resolve class org.codehaus.groovy.grails.plugins.support.aware.GrailsApplicationAware
       @ line 10, column 57.
         .grails.plugins.support.aware.GrailsAppl
                                       ^
      
      ____Eval.groovy: 15: unable to resolve class org.springframework.beans.factory.InitializingBean
       @ line 15, column 42.
         springframework.beans.factory.Initializi
                                       ^
      
      13 errors
      
      	at org.codehaus.groovy.control.ErrorCollector.failIfErrors(ErrorCollector.java:306)
      	at org.codehaus.groovy.control.CompilationUnit.applyToSourceUnits(CompilationUnit.java:945)
      	at org.codehaus.groovy.control.CompilationUnit.doPhaseOperation(CompilationUnit.java:594)
      	at org.codehaus.groovy.control.CompilationUnit.compile(CompilationUnit.java:543)
      	at groovy.lang.GroovyClassLoader.doParseClass(GroovyClassLoader.java:306)
      	at groovy.lang.GroovyClassLoader.parseClass(GroovyClassLoader.java:287)
      	at com.springsource.sts.groovy.debug.core.evaluation.GroovyJDIEvaluator.convertSnippetToScript(GroovyJDIEvaluator.java:332)
      	at com.springsource.sts.groovy.debug.core.evaluation.GroovyJDIEvaluator.performEvaluate(GroovyJDIEvaluator.java:170)
      	at com.springsource.sts.groovy.debug.core.evaluation.GroovyJDIEvaluator$1$1.run(GroovyJDIEvaluator.java:148)
      	at org.eclipse.jdt.internal.debug.core.model.JDIThread.runEvaluation(JDIThread.java:688)
      	at com.springsource.sts.groovy.debug.core.evaluation.GroovyJDIEvaluator$1.run(GroovyJDIEvaluator.java:153)
      	at org.eclipse.jdt.internal.debug.core.model.JDIThread$ThreadJob.run(JDIThread.java:2805)
      	at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54)
      

        Attachments

          Activity

            People

            Assignee:
            aeisenberg Andrew Eisenberg
            Reporter:
            lhotari Lari Hotari
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: