Results 1 to 10 of 14

Thread: STS complains about missing classes

Hybrid View

  1. #1

    Default STS complains about missing classes

    I am using STS 2.6.1 to build a grails application. After I updated the application to grails 1.3.7 (from the command line) an updated the spring security core & spring security acl plugins, the IDE started complaining that it cannot find classes such as
    grails.plugins.springsecurity.Secured
    grails.plugins.springsecurity.acl.AbstractAclObjec tIdentity
    etc.

    I made sure that the IDE is pointing to Grails 1.3.7.

    I tried restarting the IDE, but that didn't help.
    I tried cleaning the project, but that didn't help.
    I tried deleting the project and re-adding it to the workspace, but that didn't help.

    Despite the alleged compilation errors, the application builds and runs fine. It also runs without complaining from the shell command line.

    I am wondering if there is some compiled cache somewhere that's not being cleared.

    What should I try next to get the errors to go away?

    Thanks,

    Gene

  2. #2

    Default

    More info: I created a new workspace, and re-imported the source code from SVN. STS still complains about compilation errors even though the code runs fine. Specifically, it thinks I have multiply-defined domain classes that were generated by the Spring Security ACL plugin in Grails. Clean has no effect on the errors. Is there a way to tell where it thinks the duplicates are? I saw nothing obviously wrong with the .classpath file.

  3. #3
    Join Date
    Aug 2008
    Location
    Vancouver, BC
    Posts
    768

    Default

    Have you tried running refresh dependencies? CTRL+G R when inside the Grails perspective.

    It sounds like classpath confusion. Refresh dependencies will rebuild the classpath and it is required whenever you make structural changes to your project from outside of STS.
    Andrew Eisenberg, Ph.D.
    SpringSource, a division of VMware
    SpringSource Tools Team
    More about AJDT, Groovy-Eclipse, and Grails tooling

  4. #4

    Default

    Thanks for your response, Andrew. I refreshed dependencies as you suggested, but the compiler still complains about the classes being already defined. I did a grails clean just in case as well. I can run the code just fine, however.

  5. #5

    Default

    I did refresh dependencies, but that did not help.

  6. #6
    Join Date
    May 2010
    Posts
    412

    Default

    You mentioned that it complains about duplicate classes. Can you provide more info? Have you tried finding the classes? What are their names and packages, and where are they precisely
    w.r.t to your project structure? If you have the name of a class you can try to find (copies of) it by using the "open type" function (press CTRL-SHIFT-T).

    One possible explanation is that there may in fact be duplicate classes that exist in different source folders. If so, that is a known problem in Eclipse/STS.
    Eclipse doesn't allow duplicate classes because it compiles all source folders in a project together. With commandline tools (grails in specific) they compile
    the source folders separately and so don't experience this limitation. Not sure this is the problem, but it is a possibility.

    You seem to be having a lot of problems with Spring Security ACL plugin in STS (I recall a prior issue which is logged here: https://issuetracker.springsource.com/browse/STS-1792).
    Could be there is something unusual about the plugin that triggers some bugs in STS.

    I'll play around with it a bit myself and see if I can reproduce some of these problems. Keep an eye on the STS-1792 issue, I'll follow up there if I find something.
    Kris De Volder -- SpringSource

  7. #7

    Default

    Hi Kris,

    Thanks for the info. There were indeed two copies of the classes created by the Spring Security ACL plugin. In addition to the correct place (in the grails-app/domain location) there was another copy in a directory called .link_to_grails_plugins/... in the project directory. Does that folder need to be in the class path?

Posting Permissions

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