Solved

ClassFormatError

Posted on 1998-08-24
3
151 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Secure Your Active Directory - April 20, 2017

Active Directory plays a critical role in your company’s IT infrastructure and keeping it secure in today’s hacker-infested world is a must.
Microsoft published 300+ pages of guidance, but who has the time, money, and resources to implement? Register now to find an easier way.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
hibernate jars 4 57
hibernate example using maven 12 77
Selenium docs api java index 3 64
Delphi Firemonkey: if the Sms contain special characters it won't send it 3 63
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…
Are you developing a Java application and want to create Excel Spreadsheets? You have come to the right place, this article will describe how you can create Excel Spreadsheets from a Java Application. For the purposes of this article, I will be u…
The viewer will learn how to implement Singleton Design Pattern in Java.
This video teaches viewers about errors in exception handling.

763 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