title: Cloudfoundry Grails deployment problems - no thread-bound request found
body: <p>This works locally.  Set up: Grails 2.0.3. Debain Linux.  I've deployed other applications successfully to Cloud Foundry. </p>
  
  <p>Apparently this thing can happen as a consequence of the Spring Security Plugin not being happy with the resources plugin.  Removing the resources plugin doesn't cure this.</p>
  
  <p>This is the problem:</p>
  
  <pre><code>Class: java.lang.IllegalStateException
  Message: 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.
  </code></pre>
  
  <p>Adding the org.springframework.web.context.request.RequestContextListener and its loader to web.xml and importing them into the page doesn't help either.</p>
  
  <p>There is much about this on the web, but in my case it only happens on Cloud Foundry.</p>
  
  <p>Cloud Foundry runs on Java 1.6, like my machine.  The logs say the same as the quote above, with stack traces identical to what I've found on the web.</p>
  
  <p>Any ideas?  I'm stuck.  I've spent the best of two days on this.</p>
  
  <p>Thanks.</p>