Closed GoogleCodeExporter closed 8 years ago
Hi,
The root cause per log is this...
-----------------------------------
....
java.lang.NoSuchFieldError: instance
org.mozilla.javascript.CompilerEnvirons.<init>(CompilerEnvirons.java:48)
....
-----------------------------------
And that points to I think mozilla "rhino". Can you please tell me what version
of yuicompressor you are using? Also can you share you Filter init params?
Original comment by rr.patil...@gmail.com
on 18 Oct 2011 at 11:01
Hi MR Patil,
Thanks for replying.
I am using yuicompressor-2.4.6.
The Filter init params are:
<init-param>
<param-name>lineBreak</param-name>
<param-value>8000</param-value>
</init-param>
I had tried removing the init params as well, as they are optional as per the
documentation, but no luck.
Thanks,
Rahul
Original comment by rahulvat...@gmail.com
on 18 Oct 2011 at 11:31
By any chance do you have any "rhino.jar" in your classpath, lib?
Original comment by rr.patil...@gmail.com
on 18 Oct 2011 at 11:55
Can you share full stack trace for this issue from your tomcat log? You can
attach the file here.
Original comment by rr.patil...@gmail.com
on 18 Oct 2011 at 11:57
No I don't have rhino.jar in my classpath, lib as it was not mentioned in
documentation.
Should I put it there ?
Full stack trace I will be able to send you tomorrow morning first thing, as I
work on remote desktop and right now I don't have its connectivity.
Original comment by rahulvat...@gmail.com
on 18 Oct 2011 at 5:34
Server log file attached.
Original comment by rahulvat...@gmail.com
on 19 Oct 2011 at 3:42
Attachments:
I have even tried putting rhino.jar (rhino-1.6R7.jar) in classpath/lib but
still no luck. The error remains the same.
Thanks,
Rahul
Original comment by rahulvat...@gmail.com
on 19 Oct 2011 at 4:16
Thanks for the log. This is strange! If you look at source of
CompilerEnvirons.java
(http://www.java2s.com/Open-Source/Java-Document/Scripting/rhino-1.7/org/mozilla
/javascript/CompilerEnvirons.java.htm) you will notice that it has
"DefaultErrorReporter.instance" and it seems absolutely valid. For me same
yuicompressor-2.4.6 is working fine without any issues.
There were some reports in the past about rhino's similar issues and obviously
the cause was due to incorrect rhino jars. Look at these links if that helps.
http://freemarker.624813.n4.nabble.com/RhinoWrapper-Exception-td626465.html
http://issues.liferay.com/browse/LPS-1822
You can also try this
1. Use intellij, eclipse and do type search (in idea, Ctrl +Shift + N or in
eclipse, Ctrl+Shift+T) for "CompilerEnvirons.java" - If you get multiple
occurrences it means there is another jar (js.jar, rhino.jar or something else)
causing this.
2. Alternately, You can get source package for rhino and in eclipse/idea do the
debug with breakpoint to see what is happening.
Hopefully this will help in finding the real cause.
-
Rajendra
Original comment by rr.patil...@gmail.com
on 19 Oct 2011 at 4:55
Thanks for your input Rajendra. I can see 2 occurrences of CompilerEnvirons in
the project.
1) From yuicompressor.jar (as expected)
2) From JRE System library RT.jar
(sun.org.mozilla.javascript.internal.CompilerEnvirons).
In this case what should be done ?
Rahul
Original comment by rahulvat...@gmail.com
on 19 Oct 2011 at 6:17
Its not working for JSON as well.
Original comment by rahulvat...@gmail.com
on 19 Oct 2011 at 9:52
The other CompilerEnvirons from RT.jar should not cause a problem since it is
from different package. Per your log, the error being thrown by
"org.mozilla.javascript.CompilerEnvirons" which is from yuicompressor.
The error I suspect is at this line " errorReporter =
DefaultErrorReporter.instance;" so may be culprit is
"DefaultErrorReporter.java". Sorry but I am little doubtful If I will be able
to you figure out the resolution. Will let you know if I do.
Otherwise this file
https://github.com/sdesai/yuicompressor/blob/master/src/com/yahoo/platform/yui/c
ompressor/JavaScriptCompressor.java#L312, from where exception is chaining, is
authored by "Julien Lecomte". In case you can consult him about this issue, may
he knows the problem or hints the fix. You can find his contact details at
http://www.julienlecomte.net/blog/about-the-author/.
Meanwhile I will keep hunting the solution and will share with you if I get one.
-
Rajendra
Original comment by rr.patil...@gmail.com
on 19 Oct 2011 at 12:22
I think the issue and hence the fix for this is at YUI side. May be not using
YUIcompressor as maven dependency and manually include the yuicompressor (which
includes rhino too) helps.
Closing this for now as Won'tFix.
Original comment by rr.patil...@gmail.com
on 8 Dec 2011 at 6:16
Original issue reported on code.google.com by
rahulvat...@gmail.com
on 18 Oct 2011 at 9:50