Solved

ClassFormatError

Posted on 1998-08-24
3
143 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
Comment Utility
Edited text of question
0
 
LVL 8

Accepted Solution

by:
diakov earned 20 total points
Comment Utility
- 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
Comment Utility
Silly mistake! I really needed to change CODE="pm/pm.class" to CODE="pm/PM.class" ...


0

Featured Post

Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

Join & Write a Comment

Suggested Solutions

For beginner Java programmers or at least those new to the Eclipse IDE, the following tutorial will show some (four) ways in which you can import your Java projects to your Eclipse workbench. Introduction While learning Java can be done with…
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…
The viewer will learn how to implement Singleton Design Pattern in Java.
This theoretical tutorial explains exceptions, reasons for exceptions, different categories of exception and exception hierarchy.

762 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

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now