aspose file tools*
The moose likes JNLP and Web Start and the fly likes Help: java.lang.ClassFormatError encountered Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Java » JNLP and Web Start
Bookmark "Help: java.lang.ClassFormatError encountered" Watch "Help: java.lang.ClassFormatError encountered" New topic
Author

Help: java.lang.ClassFormatError encountered

Joy Chen
Greenhorn

Joined: Jul 03, 2002
Posts: 3
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?
Rob Ross
Bartender

Joined: Jan 07, 2002
Posts: 2205
"pisces",
Please change your name to comply with the naming policy to which you agreed when you registered here..

For your publicly displayed name,
use a first name, a space, and a last name.

You can change your name here:
here

You can also find the naming policy here:
http://www.javaranch.com/name.jsp
Thank You!


Rob
SCJP 1.4
Chantal Ackermann
Ranch Hand

Joined: Sep 28, 2000
Posts: 508
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
John Dale
Ranch Hand

Joined: Feb 22, 2001
Posts: 399
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.
Joy Chen
Greenhorn

Joined: Jul 03, 2002
Posts: 3
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.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Help: java.lang.ClassFormatError encountered
 
Similar Threads
Jobfuscate
Accesing an EJB code in applet using JBOSS
Reflection and magic value
Netscape 6.2 configure with client jar files
Applet in JSP