Disable Grails 2.0 Resource Processing After Deployment

I packaged my application into war (via grails war ), and as I see it, he created all the necessary resources. For example, I have coffeescript code that translates to js dir. The same goes for scss etc. I mean, I have all the static resources that can be served directly (and I want to download it from Nginx, not Tomcat)

But after deploying this war in Tomcat, I get errors like:

 ERROR plugins.DefaultGrailsPluginManager - Error configuring dynamic methods for plugin [resources:1.1.6]: java.lang.NoSuchMethodError: org.mozilla.javascript.Parser.parse(Ljava/io/Reader;Ljava/lang/String;I)Lorg/mozilla/javascript/ScriptOrFnNode; org.codehaus.groovy.runtime.InvokerInvocationException: java.lang.NoSuchMethodError: org.mozilla.javascript.Parser.parse(Ljava/io/Reader;Ljava/lang/String;I)Lorg/mozilla/javascript/ScriptOrFnNode; at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441) at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303) at java.util.concurrent.FutureTask.run(FutureTask.java:138) at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) at java.lang.Thread.run(Thread.java:680) Caused by: java.lang.NoSuchMethodError: org.mozilla.javascript.Parser.parse(Ljava/io/Reader;Ljava/lang/String;I)Lorg/mozilla/javascript/ScriptOrFnNode; at com.yahoo.platform.yui.compressor.JavaScriptCompressor.parse(JavaScriptCompressor.java:312) 

This is one of the yui-minify-resources plugins. A similar thing happens for the coffeescript-resources plugin. Maybe because something is wrong with these plugins, but this is crazy, because I already have all the resources prepared / processed / compiled for static files. I do not need these plugins in production mode.

How can I disable all these resource plugins in production mode? Is it possible?

PS the same for grails run-war

+6
source share
1 answer

This is probably due to the fact that coffeescript-resources and yui-minify-resources are dependent on the Rhino JavaScript engine, but the YUI team made some changes to their version of Rhino, which leads to its incompatibility with the vanilla rhino. You have two options:

  • Try hacking class loaders.
  • Do not use YUI compressor
+2
source

Source: https://habr.com/ru/post/908691/


All Articles