Running Serviio over GCJ in a OpenMediaVault Home Media CE
Hello guys,
I have hacked my IOmega Home Media Cloud Edition with a OpenMediaVault distro.
The problem is that both Sun JDK/JRE and OpenJDK/JRE binary packages don`t work. They both yield "Segmentation Fault" regardless of the version I tried (Java 6 or 7).
I was having the same issue with FFMPEG and VLC. So I downloaded the source and built then (also the dependency libraries) and the now work just fine.
I was about to try the same (build) openJDK as well, but I realized that it needs a bootstrap JDK. Also tried IcedTea, but the same restriction applies, as it needs ANT as well. Cross-compiling those to my ARM (which is a NAS 7820 http://iomega.nas-central.org/wiki/Cate ... e_Media_CE) seems to be an Hercules Labour.
So I decided trying GCJ-JDK. And it works with no issues. But it looks like the Class Loader is a bit different. I don`t do any java programming on the last 5 years I think. Maybe you can help me.
Here is what I get:
Apparently it is not looking properly at /root/serviio-1.0.1/lib/*. Then I tried the hard way. I expanded lib/*:
Then I saw that org.serviio.util.JdbcUtils is on the same main JAR as org.serviio.MediaServer:
Does anybody tried GCJ before and faced a similar issue?
Regards
I have hacked my IOmega Home Media Cloud Edition with a OpenMediaVault distro.
The problem is that both Sun JDK/JRE and OpenJDK/JRE binary packages don`t work. They both yield "Segmentation Fault" regardless of the version I tried (Java 6 or 7).
I was having the same issue with FFMPEG and VLC. So I downloaded the source and built then (also the dependency libraries) and the now work just fine.
I was about to try the same (build) openJDK as well, but I realized that it needs a bootstrap JDK. Also tried IcedTea, but the same restriction applies, as it needs ANT as well. Cross-compiling those to my ARM (which is a NAS 7820 http://iomega.nas-central.org/wiki/Cate ... e_Media_CE) seems to be an Hercules Labour.
So I decided trying GCJ-JDK. And it works with no issues. But it looks like the Class Loader is a bit different. I don`t do any java programming on the last 5 years I think. Maybe you can help me.
Here is what I get:
- Code:
root@hmnhdce-omv:~/serviio-1.0.1/bin# java -Djava.net.preferIPv4Stack=true -Djava.awt.headless=true -Dderby.system.home=/root/serviio-1.0.1/library -Dserviio.home=/root/serviio-1.0.1 -classpath /root/serviio-1.0.1/lib/*:/root/serviio-1.0.1/config org.serviio.MediaServer
Exception in thread "main" java.lang.NoClassDefFoundError: org.serviio.MediaServer
at gnu.java.lang.MainThread.run(libgcj.so.10)
Caused by: java.lang.ClassNotFoundException: org.serviio.MediaServer not found in gnu.gcj.runtime.SystemClassLoader{urls=[file:/root/serviio-1.0.1/config/], parent=gnu.gcj.runtime.ExtensionClassLoader{urls=[], parent=null}}
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)
root@hmnhdce-omv:~/serviio-1.0.1/bin#
Apparently it is not looking properly at /root/serviio-1.0.1/lib/*. Then I tried the hard way. I expanded lib/*:
- Code:
root@hmnhdce-omv:~/serviio-1.0.1/bin# java -Djava.net.preferIPv4Stack=true -Djava.awt.headless=true -Dderby.system.home=/root/serviio-1.0.1/library -Dserviio.home=/root/serviio-1.0.1 -classpath /root/serviio-1.0.1/lib/commons-codec.jar:/root/serviio-1.0.1/lib/commons-io.jar:/root/serviio-1.0.1/lib/concurrent.jar:/root/serviio-1.0.1/lib/derby.jar:/root/serviio-1.0.1/lib/freemarker.jar:/root/serviio-1.0.1/lib/groovy-all.jar:/root/serviio-1.0.1/lib/gson.jar:/root/serviio-1.0.1/lib/httpcore.jar:/root/serviio-1.0.1/lib/jaudiotagger.jar:/root/serviio-1.0.1/lib/jcl-over-slf4j.jar:/root/serviio-1.0.1/lib/jcs.jar:/root/serviio-1.0.1/lib/jdom.jar:/root/serviio-1.0.1/lib/jul-to-slf4j.jar:/root/serviio-1.0.1/lib/log4j.jar:/root/serviio-1.0.1/lib/org.restlet.ext.gson.jar:/root/serviio-1.0.1/lib/org.restlet.ext.net.jar:/root/serviio-1.0.1/lib/org.restlet.ext.xstream.jar:/root/serviio-1.0.1/lib/org.restlet.jar:/root/serviio-1.0.1/lib/padlock.jar:/root/serviio-1.0.1/lib/rome.jar:/root/serviio-1.0.1/lib/rome-modules.jar:/root/serviio-1.0.1/lib/sanselan.jar:/root/serviio-1.0.1/lib/serviio-client.jar:/root/serviio-1.0.1/lib/serviio.jar:/root/serviio-1.0.1/lib/serviio-media-browser.jar:/root/serviio-1.0.1/lib/slf4j-api.jar:/root/serviio-1.0.1/lib/slf4j-log4j12.jar:/root/serviio-1.0.1/lib/winp.jar:/root/serviio-1.0.1/lib/xstream.jar:/root/serviio-1.0.1/config org.serviio.MediaServer
Exception in thread "main" java.lang.NoClassDefFoundError: org.serviio.util.JdbcUtils
at java.lang.Class.initializeClass(libgcj.so.10)
at org.serviio.update.dao.DBLogDAOImpl.isScriptPresent(DBLogDAOImpl.java:62)
at org.serviio.update.DBSchemaUpdateExecutor.updateDBSchema(DBSchemaUpdateExecutor.java:56)
at org.serviio.MediaServer.main(MediaServer.java:108)
Caused by: java.lang.ClassNotFoundException: java.sql.SQLDataException not found in gnu.gcj.runtime.SystemClassLoader{urls=[file:/root/serviio-1.0.1/lib/commons-codec.jar,file:/root/serviio-1.0.1/lib/commons-io.jar,file:/root/serviio-1.0.1/lib/concurrent.jar,file:/root/serviio-1.0.1/lib/derby.jar,file:/root/serviio-1.0.1/lib/freemarker.jar,file:/root/serviio-1.0.1/lib/groovy-all.jar,file:/root/serviio-1.0.1/lib/gson.jar,file:/root/serviio-1.0.1/lib/httpcore.jar,file:/root/serviio-1.0.1/lib/jaudiotagger.jar,file:/root/serviio-1.0.1/lib/jcl-over-slf4j.jar,file:/root/serviio-1.0.1/lib/jcs.jar,file:/root/serviio-1.0.1/lib/jdom.jar,file:/root/serviio-1.0.1/lib/jul-to-slf4j.jar,file:/root/serviio-1.0.1/lib/log4j.jar,file:/root/serviio-1.0.1/lib/org.restlet.ext.gson.jar,file:/root/serviio-1.0.1/lib/org.restlet.ext.net.jar,file:/root/serviio-1.0.1/lib/org.restlet.ext.xstream.jar,file:/root/serviio-1.0.1/lib/org.restlet.jar,file:/root/serviio-1.0.1/lib/padlock.jar,file:/root/serviio-1.0.1/lib/rome.jar,file:/root/serviio-1.0.1/lib/rome-modules.jar,file:/root/serviio-1.0.1/lib/sanselan.jar,file:/root/serviio-1.0.1/lib/serviio-client.jar,file:/root/serviio-1.0.1/lib/serviio.jar,file:/root/serviio-1.0.1/lib/serviio-media-browser.jar,file:/root/serviio-1.0.1/lib/slf4j-api.jar,file:/root/serviio-1.0.1/lib/slf4j-log4j12.jar,file:/root/serviio-1.0.1/lib/winp.jar,file:/root/serviio-1.0.1/lib/xstream.jar,file:/root/serviio-1.0.1/config/], parent=gnu.gcj.runtime.ExtensionClassLoader{urls=[], parent=null}}
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 java.lang.Class.forName(libgcj.so.10)
at java.lang.Class.initializeClass(libgcj.so.10)
...3 more
root@hmnhdce-omv:~/serviio-1.0.1/bin#
Then I saw that org.serviio.util.JdbcUtils is on the same main JAR as org.serviio.MediaServer:
Does anybody tried GCJ before and faced a similar issue?
Regards