Solved

ClassFormatError

Posted on 1998-08-24
3
148 Views
Last Modified: 2011-10-03
What's the reason for the following error message of the Navigator?

# Applet debug level set to 9
# stopApplet: contextID=2 appletID=13800992 parentMWContext=13682640
# Stopping applet: pm, appletID=13800992, contextID=2
# destroyApplet: contextID=2 appletID=13800992
# Destroying applet: pm, appletID=13800992, contextID=2
#     total applets=1
#   destroying context for contextID 2
# Destroying applet context: http://Storm/Pm/pm.html, contextID=2
# Destroying AppletFrame without disposing: netscape.applet.DerivedAppletFrame[frame2,0,0,850x300,hidden,layout=java.awt.BorderLayout,resizable,title=]
#   frameMWContext=13682640
# Destroying all applets: http://Storm/Pm/pm.html, contextID=2
# initApplet: contextID=2 appletID=13771952 parentContext=13682640 frameContext=13682640
# New applet context: http://Storm/Pm/pm.html, contextID=2
# Initializing applet: pm.class, appletID=13771952, contextID=2
#   docURL=http://Storm/Pm/pm.html reloadClasses=true
#     total applets=2
#     New applet: 13771952 at http://Storm/Pm/ width=850 height=300 hspace=0 vspace=0 align=baseline codebase=http://Storm/Pm/ code=pm.class
# startApplet: contextID=2 appletID=13771952 newFrameMWContext=13682640
# Starting applet: pm, appletID=13771952, contextID=2
#   preventing reuse of netscape.applet.AppletClassLoader@800cda6
#   new class loader netscape.applet.AppletClassLoader@8008b86
#      context = netscape.applet.MozillaAppletContext@800d660
#      codebase = http://Storm/Pm/
# Loading class pm
# Fetching http://Storm/Pm/pm.class
# Destroying AppletFrame without disposing: netscape.applet.DerivedAppletFrame[frame2,0,0,850x300,hidden,layout=java.awt.BorderLayout,resizable,title=]
# Applet exception: error: java.lang.ClassFormatError: Wrong class name inside class file
java.lang.ClassFormatError: Wrong class name inside class file
  at java.lang.ClassLoader.defineClass(Compiled Code)
  at netscape.applet.AppletClassLoader.loadClass(Compiled Code)
  at netscape.applet.AppletClassLoader.findClass(Compiled Code)
  at netscape.applet.AppletClassLoader.loadClass1(Compiled Code)
* at netscape.applet.AppletClassLoader.loadClass(Compiled Code)
  at netscape.applet.AppletClassLoader.loadClass(Compiled Code)
  at netscape.applet.DerivedAppletFrame$LoadAppletEvent.dispatch(Compiled Code)
  at java.awt.EventDispatchThread$EventPump.dispatchEvents(Compiled Code)
  at java.awt.EventDispatchThread.run(Compiled Code)
  at netscape.applet.DerivedAppletFrame$AppletEventDispatchThread.run(Compiled Code)

Using JBuilder 2 and the AppletViewer the program runs well.
Maybe it's important that I have all class files in a directory called "pm" since all the files of the program should belong to the package pm.
0
Comment
Question by:dirku
  • 2
3 Comments
 

Author Comment

by:dirku
ID: 1222437
Edited text of question
0
 
LVL 8

Accepted Solution

by:
diakov earned 20 total points
ID: 1222438
- Carefully check the upper-lower case of the names of the files. Usually the local file system is case insensitive, but the web servers are. Especially when they run UNIX. When moving, copying, etc, check the file names with a good program. For example the command prompt with settings to show the case, or Windows Explorer.
- The package structure is similar to a directory structure. The subpackages has to be in the corresponding directories. This is how the loader finds them.
0
 

Author Comment

by:dirku
ID: 1222439
Silly mistake! I really needed to change CODE="pm/pm.class" to CODE="pm/PM.class" ...


0

Featured Post

The Eight Noble Truths of Backup and Recovery

How can IT departments tackle the challenges of a Big Data world? This white paper provides a roadmap to success and helps companies ensure that all their data is safe and secure, no matter if it resides on-premise with physical or virtual machines or in the cloud.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
stackato and cloud 4 85
configure dependency in POM for new database 3 25
Java exception bubble up 2 18
iterator/ListIterator approach 17 26
Java contains several comparison operators (e.g., <, <=, >, >=, ==, !=) that allow you to compare primitive values. However, these operators cannot be used to compare the contents of objects. Interface Comparable is used to allow objects of a cl…
In this post we will learn how to connect and configure Android Device (Smartphone etc.) with Android Studio. After that we will run a simple Hello World Program.
Viewers will learn about the different types of variables in Java and how to declare them. Decide the type of variable desired: Put the keyword corresponding to the type of variable in front of the variable name: Use the equal sign to assign a v…
Viewers will learn about arithmetic and Boolean expressions in Java and the logical operators used to create Boolean expressions. We will cover the symbols used for arithmetic expressions and define each logical operator and how to use them in Boole…

770 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question