Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Exception on file compression #23

Open
rsilve opened this issue Dec 24, 2011 · 10 comments
Open

Exception on file compression #23

rsilve opened this issue Dec 24, 2011 · 10 comments

Comments

@rsilve
Copy link

rsilve commented Dec 24, 2011

Hi

I try to use press module 1.0.25 in play 1.2.4
For all js file I get the same exception

Oops: StringIndexOutOfBoundsException
An unexpected error occured caused by exception StringIndexOutOfBoundsException: String index out of range: 211

play.exceptions.UnexpectedException: Unexpected Error
at press.Compressor.writeCompressedFile(Compressor.java:352)
at press.Compressor.getCompressedFile(Compressor.java:323)
at press.Compressor.getCompressedFile(Compressor.java:291)
at press.JSCompressor.getCompressedFile(JSCompressor.java:32)
at controllers.press.Press.getCompressedJS(Press.java:25)
at play.mvc.ActionInvoker.invokeWithContinuation(ActionInvoker.java:548)
at play.mvc.ActionInvoker.invoke(ActionInvoker.java:502)
at play.mvc.ActionInvoker.invokeControllerMethod(ActionInvoker.java:478)
at play.mvc.ActionInvoker.invokeControllerMethod(ActionInvoker.java:473)
at play.mvc.ActionInvoker.invoke(ActionInvoker.java:161)
at Invocation.HTTP Request(Play!)
Caused by: java.lang.StringIndexOutOfBoundsException: String index out of range: 211
at java.lang.String.substring(String.java:1934)
at com.yahoo.platform.yui.compressor.JavaScriptCompressor.printSourceString(JavaScriptCompressor.java:267)
at com.yahoo.platform.yui.compressor.JavaScriptCompressor.parse(JavaScriptCompressor.java:330)
at com.yahoo.platform.yui.compressor.JavaScriptCompressor.(JavaScriptCompressor.java:533)
at press.JSCompressor$1.compress(JSCompressor.java:46)
at press.Compressor.compress(Compressor.java:407)
at press.Compressor.writeCompressedFile(Compressor.java:345)
... 10 more

After this an empty file is generate in the cache

Any ideas ?

Thanks

Robert

@dirkmc
Copy link
Owner

dirkmc commented Dec 24, 2011

Hmm I haven't seen that before. It looks like it's coming out of the YUI Compressor itself. Does this sound similar to the problem you're seeing?:
http://stackoverflow.com/questions/8429095/yui-compressor-throws-stringindexoutofboundsexception-when-running-in-tomcat-fro
http://yuilibrary.com/forum/viewtopic.php?p=28719
http://yuilibrary.com/projects/yuicompressor/ticket/2528114

@rsilve
Copy link
Author

rsilve commented Dec 24, 2011

Hi

It's difficult to say but It sound similar.

I will make some other tests with a very minimal project.

Thank's for your help

Robert

Le 24 déc. 2011 à 08:43, dirkmc a écrit :

Hmm I haven't see
n that before. It looks like it's coming out of the YUI Compressor itself. Does this sound similar to the problem you're seeing?:
http://stackoverflow.com/questions/8429095/yui-compressor-throws-stringindexoutofboundsexception-when-running-in-tomcat-fro
http://yuilibrary.com/forum/viewtopic.php?p=28719
http://yuilibrary.com/projects/yuicompressor/ticket/2528114


Reply to this email directly or view it on GitHub:
#23 (comment)

@rsilve
Copy link
Author

rsilve commented Dec 24, 2011

It seems that it is related to the use of less module ...

I send you a minimal project that send the exception if you want to go deep in this problem

run with play run --%prod

Robert

Le 24 dc. 2011 08:43, dirkmc a crit :

Hmm I haven't seen that before. It looks like it's coming out of the YUI Compressor itself. Does this sound similar to the problem you're seeing?:
http://stackoverflow.com/questions/8429095/yui-compressor-throws-stringindexoutofboundsexception-when-running-in-tomcat-fro
http://yuilibrary.com/forum/viewtopic.php?p=28719
http://yuilibrary.com/projects/yuicompressor/ticket/2528114


Reply to this email directly or view it on GitHub:
#23 (comment)

@dirkmc
Copy link
Owner

dirkmc commented Dec 24, 2011

Thanks for taking the time to look into this bug. Are you saying that when you create a project that has both press and less you get this error occurring?
In the mean time you can try the greensript module, it supports less.

@rsilve
Copy link
Author

rsilve commented Dec 24, 2011

For me the bug occured when press AND less are used together.

For now I have try greenscript but for a reason I don't understand for now, it don't do the less process.

My purpose is to test play and in my test less is more important than compress.
So for now i will continue my tests an keep compression for later tests.

If perhaps you need testing let me know.

thanks for all

Robert

Le 24 déc. 2011 à 11:49, dirkmc a écrit :

Thanks for taking the time to look into this bug. Are you saying that when you create a project that has both press and less you get this error occurring?
In the mean time you can try the greensript module, it supports less.


Reply to this email directly or view it on GitHub:
#23 (comment)

@dirkmc
Copy link
Owner

dirkmc commented Dec 24, 2011

Damn that sucks, I'm sorry you've had a poor experience with these plugins. I'm planning to integrate less compression into press very soon (in the next couple of weeks), I'll comment on this issue when it's ready.

@rsilve
Copy link
Author

rsilve commented Dec 24, 2011

That cool :)

I stay tuned

Thanks :)

Le 24 déc. 2011 à 12:10, dirkmc a écrit :

Damn that sucks, I'm sorry you've had a poor experience with these plugins. I'm planning to integrate less compression into press very soon (in the next couple of weeks), I'll comment on this issue when it's ready.


Reply to this email directly or view it on GitHub:
#23 (comment)

@dabeeeenster
Copy link

Hi

I'm not using the less module but also seeing this error. My stack trace looks like:

@69271338k
Internal Server Error (500) for request GET /press/css/XQIwMzoHwADZCfRDKAPiSAJJ.css

Oops: StringIndexOutOfBoundsException
An unexpected error occured caused by exception StringIndexOutOfBoundsException: String index out of range: 5636

play.exceptions.UnexpectedException: Unexpected Error
at press.Compressor.writeCompressedFile(Compressor.java:352)
at press.Compressor.getCompressedFile(Compressor.java:323)
at press.Compressor.getCompressedFile(Compressor.java:291)
at press.CSSCompressor.getCompressedFile(CSSCompressor.java:28)
at controllers.press.Press.getCompressedCSS(Press.java:32)
at play.utils.Java.invokeStatic(Java.java:129)
at play.mvc.ActionInvoker.invoke(ActionInvoker.java:139)
at Invocation.HTTP Request(Play!)
Caused by: java.lang.StringIndexOutOfBoundsException: String index out of range: 5636
at java.lang.AbstractStringBuilder.substring(AbstractStringBuilder.java:879)
at java.lang.StringBuffer.substring(StringBuffer.java:416)
at com.yahoo.platform.yui.compressor.CssCompressor.compress(CssCompressor.java:125)
at press.CSSCompressor$1.compress(CSSCompressor.java:42)
at press.Compressor.compress(Compressor.java:407)
at press.Compressor.writeCompressedFile(Compressor.java:345)
... 7 more

@dirkmc
Copy link
Owner

dirkmc commented Jan 8, 2012

Thanks for the bug report. Did you check the links I listed above to see if they might be related to your problem?

@dabeeeenster
Copy link

That does look like the same error as me, but I don't have rhino in any other jars in my project. Is there any way I can provide some sort of test for you to work with? My project is not open source I'm afraid.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants