Search code examples
javaphpsymfonyassetic

Java error when running yuicompressor


I'm running the YUI compressor jar fine on my local dev server, but on the web server I'm getting this error:

Fatal error: Uncaught exception 'Assetic\Exception\FilterException' 
with message 'An error occurred while running: 
'/usr/bin/java' '-jar' 
'/path/to/includes/resources/java/yuicompressor-2.4.6.jar' 
'-o' '/tmp/YUI-OUT-FGs8hh' '--type' 'js' '/tmp/YUI-IN-54MHwK' 
Error Output: Exception in thread "main" java.lang.NullPointerException 
at java.lang.VMClassLoader.defineClass(libgcj.so.10) at 
java.lang.ClassLoader.defineClass(libgcj.so.10) at 
java.security.SecureClassLoader.defineClass(libgcj.so.10) at 
java.net.URLClassLoader.findClass(libgcj.so.10) at 
gnu.gcj.runtime.SystemClassLoader.findClass(libgcj.so.10) at 
java.lang.ClassLoader.loadClass(libgcj.so.10) at 
java.lang.ClassLoader.loadClass(libgcj.so.10) at 
gnu.java.lang.MainThread.run(libgcj.so.10) 
Input: /*! * jQuery JavaScript Library v1.7.2 * 
http://jquery.com/ * * Copyright 2011, John Resig * 
Dual licensed under the MIT or GPL Version 2 licenses. * 
http://jquery.org/license * * Incl in 
/path/to/includes/modules/Assetic/Exception/FilterException.php 
on line 40

I already checked with the server support, and they said to contact the developers. Any clue as to what this might be? I've also posted on Github, but no luck.

This is the Java version:

# java -version
java version "1.6.0_37"
Java(TM) SE Runtime Environment (build 1.6.0_37-b06)
Java HotSpot(TM) Server VM (build 20.12-b01, mixed mode)

Solution

  • See this similar thread or this discussion - basically, you should contact your server support to change their java runtime environment to be something proper instead of GCJ. Using a regular JDK would solve this.

    If they insist on using GCJ, they at least need to fix it to be runnable.