Ticket #2528114 (closed defect)


Opened: 07/28/11
Last modified: 12/12/12
Status: closed
Type: defect
Resolution: wontfix


Reid Burke
Target Release:
Priority: P3 (normal)
Summary: Using YUI via maven cause exception

I am using YUI Compressor in a maven managed webapp project.
And found that the Parser throws StringIndexOutOfBoundExcetpion.
But when not using maven, it does not happen.

After investigation, I see that the js.jar(rhino) contains the same class as in yui-compressor.jar
As I see, the classes in yui-compressor.jar should override those in js.jar.
But the real case is that the classloader here mix them up and causes unexpected result.

In my cases,
The constant Token.LAST_TOKEN should has the value 154(defined in yui), but it is not, it has the value of 152 instead (defined in rhino),
which results the Decomplier.FUNCTION_END becomes 153, which supposed to be 155
Since 153 is the value of constant Token.KEEPCOMMENT, unexpected behavior is then caused and finally results in StringIndexOutOfBoundExcetpion.

I think the pom.xml should remove the rhino dependency,
and put all the classes in yui compressor, as what the download version of yui-compressor.jar is doing.

Type: defect Observed in Version: 2.4.6
Component: YUICompressor Severity: S3 (normal)
Assigned To: Reid Burke Target Release:
Location: Priority: P3 (normal)
Tags: Relates To: #1859529, #2527981, #2528056
Browsers: N/A
Test Information:

Change History


YUI Developer

Posted: 08/23/11
  • component changed from None to YUICompressor
  • owner changed from George to Reid Burke
  • priority changed to P3 (normal)
  • status changed from new to assigned


Posted: 11/10/11

Any updates on this? I just ran into this today.

david nesbitt

Posted: 11/22/11

We are having this same issue. Please publish a workaround or a schedule for the fix if possible.

josiah gore

Posted: 11/30/11

I ran up against this as well. Is there any way to workaround it in the meantime until it gets fixed?

david nesbitt

Posted: 11/30/11

I have good news and bad news. The good news is that this is fixed in 2.4.7. The bad news is that the fixed version is not available here:


Fortunately for us, we have a local Archiva repository, so I was able to put 2.4.7 in our own repository. I don't know why 2.4.7 isn't up on mvnrespository.com nor do I know the process for getting it there. But it would be really nice if that happened somehow. :-)


Posted: 11/30/11

Sounds like an easy fix then.

Can y'all please push version 2.4.7 to maven central?

Scott Heath

Posted: 12/6/11

This issue is really causing a problem for my team and stalling development. Could you please push this fix soon? Thanks!


Posted: 02/2/12

I download 2.4.7 and I am still experiencing this problem.


Posted: 02/2/12
  • downloaded

Grzegorz Slowikowski

Posted: 02/17/12

I think, 2.4.6 version from central Maven repository should not be used.

See my comment here: https://github.com/greenlaw110/greenscript/pull/29#issuecomment-4017147

bob harner

Posted: 07/5/12
  • relatesto changed to 2527981, 2528056, 1859529

Thibault Duchateau

Posted: 09/13/12


As jamesgreene, I'm still experiencing the problem with the 2.4.7 version from maven central.
Is there any workaround ?


Jenny Donnelly

YUI Developer

Posted: 12/12/12
  • resolution changed to wontfix
  • status changed from assigned to closed

Thank you for your bug report. We are deprecating YUI Compressor in favor of yuglify. Please see our announcement for more information: http://www.yuiblog.com/blog/2012/10/16/state-of-yui-compressor/. We will consider migrating these legacy tickets to GitHub if there are community maintainers willing to step up and own them.