我正在创建一个Grails Web App,当我在本地部署应用程序并且启动没有问题时一切正常,但是当我尝试部署到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
此应用使用位于根目录下的“插件”文件夹中的内嵌插件。然后我在 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/*']
答案 0 :(得分:1)
我通过将资源移动到正确的位置来解决这个问题,因为它们位于不同的位置:S
感谢您的帮助!
答案 1 :(得分:0)
您是否尝试过使用与此处说明的解决方案类似的方法;
Heroku, Grails: Missing resources if using multiple web dynos
无论关注多个动态,看起来它可能是一个类似的问题。