java.lang.IllegalStateException: No thread-bound request found: Are you referring to request attributes outside of an actual web request, or processing a request outside of the originally receiving thread? If you are actually operating within a web request and still receive this message, your code is probably running outside of DispatcherServlet/DispatcherPortlet: In this case, use RequestContextListener or RequestContextFilter to expose the current request. at org.springframework.web.context.request.RequestContextHolder.currentRequestAttributes(RequestContextHolder.java:131) at org.codehaus.groovy.grails.plugins.web.api.CommonWebApi.currentRequestAttributes(CommonWebApi.java:205) at org.codehaus.groovy.grails.plugins.web.api.CommonWebApi.getParams(CommonWebApi.java:65) ... // and few more lines of stacktrace ;)
If you use IntelliJ IDEA for your Grails development you might encounter this error running integration tests:
Error Error generating web.xml file (Use --stacktrace to see the full trace)
The reason for this is that IDEA adds classpath by default on creating integration test run configuration. Unfortunately, sometimes it causes strange errors like this one. Follow these steps to resolve:
- Open Run → Edit Configurations... (or press Alt-Shift-F10)
- Select your configuration that fails
- Uncheck Add --classpath checkbox
- You are done! Run.