[英]java.lang.NoSuchFieldError: instance exception using yuicompressor to minify JS files
We are in the process of upgrading out application servers from Weblogic 11g running java 1.6 to Weblogic 12c running java 1.8. 我们正在将应用程序服务器从运行java 1.6的Weblogic 11g升级到运行java 1.8的Weblogic 12c。 One of the steps in our ANT build process is to use YUI Compressor (version 2.4.8) to minify our CSS and JS files.
我们的ANT构建过程中的一个步骤是使用YUI Compressor(版本2.4.8)来缩小我们的CSS和JS文件。 The step to minify CSS files works fine.
缩小CSS文件的步骤很好。 But when we try to minify JS files we get the following error:
但是当我们尝试缩小JS文件时,我们会收到以下错误:
java.lang.NoSuchFieldError: instance
at org.mozilla.javascript.CompilerEnvirons.<init>(CompilerEnvirons.java:48)
at com.yahoo.platform.yui.compressor.JavaScriptCompressor.parse(JavaScriptCompressor.java:310)
at com.yahoo.platform.yui.compressor.JavaScriptCompressor.<init>(JavaScriptCompressor.java:533)
at com.yahoo.platform.yui.compressor.YUICompressTask.doCompression(YUICompressTask.java:202)
at com.yahoo.platform.yui.compressor.YUICompressTask.execute(YUICompressTask.java:101)
at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:288)
at sun.reflect.GeneratedMethodAccessor3.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:497)
at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
at org.apache.tools.ant.Task.perform(Task.java:348)
at org.apache.tools.ant.Target.execute(Target.java:357)
at org.apache.tools.ant.Target.performTasks(Target.java:385)
at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1337)
at org.apache.tools.ant.Project.executeTarget(Project.java:1306)
at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:41)
at org.apache.tools.ant.Project.executeTargets(Project.java:1189)
at org.apache.tools.ant.Main.runBuild(Main.java:758)
at org.apache.tools.ant.Main.startAnt(Main.java:217)
at org.apache.tools.ant.launch.Launcher.run(Launcher.java:257)
at org.apache.tools.ant.launch.Launcher.main(Launcher.java:104)
When I looked into the classes inside yuicompressor-2.4.8.jar causing the error I see that line 48 of CompilerEnvirons.java looks like this: 当我查看yuicompressor-2.4.8.jar中的类导致错误时,我看到CompilerEnvirons.java的第48行看起来像这样:
this.errorReporter = DefaultErrorReporter.instance;
But when I checked the class DefaultErrorReporter.java it's empty. 但是当我检查类DefaultErrorReporter.java时它是空的。 The entire class consists of the following:
整个班级包括以下内容:
class
{
}
Java 1.6 didn't seem to care about this but java 1.8 does. Java 1.6似乎并不关心这一点,但java 1.8确实如此。
I'm not an expert with this compressor tool by any means so I was wondering if anyone had any ideas on what might cause this. 我不是这个压缩机工具的专家,所以我想知道是否有人对可能导致这种情况的任何想法。 If I need to provide additional information I'm happy to.
如果我需要提供额外的信息,我很高兴。
Thanks. 谢谢。
结果证明这是一个损坏的JAR文件。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.