2

I am having this error in my grails log:

Error | ERROR mapping.DefaultUrlMappingEvaluator$UrlMappingBuilder - URL mapping argument [exception] with value [(*)] must be a valid class

It is not stopping the application, but I would like to know why is happening. I have detected that is because the URLMapping.groovy:

    "500"(controller:"securator", action:"error500", exception:InternalServerErrorException)
    "401"(controller:"securator", action:"error401", exception:IllegalAccessException)
    "403"(controller:"securator", action:"error403", exception:AccessDeniedException)

If I remove the last exception, the error disappear:

, exception:AccessDeniedException

Anyone has any ideas?, how can I use a valid class (I thought that AccessDeniedException was a valid class)?

Thanks in advance.

GSAN
  • 648
  • 6
  • 29
  • Could you show place in code where it's thrown? (probably controller or service). Are you using any authorization plugins? – Michal_Szulc Feb 05 '16 at 13:29
  • I am using Spring Security. The errors thrown when I run de app, at the very begining (just after configuring Spring Security). – GSAN Feb 05 '16 at 13:59

3 Answers3

2

I finally resolved, I change the exception to ForbiddenException. It looks good and no error thrown.

GSAN
  • 648
  • 6
  • 29
2

I got the same error (just with another exception) today, the simple solution is to import the class.

My code in UrlMappings.groovy that caused the error:

"500"(controller: "error", action: "grailsTagException", exception: GrailsTagException)

I got the same ERROR message as GSAN, added import of the class:

import org.codehaus.groovy.grails.web.taglib.exceptions.GrailsTagException;

Now my project compiles without errors. Hope that helps :)

Calon
  • 19
  • 1
  • 5
0

Try to change AccessDeniedException to abstract class AuthenticationException.

Michal_Szulc
  • 4,097
  • 6
  • 32
  • 59