I'm happy to report I found the issue. If you are loading and executing Javascript files with Rhino on GAE, make sure you *do not* have yuicompressor-2.4.1.jar in you WEB-INF/lib directory. It overwrites some core portions of the rhino library and breaks the functionality this thread discussed. It doesnt seem to be an issue on my mac with java 1.5 and I haven't had a chance to check other versions of the yuicompressor to see if they stopped mangling rhino directly. To sum it up
classpath + yuicompressor-2.4.1.jar + js.jar + production-appengine = bork Thanks and hope this helps someone, had me stumped for a week. Thatcher On Apr 25, 10:40 am, Thatcher <[email protected]> wrote: > This is new behavior I haven't seen before and have serveral apps > running with javascript on gae that dont display this symptom. The > symptom only occurs only on new deployment, not locally. A brief > summary is in this thread. > > http://groups.google.com/group/google-appengine-java/browse_thread/th... > > Basically any file I'm loading via a file system or network io read > seems to have the backslash character in strings again escaped. so "a > \nb" becomes "a\\nb" which meas that rendering string to the response > body results in > > a\nb > > instead of > > a > b > > More importantly it causes RegExp constructor to fail tests because > escaped characters are double escaped, eg > RegExp("\\w+") becomes RegExp("\\\\w+"). > > Finally the simpliest test comes from loading a very small file into > rhino (this is js.jar not built-in rhino for java 1.6). > Here is the file: > > print('what is the length of two back slash: '+'\\'.length); > > Locally, the dev server, does as expected and I get a message: > what is the length of two back slash: 1 > > on GAE I get firm evidence that the string has been modified: > what is the length of two back slash: 2 > > Can anyone think what I might have done to trigger this behavior > myself? Is there some sort of security mechanism at work here to > prevent string injection? Is it possible that its a GZIP issue on > GAE? Any help would be greatly appreciated as my apps will no longer > deploy but the existing versions are working correctly. > > Thanks > Thatcher > > -- > You received this message because you are subscribed to the Google Groups > "Google App Engine for Java" group. > To post to this group, send email to [email protected]. > To unsubscribe from this group, send email to > [email protected]. > For more options, visit this group > athttp://groups.google.com/group/google-appengine-java?hl=en. -- You received this message because you are subscribed to the Google Groups "Google App Engine for Java" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/google-appengine-java?hl=en.
