Announcement Announcement Module
No announcement yet.
Grails/Groovy integration in STS does not evaluate expressions Page Title Module
Move Remove Collapse
Conversation Detail Module
  • Filter
  • Time
  • Show
Clear All
new posts

  • Grails/Groovy integration in STS does not evaluate expressions

    I just downloaded the STS 2.6.1 and the Grails/Groovy integration. Everything seems to work fine in terms of the ability to debug and view variables, but I cannot seem to evaluate expressions in the Expressions window. I put the name of a variable inside the "watch expression" window or the "display" window and I get an error:

    See error log: org.eclipse.jdt.internal.debug.core.model.JDIPrimi tiveValue cannot be cast to org.eclipse.jdt.debug.core.IJavaObject

    I even get this same error when evaluating 'System.out.println("Hello World!");'

    Any ideas?

  • #2
    In what context are you running the evaluation? This could be a problem with how the groovy debug support is interpreting the current script or class.

    Are you running in Groovy 1.7 or 1.8? Also, can you have a look at the error log and see if there are any relevant entries in the log?

    Have you tried it with a very simple script? Eg-

    def x = "hello"

    Set a breakpoint at the second "x" and see if it works. Let me know if you have any luck


    • #3
      I am using Groovy 1.7.8 (which got downloaded with the Grails STS plugin).

      Creating a small Groovy class in a separate project is able to be debugged and expressions evaluate fine.

      There is nothing in the error log window for my non-working project except for "Internal Error". More information is shown in the Expressions window:

      org.eclipse.jdt.internal.debug.core.model.JDIPrimi tiveValue cannot be cast to org.eclipse.jdt.debug.core.IJavaObject.

      The project I am trying to debug uses the Flex Grails Plugin. I will try a vanilla Grails application to see if that makes any difference, but I doubt it.


      • #4
        Any chance that you can send me just the class that is causing your troubles? If there is proprietary info in it, feel free to obfuscate or PM me directly.


        • #5
          Thanks. I received your email and I'll have a look at your project.


          • #6
            I tried this first on the latest snapshot of STS and saw that this was working. I know that we have had some problems in this area in the past and it looks like STS 2.6.1 is using a grails tooling from March by default (from the 2.6.0 release). I've had few fixes in this area since then, so that may explain why it is not working for you but is for me.

            I'd recommend first upgrading to Groovy-Eclipse 2.5.0 (if you don't already have that version). You can get it here;

            And then grab the snapshot Grails tooling from here:

            Let me know if this fixes your problem. This version also supports conditional breakpoints in groovy code using groovy syntax. It is still somewhat a new feature and so let me know also if you get a chance to use it (and how it works for you).


            • #7
              Much better. Thanks.