I implement one simple application and package it into a jar file, the web application server is weblogic 5.1. In the weblogic.properties, I add the mime type for jnlp and the Java Web Start is successfully installed on my client machine. When I use Java Web Start to load my application, the following error happens: java.lang.ClassFormatError: Test (Bad magic number) at java.lang.ClassLoader.defineClass0(Native Method) at java.lang.ClassLoader.defineClass(ClassLoader.java:486) at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:111) at com.sun.jnlp.JNLPClassLoader.defineClass(Unknown Source) at com.sun.jnlp.JNLPClassLoader.access$1(Unknown Source) at com.sun.jnlp.JNLPClassLoader$1.run(Unknown Source) at java.security.AccessController.doPrivileged(Native Method) at com.sun.jnlp.JNLPClassLoader.findClass(Unknown Source) at java.lang.ClassLoader.loadClass(ClassLoader.java:297) at java.lang.ClassLoader.loadClass(ClassLoader.java:253) at com.sun.javaws.Launcher.continueLaunch(Unknown Source) at com.sun.javaws.Launcher.handleApplicationDesc(Unknown Source) at com.sun.javaws.Launcher.handleLaunchFile(Unknown Source) at com.sun.javaws.Launcher.run(Unknown Source) at java.lang.Thread.run(Thread.java:484) I don't know why, could you please give me some help?
hello Joy, this error tells you that something is wrong with your class declaration.
public class ClassFormatError extends LinkageError Thrown when the Java Virtual Machine attempts to read a class file and determines that the file is malformed or otherwise cannot be interpreted as a class file.
it would help if you would paste the code where you declare the class Test. Chantal
As I recall, class files generated by some older java compilers violate the class file format in ways that are not tolerated by some 1.3.x JVMs, resulting in this message from those 1.3.x JVMs. I'm not sure whether this is the problem affecting you. I think I saw the problem described in the Sun 1.3 release notes.
Joined: Jul 03, 2002
Thank you all, I just solved this problem and here are all the actions I took. 1. Restart the computer 2. Clear the Java Web Start cache 3. Recompile the program using jdk1.3.x and archive it to jar file Then everything is ok.