简体   繁体   中英

Upgrading Grails issues with plugin resources

I'm trying to upgrade a Grails app and some plugins for it from 2.2.3 to 2.4.3. In doing so, I want to retain use of the resources plugin that is no longer the default. The version I'm including is: resources:1.2.8

Upon starting the application, I see a bunch of these in the logs:

2014-09-17 15:18:15,476 [localhost-startStop-1] WARN ogprResourceProcessor: Serving url file:/Users/abc/.grails/2.4.3/projects/myapp/plugins/jquery-1.11.1/web-app/js/jquery/jquery-1.11.1.min.js isn't allowed.

2014-09-17 15:18:15,477 [localhost-startStop-1] ERROR ogprResourceMeta: Resource not found: /plugins/jquery-1.11.1/js/jquery/jquery-1.11.1.min.js

In ResourceProcessor.groovy, there is a method isServingAllowed(url), and in it the resources plugin checks to see whether a url starts with a root url obtained by resolving a "/" through grailsResourceLoader (or servletContext). This results in a URL like "file:/Users/.../name", but after this when the app is running, I've seen files start with jndi:localhost/app/plugins/..., which will fail this check.

Edit: Another case where I've seen it fail is when the root url is "file:/Users/abc/grailsApp/web-app/", but the resource url is "file:/Users/abc/.grails/2.4.3/projects/grailsApp/plugins/...". Obviously this does not start with the root url.

Is there some sort of configuration that I messed up somewhere along the line? I'm at a loss.

Downgrading the resources plugin from version 1.2.13 to 1.2.8 was a solution for me.

Operating System: Windows 7 Java version: SE Runtime Environment (build 1.7.0_51-b13) Grails version: 2.4.4

通过升级gsp资源插件的版本解决了该问题。

在完成每个模块的clean工作后,我使用以下命令解决了问题:

grails compile -refresh-dependencies

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