Announcement Announcement Module
Collapse
No announcement yet.
groovy unable to resolve class Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • groovy unable to resolve class

    sts 2.2.1
    grails-1.1.1
    Editing UserController file,
    sts editor (red x's) a line with tooltip "groovy unable to resolve class user"
    domain User exists!

    then I do a run-app
    and the app works as expected!

    uh oh!

  • #2
    Hi,

    When you 'run-app' Grails is actually executing a version it built into a staging directory - at the moment this is different to what is actually being compiled by Eclipse. Hence you may get an eclipse error and yet the application will run.

    On the 'unable to resolve class User' problem, do you see any related errors in the Eclipse error view? (Windows>ShowView>ErrorLog)

    Anything unusual about the UserController and User types? - are they in the expected grails source folders, with expected package declarations and (if on Windows) the case of the type matches the case of the filename? Are you able to confirm on disk that the class file for the User class is in the expected output folder? Does the problem only happen on an incremental compile when you change UserController, or on a full project clean too?

    thanks,

    Andy Clement
    Groovy Eclipse Development

    Comment


    • #3
      I was just creating a project from scratch, a tutorial that I have completed previously in netbeans.

      I did this to familiarize myself with the sts ide.
      Nothing out of the ordinary here.

      Grails is a self contained development wonder!

      Forwarding the grails command from the ide to grails itself and using
      the project view as the instant grails state; ("running log") would seem
      to be the way to go.

      And would require no one to re-invent the wheel , so to speak
      adding needless layers of code

      I believe that the ide's editor is the "Sole" benefit to grail's.
      Duplicating grails functionality, then recording it to project view ,
      seems way too redundant!


      I also ran an integration test, which passed then failed , stating that
      I hadn't declared it to be transactional , this is not the case at the cmd prompt.

      Thank you,
      Douglas

      Comment


      • #4
        Hi,

        Can you point me to the tutorial so I can try and recreate the problem? I have no open bugs on something like this so it is hard to do anything if I can't recreate it.

        Forwarding the grails command from the ide to grails itself and using
        the project view as the instant grails state; ("running log") would seem
        to be the way to go.
        Yes, I agree, but that is not what happens now. It is the longer term goal once we have many other urgent features done.

        I believe that the ide's editor is the "Sole" benefit to grail's.
        Duplicating grails functionality, then recording it to project view ,
        seems way too redundant!
        The editor and other IDE features (code assist, etc) are all driven off the eclipse model and so compilation must be done to properly understand the artifacts in question. Grails running what eclipse has built, rather than maintaining a duplicate copy, is the way to go.

        I also ran an integration test, which passed then failed , stating that
        I hadn't declared it to be transactional , this is not the case at the cmd prompt.
        If this is in the same tutorial, maybe I can recreate this problem too.

        cheers,
        Andy Clement
        Groovy Eclipse Development

        Comment


        • #5
          I will look for the turorial.

          Grails has a database, server, browser capabilty
          imagine if it had it's own embedded editor gui
          Talk about agile!

          Comment


          • #6
            Originally posted by Andy Clement View Post
            Hi,

            Can you point me to the tutorial so I can try and recreate the problem? I have no open bugs on something like this so it is hard to do anything if I can't recreate it.



            Yes, I agree, but that is not what happens now. It is the longer term goal once we have many other urgent features done.



            The editor and other IDE features (code assist, etc) are all driven off the eclipse model and so compilation must be done to properly understand the artifacts in question. Grails running what eclipse has built, rather than maintaining a duplicate copy, is the way to go.



            If this is in the same tutorial, maybe I can recreate this problem too.

            cheers,
            Andy Clement
            Groovy Eclipse Development
            I just installed sts 2.2.1, created the same project and all went well?

            However , after running the integration test I had to double click the file
            in the project window to get focus back in the editor!

            also , when creating an opening curly brace and hitting enter
            the cursor at times ends up behind the closing brace.

            Comment


            • #7
              Originally posted by douglasv View Post
              I just installed sts 2.2.1, created the same project and all went well?

              However , after running the integration test I had to double click the file
              in the project window to get focus back in the editor!

              also , when creating an opening curly brace and hitting enter
              the cursor at times ends up behind the closing brace.
              can the editor create a live log that feeds Grails instantly?

              Comment


              • #8
                Originally posted by douglasv View Post
                I just installed sts 2.2.1, created the same project and all went well?

                However , after running the integration test, then clicking the link to view
                the report,
                I had to double click the file in the project window to get focus back in the editor!

                also , when creating an opening curly brace and hitting enter
                the cursor at times ends up behind the closing brace.
                I can't submit this edit until I create at least 10 words

                Comment


                • #9
                  Originally posted by douglasv View Post
                  can the editor create a live log that feeds Grails instantly?
                  Eclipse already offers something like this - if you start typing then stop for a fraction of a second, your code will get compiled - this is called reconciling and it is what gives you the editor features like code assist and highlighting errors as you type.

                  Once we are not using two build systems to build the code, and therefore getting a tighter coupling between eclipse and grails, then eclipse will effectively be feeding grails as you work.

                  I would like to have debugged why you might have been seeing that problem with your tutorial - is the link something you can share? I can then give it a try.

                  For the other issues. If they appear non-grails specific (ie. they happen when just playing with groovy code that happens to be in a grails project), feel free to raise an issue against groovy eclipse:
                  http://jira.codehaus.org/browse/GRECLIPSE

                  if they are grails specific, you can raise them against STS:
                  https://issuetracker.springsource.com/browse/STS

                  Your double click problem and the cursor jumping to after the closing brace *sound* like just groovy eclipse problems.

                  cheers,
                  Andy Clement
                  Groovy Eclipse

                  Comment


                  • #10
                    I re-installed sts 2.2.1
                    did the tutorial and it did not raise the issue
                    this time

                    Comment


                    • #11
                      Project clean sorted

                      Had the same issue as you, did a full project clean and it was sorted.

                      Comment

                      Working...
                      X