4
votes

I tried to deploy my app to cloudfoundry, everything goes smooth however none of my static resources that use the resources plugin can be found.

In the logs i get lots of errors like the below

2012-01-31 13:36:41,352 [http-46220-3] WARN util.ResourceMetaStore - Cannot locate resource [/static/css/jquery-ui-1.8.17.custom.css]

I first thought that this is due to cloudfoundry not having any disk space allocated but based on this thread it should work out of the box

http://grails.1312388.n4.nabble.com/Cloud-foundry-and-resources-plugin-with-js-css-td4243619.html

The test application i am running is running on one instance and i am using version 1.1.6 of the resources plugin.

Anybody else experiencing similar problems?

4
Make sure you're using the latest version of the resources plugin. Some issues similar to this one were resolved recently. I can deploy on CF using Grails 2.0.0 and resources plugin 1.1.6 - Dónal
Yes i have Grails 2.0.0 and resources plugin 1.1.6 also. - Iman

4 Answers

5
votes

Make sure you are not missing the following line in your Config.groovy

grails.resources.adhoc.patterns = ['/images/*', '/css/*', '/js/*', '/plugins/*']
0
votes

I had the similar problem on heroku platform. It seems that problem is related with resources plugin and load balancing. My be the following will be useful:

Heroku, Grails: Missing resources if using multiple web dynos

0
votes

Can you confirm 100% that this works in "production" environment locally?

0
votes

I have a Grails 2.0 application on Cloud Foundry (http://tripplanner-ali.cloudfoundry.com/trip/create). It is using the resources plugin (1.1.5) along with cloud-support and cloud-foundry and jquery of course. I would suggest you to have your STS setup with Grails 2.0 if you haven't done so and try to create a sample application and deploy it to CF. Here is where you can get STS with Grails 2.0 working (http://static.springsource.org/sts/docs/2.7.0/reference/html/grails/grails20.html).

Once you have this setup, All you have to do is create a new Grails project and you will get the resources plugin along with jquery by default.