Results 1 to 7 of 7

Thread: Grails/Groovy integration in STS does not evaluate expressions

  1. #1

    Default 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. #2
    Join Date
    Aug 2008
    Location
    Vancouver, BC
    Posts
    747

    Default

    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"
    x

    Set a breakpoint at the second "x" and see if it works. Let me know if you have any luck
    Andrew Eisenberg, Ph.D.
    SpringSource, a division of VMware
    SpringSource Tools Team
    More about AJDT, Groovy-Eclipse, and Grails tooling

  3. #3

    Default

    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. #4
    Join Date
    Aug 2008
    Location
    Vancouver, BC
    Posts
    747

    Default

    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.
    Andrew Eisenberg, Ph.D.
    SpringSource, a division of VMware
    SpringSource Tools Team
    More about AJDT, Groovy-Eclipse, and Grails tooling

  5. #5
    Join Date
    Aug 2008
    Location
    Vancouver, BC
    Posts
    747

    Default

    Thanks. I received your email and I'll have a look at your project.
    Andrew Eisenberg, Ph.D.
    SpringSource, a division of VMware
    SpringSource Tools Team
    More about AJDT, Groovy-Eclipse, and Grails tooling

  6. #6
    Join Date
    Aug 2008
    Location
    Vancouver, BC
    Posts
    747

    Default

    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;
    http://dist.springsource.org/release/GRECLIPSE/e3.6/

    And then grab the snapshot Grails tooling from here:
    http://dist.springsource.com/snapsho...S/nightly/e3.6

    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).
    Andrew Eisenberg, Ph.D.
    SpringSource, a division of VMware
    SpringSource Tools Team
    More about AJDT, Groovy-Eclipse, and Grails tooling

  7. #7

    Default

    Much better. Thanks.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •