LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   Java Exceptions On FC4 (https://www.linuxquestions.org/questions/linux-software-2/java-exceptions-on-fc4-362452/)

salvatore 09-11-2005 04:49 PM

Java Exceptions On FC4
 
Im attempting to run a Java application called JavaHMO on FC4 and haven't been able to debug the exceptions Im seeing in the logs. Here's the relevant text from JVM log:

STATUS | wrapper | 2005/09/10 20:51:40 | --> Wrapper Started as Console
STATUS | wrapper | 2005/09/10 20:51:41 | Launching a JVM...
INFO | jvm 1 | 2005/09/10 20:51:42 | Exception in thread "main"
INFO | jvm 1 | 2005/09/10 20:51:42 | java.lang.NoClassDefFoundError: while resolving class: org.tanukisoftware.wrapper.resources.ResourceManager
INFO | jvm 1 | 2005/09/10 20:51:42 | at java.lang.VMClassLoader.transformException(java.lang.Class, java.lang.Throwable) (/usr/lib/libgcj.so.6.0.0)
INFO | jvm 1 | 2005/09/10 20:51:42 | at java.lang.VMClassLoader.resolveClass(java.lang.Class) (/usr/lib/libgcj.so.6.0.0)
INFO | jvm 1 | 2005/09/10 20:51:42 | at java.lang.Class.initializeClass() (/usr/lib/libgcj.so.6.0.0)
INFO | jvm 1 | 2005/09/10 20:51:42 | at org.tanukisoftware.wrapper.WrapperManager.<clinit>() (Unknown Source)
INFO | jvm 1 | 2005/09/10 20:51:42 | at java.lang.Class.initializeClass() (/usr/lib/libgcj.so.6.0.0)
INFO | jvm 1 | 2005/09/10 20:51:42 | at org.lnicholls.javahmo.server.ServiceWrapper.main(java.lang.S tring[]) (Unknown Source)
INFO | jvm 1 | 2005/09/10 20:51:42 | at gnu.java.lang.MainThread.call_main() (/usr/lib/libgcj.so.6.0.0)
INFO | jvm 1 | 2005/09/10 20:51:42 | at gnu.java.lang.MainThread.run() (/usr/lib/libgcj.so.6.0.0)
INFO | jvm 1 | 2005/09/10 20:51:42 | Caused by: java.lang.ClassNotFoundException: com.sun.image.codec.jpeg.JPEGImageDecoder not found in gnu.gcj.runtime.SystemClassLoader{urls=[file:/usr/share/javaHMO/lib/xercesImpl.jar,file:./,file:/usr/share/javaHMO/lib/silib.jar,file:/usr/share/javaHMO/lib/jdai.jar,file:./,file:/usr/share/javaHMO/lib/jcaching.jar,file:/usr/share/javaHMO/lib/commons-net.jar,file:./,file:/usr/share/javaHMO/lib/jicyshout.jar,file:/usr/share/javaHMO/lib/mp3dings.jar,file:./,file:/usr/share/javaHMO/lib/jiu.jar,file:/usr/share/javaHMO/lib/jshortcut.jar,file:./,file:/usr/share/javaHMO/lib/pja.jar,file:/usr/share/javaHMO/lib/commons-betwixt.jar,file:./,file:/usr/share/javaHMO/lib/httpunit.jar,file:/usr/share/javaHMO/lib/jdom.jar,file:./,file:/usr/share/javaHMO/lib/activation.jar,file:/usr/share/javaHMO/lib/commons-collections.jar,file:./,file:/usr/share/javaHMO/lib/Tidy.jar,file:/usr/share/javaHMO/lib/javahmo.jar,file:./,file:/usr/share/javaHMO/lib/looks.jar,file:/usr/share/javaHMO/lib/calpahtml.jar,file:./,file:/usr/share/javaHMO/lib/js.jar,file:/usr/share/javaHMO/lib/xml-apis.jar,file:./,file:/usr/share/javaHMO/lib/commons-digester.jar,file:/usr/share/javaHMO/lib/forms.jar,file:./,file:/usr/share/javaHMO/lib/org.mortbay.jetty.jar,file:/usr/share/javaHMO/lib/mytunes.jar,file:./,file:/usr/share/javaHMO/lib/MHS.jar,file:/usr/share/javaHMO/lib/jasper-compiler.jar,file:./,file:/usr/share/javaHMO/lib/javax.servlet.jar,file:/usr/share/javaHMO/lib/log4j.jar,file:./,file:/usr/share/javaHMO/lib/xalan.jar,file:/usr/share/javaHMO/lib/wrapper.jar,file:./,file:/usr/share/javaHMO/lib/commons-lang.jar,file:/usr/share/javaHMO/lib/informa.jar,file:./,file:/usr/share/javaHMO/lib/jasper-runtime.jar,file:/usr/share/javaHMO/lib/concurrent.jar,file:./,file:/usr/share/javaHMO/lib/commons-logging.jar,file:/usr/share/javaHMO/lib/commons-beanutils.jar,file:./,file:/usr/share/javaHMO/lib/newsgreed.jar,file:/usr/share/javaHMO/lib/mail.jar,file:./,file:/usr/share/javaHMO/lib/commons-httpclient.jar], parent=gnu.gcj.runtime.ExtensionClassLoader{urls=[], parent=null}}
INFO | jvm 1 | 2005/09/10 20:51:42 | at java.net.URLClassLoader.findClass(java.lang.String) (/usr/lib/libgcj.so.6.0.0)
INFO | jvm 1 | 2005/09/10 20:51:42 | at java.lang.ClassLoader.loadClass(java.lang.String, boolean) (/usr/lib/libgcj.so.6.0.0)
INFO | jvm 1 | 2005/09/10 20:51:42 | at java.lang.ClassLoader.loadClass(java.lang.String) (/usr/lib/libgcj.so.6.0.0)
INFO | jvm 1 | 2005/09/10 20:51:42 | at java.lang.Class.forName(java.lang.String, boolean, java.lang.ClassLoader) (/usr/lib/libgcj.so.6.0.0)
INFO | jvm 1 | 2005/09/10 20:51:42 | ...7 more
ERROR | wrapper | 2005/09/10 20:51:42 | JVM exited while loading the application.
STATUS | wrapper | 2005/09/10 20:51:44 | Shutting down.
STATUS | wrapper | 2005/09/10 20:51:44 | <-- Wrapper Stopped

Im nowhere near a Java programmer, and all of my searches at Google, www.tivocommunity.com and www.dealdatabase.com/forum/ have been unsuccessful.

Any kick in the right direction would be appreciated.
Thanks.

ilikejam 09-11-2005 05:03 PM

Hi.

The problem is that the Java environment you're using (GCJ) is still a work in progress.
Install the Sun JVM (or SDK, if you want to program yourself), and try running it again.

http://java.sun.com

Dave

salvatore 09-11-2005 06:52 PM

Thanks for the quick reply Dave. Ive previosly installed Java's JRE and JAI as required for the JavaHMO app, yet its still failing when I try to start it.

You mention the virtual machine (JVM), but it looks like that's a part of the runtime environment (JRE) package.

Here's the output from 'java -version', if that helps:
[root@tiefighter java]# java -version
java version "1.4.2"
gij (GNU libgcj) version 4.0.1 20050727 (Red Hat 4.0.1-5)

Copyright (C) 2005 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

Thanks again.

ilikejam 09-11-2005 07:00 PM

Have you added the new Java's bin directory to your path? If not, do so. If you already have, then you'll have to add it at the front of $PATH, not the end, so that the new java executable is found before the GCJ one.

salvatore 09-11-2005 07:49 PM

The JavaHMO startup script attempts to do that for me:

<snip from /etc/init.d/JavaHMO>
for java in `ls /usr/java 2>/dev/null` ; do
if [ "${java%j2re*}" == "" ] ; then
export JAVA_HOME=/usr/java/$java
break
echo $JAVA_HOME
elif [ "${java%j2sdk*}" == "" ] ; then
export JAVA_HOME=/usr/java/$java/jre
echo $JAVA_HOME
break
fi
done

if [ "$JAVA_HOME" == "" ] ; then
for java in `ls /usr/local/java 2>/dev/null` ; do
if [ "${java%j2re*}" == "" ] ; then
export JAVA_HOME=/usr/local/java/$java
break
elif [ "${java%j2sdk*}" == "" ] ; then
export JAVA_HOME=/usr/local/java/$java/jre
break
fi
done
fi
</snip>

The JRE is in /usr/java/j2re1.4.2_09/
Here's the current value of PATH:

[root@tiefighter log]# echo $PATH
/usr/kerberos/sbin:/usr/kerberos/bin:/usr/local/sbin:/usr/local/bin:/sbin:/bin:
/usr/sbin:/usr/bin:/usr/X11R6/bin:/root/bin:/usr/java

ilikejam 09-11-2005 07:56 PM

JAVA_HOME and PATH both have to be set.

Try doing:
export PATH=/usr/java/j2re1.4.2_09/bin:$PATH

Then try running your program again.

salvatore 09-11-2005 08:21 PM

Cool, this appears to be working.

Ive altered the script used to start the service so it calls the export PATH line each time its run,
as well as logged out and back in to make sure it wasnt a session-only thing.

Thanks for the good quick work Dave.

ilikejam 09-11-2005 08:35 PM

If you want the Sun Java runtime to be the default for everyone, look for "pathmunge /usr/X11R6/bin after" in /etc/profile and add the following line just after it:

pathmunge /usr/java/j2re1.4.2_09/bin

(Log out and log back in for this to take effect).

That should remove the need to modify $PATH before you run any Java apps.

Dave

salvatore 09-11-2005 08:40 PM

Done. Thanks for the tip.


All times are GMT -5. The time now is 01:15 PM.