Mahesha999
Mahesha999

Reputation: 24871

Unable to add watch expressions in eclipse

I am using Eclipse based development environment - a Groovy/Grails Tool Suite. The issue seems to be that eclipse is not able to find some JARs. And I dont understand where to put those JARs. Below are the details.

I am trying to step through the code. However when I put watch on any variable it gives error, but the same variable evaluates correctly on Variables window. I did one obeservation, that when there are a lot of expressions in my Expressions window, the debugger slows down, it takes time to evaluate those expressions but gives error for all. When I remove all expressions it steps through without any slow down. Also similar error occur when I use Display window

Below is the screen shot of whats happening

enter image description here

I checked the eclipse error log file. There are many errors, but below seems to be relevant one:

!ENTRY org.grails.ide.eclipse.groovy.debug.core 4 0 2015-08-19 12:40:09.963
!MESSAGE Internal error logged from Groovy Core Debug: 
!STACK 0
java.lang.Exception: (Groovy) Complete snippet:
/////start    
import java.io.BufferedReader;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.util.concurrent.BlockingQueue;
import java.util.concurrent.TimeUnit;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;    
println it
/////end
    at org.grails.ide.eclipse.groovy.debug.core.evaluation.GroovyJDIEvaluator.performEvaluate(GroovyJDIEvaluator.java:202)
    at org.grails.ide.eclipse.groovy.debug.core.evaluation.GroovyJDIEvaluator$1$1.run(GroovyJDIEvaluator.java:160)
    at org.eclipse.jdt.internal.debug.core.model.JDIThread.runEvaluation(JDIThread.java:764)
    at org.grails.ide.eclipse.groovy.debug.core.evaluation.GroovyJDIEvaluator$1.run(GroovyJDIEvaluator.java:165)
    at org.eclipse.jdt.internal.debug.core.model.JDIThread$ThreadJob.run(JDIThread.java:3157)
    at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54)
Caused by: org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed:
____Eval.groovy: 8: unable to resolve class org.slf4j.Logger
 @ line 8, column 18.
   import org.slf4j.Logger;
                    ^

____Eval.groovy: 9: unable to resolve class org.slf4j.LoggerFactory
 @ line 9, column 18.
   import org.slf4j.LoggerFactory;
                    ^

2 errors

    at org.codehaus.groovy.control.ErrorCollector.failIfErrors(ErrorCollector.java:313)
    at org.codehaus.groovy.control.CompilationUnit.applyToSourceUnits(CompilationUnit.java:1040)
    at org.codehaus.groovy.control.CompilationUnit.doPhaseOperation(CompilationUnit.java:647)
    at org.codehaus.groovy.control.CompilationUnit.compile(CompilationUnit.java:596)
    at groovy.lang.GroovyClassLoader.doParseClass(GroovyClassLoader.java:279)
    at groovy.lang.GroovyClassLoader.parseClass(GroovyClassLoader.java:258)
    at org.grails.ide.eclipse.groovy.debug.core.evaluation.GroovyJDIEvaluator.convertSnippetToScript(GroovyJDIEvaluator.java:349)
    at org.grails.ide.eclipse.groovy.debug.core.evaluation.GroovyJDIEvaluator.performEvaluate(GroovyJDIEvaluator.java:183)
    ... 5 more

Seems like it needs some jars, but which and where to put them? I tried adding the file slf4j-api-1.7.2.jar which contains these classes to %JAVA_HOME%/lib and %JAVA_HOME%\jre\lib and also to ggts' plugins folder, but it did not helped.

Upvotes: 2

Views: 480

Answers (0)

Related Questions