Tapestry 5
  1. Tapestry 5
  2. TAP5-1729

Sometimes YUICompressor can fail with java.util.EmptyStackException

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Blocker Blocker
    • Resolution: Fixed
    • Affects Version/s: 5.3
    • Fix Version/s: 5.3.4, 5.4
    • Component/s: tapestry-yuicompressor
    • Labels:
      None

      Description

      [ERROR] ioc.Registry java.util.EmptyStackException
      [ERROR] ioc.Registry Operations trace:
      [ERROR] ioc.Registry [ 1] Streaming asset stack en/core.js
      [ERROR] ioc.Registry [ 2] Minimizing JavaScript
      [ERROR] TapestryModule.RequestExceptionHandler Processing of request failed with uncaught exception: org.apache.tapestry5.ioc.internal.OperationException
      org.apache.tapestry5.ioc.internal.OperationException
      at org.apache.tapestry5.ioc.internal.OperationTrackerImpl.logAndRethrow(OperationTrackerImpl.java:121)
      at org.apache.tapestry5.ioc.internal.OperationTrackerImpl.invoke(OperationTrackerImpl.java:88)
      at org.apache.tapestry5.ioc.internal.OperationTrackerImpl.run(OperationTrackerImpl.java:47)
      at org.apache.tapestry5.ioc.internal.PerThreadOperationTracker.run(PerThreadOperationTracker.java:76)
      at org.apache.tapestry5.ioc.internal.RegistryImpl.run(RegistryImpl.java:1109)
      at org.apache.tapestry5.internal.TapestryInternalUtils.performIO(TapestryInternalUtils.java:576)
      at org.apache.tapestry5.internal.yuicompressor.AbstractMinimizer.minimize(AbstractMinimizer.java:62)
      at org.apache.tapestry5.internal.services.assets.MasterResourceMinimizer.minimize(MasterResourceMinimizer.java:44)
      at $ResourceMinimizer_1250535a97d2196c.minimize(Unknown Source)
      at org.apache.tapestry5.internal.services.assets.StackAssetRequestHandler.assembleStackContent(StackAssetRequestHandler.java:175)
      at org.apache.tapestry5.internal.services.assets.StackAssetRequestHandler.assembleStackContent(StackAssetRequestHandler.java:163)
      at org.apache.tapestry5.internal.services.assets.StackAssetRequestHandler.getUncompressedResource(StackAssetRequestHandler.java:146)
      at org.apache.tapestry5.internal.services.assets.StackAssetRequestHandler.getResource(StackAssetRequestHandler.java:123)
      at org.apache.tapestry5.internal.services.assets.StackAssetRequestHandler.access$100(StackAssetRequestHandler.java:40)
      at org.apache.tapestry5.internal.services.assets.StackAssetRequestHandler$1.perform(StackAssetRequestHandler.java:103)
      at org.apache.tapestry5.internal.TapestryInternalUtils$5.run(TapestryInternalUtils.java:582)
      at org.apache.tapestry5.ioc.internal.OperationTrackerImpl$1.invoke(OperationTrackerImpl.java:51)
      at org.apache.tapestry5.ioc.internal.OperationTrackerImpl$1.invoke(OperationTrackerImpl.java:48)
      at org.apache.tapestry5.ioc.internal.OperationTrackerImpl.invoke(OperationTrackerImpl.java:74)
      at org.apache.tapestry5.ioc.internal.OperationTrackerImpl.run(OperationTrackerImpl.java:47)
      at org.apache.tapestry5.ioc.internal.PerThreadOperationTracker.run(PerThreadOperationTracker.java:76)
      at org.apache.tapestry5.ioc.internal.RegistryImpl.run(RegistryImpl.java:1109)
      at org.apache.tapestry5.internal.TapestryInternalUtils.performIO(TapestryInternalUtils.java:576)
      at org.apache.tapestry5.internal.services.assets.StackAssetRequestHandler.handleAssetRequest(StackAssetRequestHandler.java:96)
      at org.apache.tapestry5.internal.services.AssetDispatcher.dispatch(AssetDispatcher.java:109)
      at $Dispatcher_1250535a97d21963.dispatch(Unknown Source)
      at $Dispatcher_1250535a97d21967.dispatch(Unknown Source)
      at $Dispatcher_1250535a97d21961.dispatch(Unknown Source)
      at org.apache.tapestry5.services.TapestryModule$RequestHandlerTerminator.service(TapestryModule.java:302)
      at org.apache.tapestry5.internal.services.RequestErrorFilter.service(RequestErrorFilter.java:26)
      at $RequestHandler_1250535a97d21962.service(Unknown Source)
      at org.apache.tapestry5.services.TapestryModule$3.service(TapestryModule.java:902)
      at $RequestHandler_1250535a97d21962.service(Unknown Source)
      at org.apache.tapestry5.services.TapestryModule$2.service(TapestryModule.java:892)
      at $RequestHandler_1250535a97d21962.service(Unknown Source)
      at org.apache.tapestry5.internal.services.StaticFilesFilter.service(StaticFilesFilter.java:90)
      at $RequestHandler_1250535a97d21962.service(Unknown Source)
      at group.app.web.services.AppModule$1.service(AppModule.java:90)
      at $RequestFilter_1250535a97d2195d.service(Unknown Source)
      at $RequestHandler_1250535a97d21962.service(Unknown Source)
      at $RequestHandler_1250535a97d21956.service(Unknown Source)
      at org.apache.tapestry5.services.TapestryModule$HttpServletRequestHandlerTerminator.service(TapestryModule.java:253)
      at org.apache.tapestry5.internal.gzip.GZipFilter.service(GZipFilter.java:53)
      at $HttpServletRequestHandler_1250535a97d21958.service(Unknown Source)
      at org.apache.tapestry5.internal.services.IgnoredPathsFilter.service(IgnoredPathsFilter.java:62)
      at $HttpServletRequestFilter_1250535a97d21955.service(Unknown Source)
      at $HttpServletRequestHandler_1250535a97d21958.service(Unknown Source)
      at org.apache.tapestry5.services.TapestryModule$1.service(TapestryModule.java:852)
      at $HttpServletRequestHandler_1250535a97d21958.service(Unknown Source)
      at $HttpServletRequestHandler_1250535a97d21953.service(Unknown Source)
      at org.apache.tapestry5.TapestryFilter.doFilter(TapestryFilter.java:171)
      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
      at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:240)
      at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:164)
      at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:462)
      at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:164)
      at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:100)
      at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:563)
      at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)
      at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:403)
      at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:301)
      at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:162)
      at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:140)
      at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:309)
      at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
      at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
      at java.lang.Thread.run(Thread.java:680)
      Caused by: java.util.EmptyStackException
      at java.util.Stack.peek(Stack.java:85)
      at com.yahoo.platform.yui.compressor.JavaScriptCompressor.getCurrentScope(JavaScriptCompressor.java:559)
      at com.yahoo.platform.yui.compressor.JavaScriptCompressor.printSymbolTree(JavaScriptCompressor.java:1105)
      at com.yahoo.platform.yui.compressor.JavaScriptCompressor.compress(JavaScriptCompressor.java:553)
      at org.apache.tapestry5.internal.yuicompressor.JavaScriptResourceMinimizer.doMinimize(JavaScriptResourceMinimizer.java:98)
      at org.apache.tapestry5.internal.yuicompressor.AbstractMinimizer$1.perform(AbstractMinimizer.java:68)
      at org.apache.tapestry5.internal.TapestryInternalUtils$5.run(TapestryInternalUtils.java:582)
      at org.apache.tapestry5.ioc.internal.OperationTrackerImpl$1.invoke(OperationTrackerImpl.java:51)
      at org.apache.tapestry5.ioc.internal.OperationTrackerImpl$1.invoke(OperationTrackerImpl.java:48)
      at org.apache.tapestry5.ioc.internal.OperationTrackerImpl.invoke(OperationTrackerImpl.java:74)
      ... 66 more

      This is especially annoying because it is not failing on core.js, making it useless.

        Issue Links

          Activity

          Hide
          Howard M. Lewis Ship added a comment -

          Not seeing this with jetty:run, but I do see it when deployed into Tomcat.

          Show
          Howard M. Lewis Ship added a comment - Not seeing this with jetty:run, but I do see it when deployed into Tomcat.
          Hide
          Howard M. Lewis Ship added a comment -

          Again, jetty doesn't do this, just Tomcat:

          I've modified the code to handle the exception and continue on by sending the non-minimized version of the resource.

          [ERROR] AssetsModule.ResourceMinimizer Exception minimizing StreamableResource<text/javascript stack=core, locale=en, resources=[classpath:org/apache/tapestry5/underscore_1_1_7.js, classpath:org/apache/tapestry5/scriptaculous_1_9_0/prototype.js, classpath:org/apache/tapestry5/scriptaculous_1_9_0/scriptaculous.js, classpath:org/apache/tapestry5/scriptaculous_1_9_0/effects.js, classpath:org/apache/tapestry5/t5-core.js, classpath:org/apache/tapestry5/t5-spi.js, classpath:org/apache/tapestry5/t5-prototype.js, classpath:org/apache/tapestry5/t5-init.js, classpath:org/apache/tapestry5/t5-pubsub.js, classpath:org/apache/tapestry5/t5-events.js, classpath:org/apache/tapestry5/t5-dom.js, classpath:org/apache/tapestry5/t5-console.js, classpath:org/apache/tapestry5/t5-ajax.js, classpath:org/apache/tapestry5/t5-formfragment.js, classpath:org/apache/tapestry5/t5-alerts.js, classpath:org/apache/tapestry5/tapestry.js, classpath:org/apache/tapestry5/tapestry-console.js, classpath:org/apache/tapestry5/tree.js, classpath:org/apache/tapestry5/tapestry-messages.js] COMPRESSABLE lastModified: Wed Oct 26 11:11:35 PDT 2011 size: 349471>: java.util.EmptyStackException

          Show
          Howard M. Lewis Ship added a comment - Again, jetty doesn't do this, just Tomcat: I've modified the code to handle the exception and continue on by sending the non-minimized version of the resource. [ERROR] AssetsModule.ResourceMinimizer Exception minimizing StreamableResource<text/javascript stack=core, locale=en, resources= [classpath:org/apache/tapestry5/underscore_1_1_7.js, classpath:org/apache/tapestry5/scriptaculous_1_9_0/prototype.js, classpath:org/apache/tapestry5/scriptaculous_1_9_0/scriptaculous.js, classpath:org/apache/tapestry5/scriptaculous_1_9_0/effects.js, classpath:org/apache/tapestry5/t5-core.js, classpath:org/apache/tapestry5/t5-spi.js, classpath:org/apache/tapestry5/t5-prototype.js, classpath:org/apache/tapestry5/t5-init.js, classpath:org/apache/tapestry5/t5-pubsub.js, classpath:org/apache/tapestry5/t5-events.js, classpath:org/apache/tapestry5/t5-dom.js, classpath:org/apache/tapestry5/t5-console.js, classpath:org/apache/tapestry5/t5-ajax.js, classpath:org/apache/tapestry5/t5-formfragment.js, classpath:org/apache/tapestry5/t5-alerts.js, classpath:org/apache/tapestry5/tapestry.js, classpath:org/apache/tapestry5/tapestry-console.js, classpath:org/apache/tapestry5/tree.js, classpath:org/apache/tapestry5/tapestry-messages.js] COMPRESSABLE lastModified: Wed Oct 26 11:11:35 PDT 2011 size: 349471>: java.util.EmptyStackException
          Hide
          Howard M. Lewis Ship added a comment -

          More experimentation; running with "mvn jetty:run" and testing with curl, I can see that we get a minimized stream of JavaScript. This is good, since I was concerned that Underscore.js was in some way incompatible with YUICompressor.

          This probably means that there's a dependency problem ... probably about Rhino (the JS engine needed by YUICompressor).

          Show
          Howard M. Lewis Ship added a comment - More experimentation; running with "mvn jetty:run" and testing with curl, I can see that we get a minimized stream of JavaScript. This is good, since I was concerned that Underscore.js was in some way incompatible with YUICompressor. This probably means that there's a dependency problem ... probably about Rhino (the JS engine needed by YUICompressor).
          Hide
          Howard M. Lewis Ship added a comment -

          Doing some research:

          http://www.julienlecomte.net/blog/2008/10/80/

          Apparently, YUICompressor introduces some hacks to Rhino, and does some classloading tricks to make it work ... likely that is the problem, as Tomcat's classloaders are complicated and are well known to cause other problems (Tapestry has a number of hacks and patches to deal with Tomcat's class loaders).

          Show
          Howard M. Lewis Ship added a comment - Doing some research: http://www.julienlecomte.net/blog/2008/10/80/ Apparently, YUICompressor introduces some hacks to Rhino, and does some classloading tricks to make it work ... likely that is the problem, as Tomcat's classloaders are complicated and are well known to cause other problems (Tapestry has a number of hacks and patches to deal with Tomcat's class loaders).
          Hide
          Howard M. Lewis Ship added a comment -

          Tomcat 7.0.16 BTW.

          Show
          Howard M. Lewis Ship added a comment - Tomcat 7.0.16 BTW.
          Hide
          Hudson added a comment -

          Integrated in tapestry-trunk-freestyle #611 (See https://builds.apache.org/job/tapestry-trunk-freestyle/611/)
          TAP5-1729: Improve debugging output for streamable resources to clearly identify what is being compressed and/or minimized
          TAP5-1729: Sometimes YUICompressor can fail with java.util.EmptyStackException
          TAP5-1729: Sometimes YUICompressor can fail with java.util.EmptyStackException

          hlship : http://svn.apache.org/viewcvs.cgi/?root=Apache-SVN&view=rev&rev=1189339
          Files :

          • /tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/internal/services/assets/SRSCompressingInterceptor.java
          • /tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/internal/services/assets/StackAssetRequestHandler.java
          • /tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/internal/services/assets/StreamableResourceImpl.java
          • /tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/internal/services/assets/StreamableResourceSourceImpl.java
          • /tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/services/assets/StreamableResource.java
          • /tapestry/tapestry5/trunk/tapestry-yuicompressor/src/main/java/org/apache/tapestry5/internal/yuicompressor/AbstractMinimizer.java
          • /tapestry/tapestry5/trunk/tapestry-yuicompressor/src/test/java/yuicompressor/testapp/services/AppModule.java

          hlship : http://svn.apache.org/viewcvs.cgi/?root=Apache-SVN&view=rev&rev=1189338
          Files :

          • /tapestry/tapestry5/trunk/tapestry-yuicompressor/src/main/java/org/apache/tapestry5/internal/yuicompressor/JavaScriptResourceMinimizer.java

          hlship : http://svn.apache.org/viewcvs.cgi/?root=Apache-SVN&view=rev&rev=1189336
          Files :

          • /tapestry/tapestry5/trunk/tapestry-yuicompressor/src/main/java/org/apache/tapestry5/internal/yuicompressor/JavaScriptResourceMinimizer.java
          Show
          Hudson added a comment - Integrated in tapestry-trunk-freestyle #611 (See https://builds.apache.org/job/tapestry-trunk-freestyle/611/ ) TAP5-1729 : Improve debugging output for streamable resources to clearly identify what is being compressed and/or minimized TAP5-1729 : Sometimes YUICompressor can fail with java.util.EmptyStackException TAP5-1729 : Sometimes YUICompressor can fail with java.util.EmptyStackException hlship : http://svn.apache.org/viewcvs.cgi/?root=Apache-SVN&view=rev&rev=1189339 Files : /tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/internal/services/assets/SRSCompressingInterceptor.java /tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/internal/services/assets/StackAssetRequestHandler.java /tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/internal/services/assets/StreamableResourceImpl.java /tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/internal/services/assets/StreamableResourceSourceImpl.java /tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/services/assets/StreamableResource.java /tapestry/tapestry5/trunk/tapestry-yuicompressor/src/main/java/org/apache/tapestry5/internal/yuicompressor/AbstractMinimizer.java /tapestry/tapestry5/trunk/tapestry-yuicompressor/src/test/java/yuicompressor/testapp/services/AppModule.java hlship : http://svn.apache.org/viewcvs.cgi/?root=Apache-SVN&view=rev&rev=1189338 Files : /tapestry/tapestry5/trunk/tapestry-yuicompressor/src/main/java/org/apache/tapestry5/internal/yuicompressor/JavaScriptResourceMinimizer.java hlship : http://svn.apache.org/viewcvs.cgi/?root=Apache-SVN&view=rev&rev=1189336 Files : /tapestry/tapestry5/trunk/tapestry-yuicompressor/src/main/java/org/apache/tapestry5/internal/yuicompressor/JavaScriptResourceMinimizer.java
          Hide
          Andy Blower added a comment -

          I got and EmptyStackException in core.js running in Jetty using 5.3:

          ERROR [17:41:00,226] btpool0-3 (assets.AssetsModule.ResourceMinimizer:116) - Exception minimizing 'core' JavaScript stack, for locale en, resources=classpath:org/apache/tapestry5/underscore_1_1_7.js, classpath:org/apache/tapestry5/scriptaculous_1_9_0/prototype.js, classpath:org/apache/tapestry5/scriptaculous_1_9_0/scriptaculous.js, classpath:org/apache/tapestry5/scriptaculous_1_9_0/effects.js, classpath:org/apache/tapestry5/t5-core.js, classpath:org/apache/tapestry5/t5-spi.js, classpath:org/apache/tapestry5/t5-prototype.js, classpath:org/apache/tapestry5/t5-init.js, classpath:org/apache/tapestry5/t5-pubsub.js, classpath:org/apache/tapestry5/t5-events.js, classpath:org/apache/tapestry5/t5-dom.js, classpath:org/apache/tapestry5/t5-console.js, classpath:org/apache/tapestry5/t5-ajax.js, classpath:org/apache/tapestry5/t5-formfragment.js, classpath:org/apache/tapestry5/t5-alerts.js, classpath:org/apache/tapestry5/tapestry.js, classpath:org/apache/tapestry5/tapestry-console.js, classpath:org/apache/tapestry5/tree.js, classpath:org/apache/tapestry5/tapestry-messages.js: java.util.EmptyStackException
          ERROR [17:41:00,304] btpool0-4 (assets.AssetsModule.ResourceMinimizer:88) - (1970:41): invalid property id
          ERROR [17:41:00,304] btpool0-4 (assets.AssetsModule.ResourceMinimizer:88) - (1970:42): syntax error
          ERROR [17:41:00,304] btpool0-4 (assets.AssetsModule.ResourceMinimizer:88) - (1971:22): syntax error
          ERROR [17:41:00,320] btpool0-4 (assets.AssetsModule.ResourceMinimizer:88) - (1:0): Compilation produced 3 syntax errors.

          Show
          Andy Blower added a comment - I got and EmptyStackException in core.js running in Jetty using 5.3: ERROR [17:41:00,226] btpool0-3 (assets.AssetsModule.ResourceMinimizer:116) - Exception minimizing 'core' JavaScript stack, for locale en, resources=classpath:org/apache/tapestry5/underscore_1_1_7.js, classpath:org/apache/tapestry5/scriptaculous_1_9_0/prototype.js, classpath:org/apache/tapestry5/scriptaculous_1_9_0/scriptaculous.js, classpath:org/apache/tapestry5/scriptaculous_1_9_0/effects.js, classpath:org/apache/tapestry5/t5-core.js, classpath:org/apache/tapestry5/t5-spi.js, classpath:org/apache/tapestry5/t5-prototype.js, classpath:org/apache/tapestry5/t5-init.js, classpath:org/apache/tapestry5/t5-pubsub.js, classpath:org/apache/tapestry5/t5-events.js, classpath:org/apache/tapestry5/t5-dom.js, classpath:org/apache/tapestry5/t5-console.js, classpath:org/apache/tapestry5/t5-ajax.js, classpath:org/apache/tapestry5/t5-formfragment.js, classpath:org/apache/tapestry5/t5-alerts.js, classpath:org/apache/tapestry5/tapestry.js, classpath:org/apache/tapestry5/tapestry-console.js, classpath:org/apache/tapestry5/tree.js, classpath:org/apache/tapestry5/tapestry-messages.js: java.util.EmptyStackException ERROR [17:41:00,304] btpool0-4 (assets.AssetsModule.ResourceMinimizer:88) - (1970:41): invalid property id ERROR [17:41:00,304] btpool0-4 (assets.AssetsModule.ResourceMinimizer:88) - (1970:42): syntax error ERROR [17:41:00,304] btpool0-4 (assets.AssetsModule.ResourceMinimizer:88) - (1971:22): syntax error ERROR [17:41:00,320] btpool0-4 (assets.AssetsModule.ResourceMinimizer:88) - (1:0): Compilation produced 3 syntax errors.
          Hide
          Andy Blower added a comment -

          I also get these errors for most JS files, with or without stacking:

          ERROR [15:42:00,674] btpool0-6 (assets.AssetsModule.ResourceMinimizer:116) - Exception minimizing classpath:org/apache/tapestry5/scriptaculous_1_9_0/effects.js: String index out of range: 33173
          ERROR [15:43:16,267] btpool0-7 (assets.AssetsModule.ResourceMinimizer:116) - Exception minimizing classpath:org/apache/tapestry5/scriptaculous_1_9_0/scriptaculous.js: String index out of range: 990
          ERROR [15:43:28,314] btpool0-3 (assets.AssetsModule.ResourceMinimizer:116) - Exception minimizing classpath:org/apache/tapestry5/underscore_1_1_7.js: String index out of range: 15973
          ERROR [15:43:33,486] btpool0-1 (assets.AssetsModule.ResourceMinimizer:116) - Exception minimizing classpath:org/apache/tapestry5/scriptaculous_1_9_0/prototype.js: String index out of range: 135995
          ERROR [15:44:04,439] btpool0-4 (assets.AssetsModule.ResourceMinimizer:116) - Exception minimizing classpath:org/apache/tapestry5/t5-core.js: String index out of range: 381

          Looking into this issue I think there's an error on line 116 of JavaScriptResourceMinimizer with a misplaced bracket, and I think this is why I get such terse errors.

          private void recoverFromException(Exception ex, StreamableResource resource, Writer output) throws IOException

          { logger.error(String.format("Exception minimizing %s: %s", resource.getDescription(), InternalUtils.toMessage(ex), ex)); <---- this should be: toMessage(ex)),ex); streamUnminimized(resource, output); }
          Show
          Andy Blower added a comment - I also get these errors for most JS files, with or without stacking: ERROR [15:42:00,674] btpool0-6 (assets.AssetsModule.ResourceMinimizer:116) - Exception minimizing classpath:org/apache/tapestry5/scriptaculous_1_9_0/effects.js: String index out of range: 33173 ERROR [15:43:16,267] btpool0-7 (assets.AssetsModule.ResourceMinimizer:116) - Exception minimizing classpath:org/apache/tapestry5/scriptaculous_1_9_0/scriptaculous.js: String index out of range: 990 ERROR [15:43:28,314] btpool0-3 (assets.AssetsModule.ResourceMinimizer:116) - Exception minimizing classpath:org/apache/tapestry5/underscore_1_1_7.js: String index out of range: 15973 ERROR [15:43:33,486] btpool0-1 (assets.AssetsModule.ResourceMinimizer:116) - Exception minimizing classpath:org/apache/tapestry5/scriptaculous_1_9_0/prototype.js: String index out of range: 135995 ERROR [15:44:04,439] btpool0-4 (assets.AssetsModule.ResourceMinimizer:116) - Exception minimizing classpath:org/apache/tapestry5/t5-core.js: String index out of range: 381 Looking into this issue I think there's an error on line 116 of JavaScriptResourceMinimizer with a misplaced bracket, and I think this is why I get such terse errors. private void recoverFromException(Exception ex, StreamableResource resource, Writer output) throws IOException { logger.error(String.format("Exception minimizing %s: %s", resource.getDescription(), InternalUtils.toMessage(ex), ex)); <---- this should be: toMessage(ex)),ex); streamUnminimized(resource, output); }
          Hide
          Howard M. Lewis Ship added a comment -

          Andy; I've fixed the reporting problem as a seperate issue: TAP5-1785.

          Show
          Howard M. Lewis Ship added a comment - Andy; I've fixed the reporting problem as a seperate issue: TAP5-1785 .
          Hide
          Hudson added a comment -

          Integrated in tapestry-trunk-freestyle #640 (See https://builds.apache.org/job/tapestry-trunk-freestyle/640/)
          TAP5-1729: Sometimes YUICompressor can fail with java.util.EmptyStackException

          hlship : http://svn.apache.org/viewcvs.cgi/?root=Apache-SVN&view=rev&rev=1212544
          Files :

          • /tapestry/tapestry5/trunk/tapestry-yuicompressor/src/main/java/org/apache/tapestry5/internal/yuicompressor/JavaScriptResourceMinimizer.java
          Show
          Hudson added a comment - Integrated in tapestry-trunk-freestyle #640 (See https://builds.apache.org/job/tapestry-trunk-freestyle/640/ ) TAP5-1729 : Sometimes YUICompressor can fail with java.util.EmptyStackException hlship : http://svn.apache.org/viewcvs.cgi/?root=Apache-SVN&view=rev&rev=1212544 Files : /tapestry/tapestry5/trunk/tapestry-yuicompressor/src/main/java/org/apache/tapestry5/internal/yuicompressor/JavaScriptResourceMinimizer.java
          Hide
          Paul Stanton added a comment -

          i'm getting this, but i'm also getting an exception (proceeding this) minimising one of my own files (which doesn't have any compile errors):

          2012-01-27 16:26:21,422 TP-Processor7 ERROR org.apache.tapestry5.services.assets.AssetsModule.ResourceMinimizer - Exception minimizing classpath:package/pages/Index.js: String index out of range: 734
          java.lang.StringIndexOutOfBoundsException: String index out of range: 734
          at java.lang.String.substring(String.java:1955)
          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.<init>(JavaScriptCompressor.java:533)
          at org.apache.tapestry5.internal.yuicompressor.JavaScriptResourceMinimizer.doMinimize(JavaScriptResourceMinimizer.java:98)
          at org.apache.tapestry5.internal.yuicompressor.AbstractMinimizer$1.perform(AbstractMinimizer.java:67)
          at org.apache.tapestry5.internal.TapestryInternalUtils$5.run(TapestryInternalUtils.java:582)

          I have disabled the feature.

          Show
          Paul Stanton added a comment - i'm getting this, but i'm also getting an exception (proceeding this) minimising one of my own files (which doesn't have any compile errors): 2012-01-27 16:26:21,422 TP-Processor7 ERROR org.apache.tapestry5.services.assets.AssetsModule.ResourceMinimizer - Exception minimizing classpath:package/pages/Index.js: String index out of range: 734 java.lang.StringIndexOutOfBoundsException: String index out of range: 734 at java.lang.String.substring(String.java:1955) 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.<init>(JavaScriptCompressor.java:533) at org.apache.tapestry5.internal.yuicompressor.JavaScriptResourceMinimizer.doMinimize(JavaScriptResourceMinimizer.java:98) at org.apache.tapestry5.internal.yuicompressor.AbstractMinimizer$1.perform(AbstractMinimizer.java:67) at org.apache.tapestry5.internal.TapestryInternalUtils$5.run(TapestryInternalUtils.java:582) I have disabled the feature.
          Hide
          Antal van Kalleveen added a comment -

          The solution, for me (and others) is to use the 2.4.7 version of the yuicompressor jar as follows:

          <!-- css/ js minification lib -->
          <dependency>
          <groupId>org.apache.tapestry</groupId>
          <artifactId>tapestry-yuicompressor</artifactId>
          <version>$

          {tapestry-release-version}

          </version>
          <exclusions>
          <exclusion>
          <Unable to render embedded object: File (-- contains some Maven bug) not found. -->
          <artifactId>yuicompressor</artifactId>
          <groupId>com.yahoo.platform.yui</groupId>
          </exclusion>
          </exclusions>
          </dependency>
          <dependency>
          <groupId>com.yahoo.platform.yui</groupId>
          <artifactId>yuicompressor</artifactId>
          <version>2.4.7</version>
          </dependency>

          Unfortunately the 2.4.7 does not appear (yet) in any maven repo, so you have to download it by yourselves here:

          http://yuilibrary.com/download/yuicompressor/

          I have it now working on tomcat 5.5 with a maven build war.

          Show
          Antal van Kalleveen added a comment - The solution, for me (and others) is to use the 2.4.7 version of the yuicompressor jar as follows: <!-- css/ js minification lib --> <dependency> <groupId>org.apache.tapestry</groupId> <artifactId>tapestry-yuicompressor</artifactId> <version>$ {tapestry-release-version} </version> <exclusions> <exclusion> < Unable to render embedded object: File (-- contains some Maven bug) not found. --> <artifactId>yuicompressor</artifactId> <groupId>com.yahoo.platform.yui</groupId> </exclusion> </exclusions> </dependency> <dependency> <groupId>com.yahoo.platform.yui</groupId> <artifactId>yuicompressor</artifactId> <version>2.4.7</version> </dependency> Unfortunately the 2.4.7 does not appear (yet) in any maven repo, so you have to download it by yourselves here: http://yuilibrary.com/download/yuicompressor/ I have it now working on tomcat 5.5 with a maven build war.
          Hide
          Dragan Sahpaski added a comment -

          Thanks that one worked just fine.

          Cheers

          Show
          Dragan Sahpaski added a comment - Thanks that one worked just fine. Cheers
          Hide
          Kalle Korhonen added a comment -

          The problem is that for our build 2.4.7 pretty much needs to exist in some repo because we cannot host the and build that source on Apache's infra. You can find some Maven repos with 2.4.7:
          https://www.escidoc.org/artifactory/maven.jahia.org/com/yahoo/platform/yui/yuicompressor/2.4.7/
          (just need to configure a new repo, same GAV coordinates)
          http://maven-play-plugin.googlecode.com/svn/mavenrepo/releases/com/google/code/maven-play-plugin/com/yahoo/platform/yui/yuicompressor/2.4.7/
          (note the different GAV coordinates)
          Any preferences? Agree we should fix this, since 2.4.3 - 2.4.6 version are quite broken.

          Show
          Kalle Korhonen added a comment - The problem is that for our build 2.4.7 pretty much needs to exist in some repo because we cannot host the and build that source on Apache's infra. You can find some Maven repos with 2.4.7: https://www.escidoc.org/artifactory/maven.jahia.org/com/yahoo/platform/yui/yuicompressor/2.4.7/ (just need to configure a new repo, same GAV coordinates) http://maven-play-plugin.googlecode.com/svn/mavenrepo/releases/com/google/code/maven-play-plugin/com/yahoo/platform/yui/yuicompressor/2.4.7/ (note the different GAV coordinates) Any preferences? Agree we should fix this, since 2.4.3 - 2.4.6 version are quite broken.
          Hide
          Howard M. Lewis Ship added a comment -

          Trickiest part was getting the tapestry-yuicompressor POM to include the repository that the customized yuicompressor can be drawn from.

          Show
          Howard M. Lewis Ship added a comment - Trickiest part was getting the tapestry-yuicompressor POM to include the repository that the customized yuicompressor can be drawn from.
          Hide
          Hudson added a comment -

          Integrated in tapestry-trunk-freestyle #977 (See https://builds.apache.org/job/tapestry-trunk-freestyle/977/)
          TAP5-1729: Sometimes YUICompressor can fail with java.util.EmptyStackException (Revision 95bc7c6b484eeb234d056f5e27a579e8ee9a8fda)

          Result = FAILURE
          hlship :
          Files :

          • tapestry-yuicompressor/build.gradle
          Show
          Hudson added a comment - Integrated in tapestry-trunk-freestyle #977 (See https://builds.apache.org/job/tapestry-trunk-freestyle/977/ ) TAP5-1729 : Sometimes YUICompressor can fail with java.util.EmptyStackException (Revision 95bc7c6b484eeb234d056f5e27a579e8ee9a8fda) Result = FAILURE hlship : Files : tapestry-yuicompressor/build.gradle

            People

            • Assignee:
              Howard M. Lewis Ship
              Reporter:
              Howard M. Lewis Ship
            • Votes:
              6 Vote for this issue
              Watchers:
              6 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development