简体   繁体   中英

Grails resources plugin and cloudfoundry

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?

确保您没有错过Config.groovy中的以下行

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

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

你能100%确认这在当地的“生产”环境中有效吗?

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM