0

我正在创建一个 Grails Web 应用程序,当我在本地部署应用程序时一切正常,它启动时没有问题,但是当我尝试部署到 Heroku 或 CloudFoundry 时,我从 CF 中的日志中收到以下错误:

2012-10-15 12:14:15,865 [http-28586-1] ERROR resource.ResourceMeta  - Resource not found: /bootstrap/css/bootstrap-responsive.css
2012-10-15 12:14:15,866 [http-28586-1] ERROR resource.ResourceMeta  - Resource not found: /kickstart/css/docs.css
2012-10-15 12:14:15,867 [http-28586-1] ERROR resource.ResourceMeta  - Resource not found: /kickstart/css/kickstart.css
2012-10-15 12:14:15,867 [http-28586-1] ERROR resource.ResourceMeta  - Resource not found: /datepicker/css/datepicker.css
2012-10-15 12:14:15,868 [http-28586-1] ERROR resource.ResourceMeta  - Resource not found: /bootstrap/js/bootstrap.js
2012-10-15 12:14:15,868 [http-28586-1] ERROR resource.ResourceMeta  - Resource not found: /datepicker/js/bootstrap-datepicker.js
2012-10-15 12:14:15,869 [http-28586-1] ERROR resource.ResourceMeta  - Resource not found: /kickstart/js/kickstart.js
2012-10-15 12:14:17,506 [http-28586-1] ERROR resource.ResourceMeta  - Resource not found: /bootstrap/css/bootstrap.css
2012-10-15 12:14:17,506 [http-28586-1] ERROR resource.ResourceMeta  - Resource not found: /bootstrap/css/bootstrap-responsive.css
2012-10-15 12:14:17,507 [http-28586-1] ERROR resource.ResourceMeta  - Resource not found: /kickstart/css/docs.css
2012-10-15 12:14:17,507 [http-28586-1] ERROR resource.ResourceMeta  - Resource not found: /kickstart/css/kickstart.css
2012-10-15 12:14:17,508 [http-28586-1] ERROR resource.ResourceMeta  - Resource not found: /datepicker/css/datepicker.css
2012-10-15 12:14:17,508 [http-28586-1] ERROR resource.ResourceMeta  - Resource not found: /bootstrap/js/bootstrap.js
2012-10-15 12:14:17,509 [http-28586-1] ERROR resource.ResourceMeta  - Resource not found: /datepicker/js/bootstrap-datepicker.js
2012-10-15 12:14:17,509 [http-28586-1] ERROR resource.ResourceMeta  - Resource not found: /kickstart/js/kickstart.js
2012-10-15 12:14:19,042 [http-28586-1] ERROR resource.ResourceMeta  - Resource not found: /bootstrap/css/bootstrap.css
2012-10-15 12:14:19,043 [http-28586-1] ERROR resource.ResourceMeta  - Resource not found: /bootstrap/css/bootstrap-responsive.css
2012-10-15 12:14:19,043 [http-28586-1] ERROR resource.ResourceMeta  - Resource not found: /kickstart/css/docs.css
2012-10-15 12:14:19,044 [http-28586-1] ERROR resource.ResourceMeta  - Resource not found: /kickstart/css/kickstart.css
2012-10-15 12:14:19,044 [http-28586-1] ERROR resource.ResourceMeta  - Resource not found: /datepicker/css/datepicker.css
2012-10-15 12:14:19,045 [http-28586-1] ERROR resource.ResourceMeta  - Resource not found: /bootstrap/js/bootstrap.js
2012-10-15 12:14:19,045 [http-28586-1] ERROR resource.ResourceMeta  - Resource not found: /datepicker/js/bootstrap-datepicker.js
2012-10-15 12:14:19,045 [http-28586-1] ERROR resource.ResourceMeta  - Resource not found: /kickstart/js/kickstart.js
2012-10-15 12:14:20,248 [http-28586-1] ERROR resource.ResourceMeta  - Resource not found: /bootstrap/css/bootstrap.css
2012-10-15 12:14:20,249 [http-28586-1] ERROR resource.ResourceMeta  - Resource not found: /bootstrap/css/bootstrap-responsive.css
2012-10-15 12:14:20,249 [http-28586-1] ERROR resource.ResourceMeta  - Resource not found: /kickstart/css/docs.css
2012-10-15 12:14:20,250 [http-28586-1] ERROR resource.ResourceMeta  - Resource not found: /kickstart/css/kickstart.css
2012-10-15 12:14:20,250 [http-28586-1] ERROR resource.ResourceMeta  - Resource not found: /datepicker/css/datepicker.css
2012-10-15 12:14:20,251 [http-28586-1] ERROR resource.ResourceMeta  - Resource not found: /bootstrap/js/bootstrap.js
2012-10-15 12:14:20,251 [http-28586-1] ERROR resource.ResourceMeta  - Resource not found: /datepicker/js/bootstrap-datepicker.js
2012-10-15 12:14:20,252 [http-28586-1] ERROR resource.ResourceMeta  - Resource not 

这个应用程序使用位于根目录下名为“plugins”的文件夹中的内嵌插件。然后我在BuildConfig.groovy中有这段代码来引用插件:

grails.plugin.location.'spring-security-ui'="plugins/grails-spring-security-ui"
grails.plugin.location.'kickstart-with-bootstrap'="plugins/ui"

一旦我使用内联插件,我才开始遇到将应用程序部署到云端的问题,以前从未遇到过这个问题:-S 谁能帮我解决这个问题,因为它非常烦人,我相信它是由“资源”引起的插入。

请注意,我已确保以下代码位于config.groovy文件中:

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

2 回答 2

1

我通过将资源移动到正确的位置来解决这个问题,因为它们位于不同的地方:S

谢谢您的帮助!

于 2012-10-19T14:59:26.340 回答
0

您是否尝试过使用与此处解释的解决方案类似的方法;

Heroku,Grails:如果使用多个 Web dyno,则缺少资源

无论关注多个测功机,它看起来都可能是一个类似的问题。

于 2012-10-16T09:39:37.240 回答