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

  • unable to resolve class grails.plugins.springsecurity.Secured


    I'm trying to import the Secured class to annotate my controller with specific security levels for different actions.

    When I add the following import at the top my my controller (below package name), the IDE says it can't resolve the class.

    import grails.plugins.springsecurity.Secured

    Did I miss a step somewhere when I installed/configured the spring-security-core plugin? I have everything else working (like AuthUser/AuthRole/AuthUserAuthRole domain classes). I am able to use the <sec:ifLoggedIn> tags and also I'm able to use the springSecurityService to extract current user logged in.

    Any help is appreciated!

  • #2
    I found the solution.

    First, the IDE doesn't resolve the class, but it still compiles and runs.

    Second, the @Secured annotations were not working because the SecurityConfigType was set to Requestmap (I thought annotation was the default security type).


    • #3
      a decent workaround for IDEs

      I've been seeing this issue also, running in Eclipse. It builds and runs fine at the command-line, so it is an issue with how the IDE resolves grails plugins.

      The simplest solution I've found is to run at the command-line, then add the folder target/plugin-classes/ as a "library / class folder" on the build path in Eclipse.