我该如何识别资产中的错误点:Symfony2的转储?

时间:2014-12-03 11:03:11

标签: javascript jquery symfony yui assetic

这是一个错误的资产:在Symfony2中转储。

[Assetic\Exception\FilterException]                                                                                                                                                      
  An error occurred while running:                                                                                                                                                         
  '/usr/bin/java' '-jar' '/path/to/java/yuicompressor-2.4.8.jar' '--charset' 'UTF-8' '-o' '/tmp/YUI-OUT-NynbGd' '--type' 'js' '/tmp/YUI-IN-2GZ9rr'  
  Error Output:                                                                                                                                                                            
  Exception in thread "main" java.lang.reflect.InvocationTargetException                                                                                                                   
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)                                                                                                                          
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)                                                                                                        
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)                                                                                                
    at java.lang.reflect.Method.invoke(Method.java:606)                                                                                                                                     
    at com.yahoo.platform.yui.compressor.Bootstrap.main(Bootstrap.java:21)                                                                                                                  
  Caused by: java.lang.IndexOutOfBoundsException: Index: 0, Size: 0                                                                                                                        
    at java.util.ArrayList.rangeCheck(ArrayList.java:635)                                                                                                                                   
    at java.util.ArrayList.get(ArrayList.java:411)                                                                                                                                          
    at com.yahoo.platform.yui.compressor.JavaScriptCompressor.getToken(JavaScriptCompressor.java:578)                                                                                       
    at com.yahoo.platform.yui.compressor.JavaScriptCompressor.printSymbolTree(JavaScriptCompressor.java:1094)                                                                               
    at com.yahoo.platform.yui.compressor.JavaScriptCompressor.compress(JavaScriptCompressor.java:556)                                                                                       
    at com.yahoo.platform.yui.compressor.YUICompressor.main(YUICompressor.java:186)                                                                                                         
    ... 5 more
  Input:

我认为错误是脚本的某个地方。

我该如何识别错误点?

1 个答案:

答案 0 :(得分:0)

在大多数情况下,问题是由参数或路径引起的。我之前遇到过与资产类似的问题,然后我设法使用:

来解决它

通常你必须使用assetic.java.bin或assetic.filter.yui_js.jar

编辑:看起来您忘记设置yui压缩器路径:" /path/to/java/yuicompressor-2.4.8.jar"