Solved

java.lang.NoClassDefFoundError?????

Posted on 1997-03-13
1
257 Views
Last Modified: 2008-03-06
I am trying to use a  Java Midi API from outside of Sun's API.  The API is called MidiShare and I am having a great deal of trouble getting it to work. Whenever I try to load a MidiShare applet I revieve this information......

AppAccelerator(tm) 1.0.2a for Java, x86 version.
>Copyright (c) 1996 Borland International. All Rights Reserved.
># Failed to pull over zip file
>http://www.grame.fr:80/Java_classes/MidiDisplay.zip
># Security Exception: link:JMidi
># Applet exception: error: java.lang.NoClassDefFoundError
>java.lang.NoClassDefFoundError
>  at grame.appletsmidi.MidiApplet.<init>(MidiApplet.java)
>  at grame.appletsmidi.MidiDisplayApplet.<init>(Compiled Code)
>  at netscape.applet.EmbeddedAppletFrame.run(Compiled Code)
>  at java.lang.Thread.run(Compiled Code)
># Applet exception: error: java.lang.NoClassDefFoundError
>java.lang.NoClassDefFoundError
>  at grame.appletsmidi.MidiApplet.<init>(MidiApplet.java)
>  at grame.appletsmidi.MiniKeyboardApplet.<init>(Compiled Code)
>  at netscape.applet.EmbeddedAppletFrame.run(Compiled Code)
>  at java.lang.Thread.run(Compiled Code)

The MidiShare API consists of three main parts.  A Player32.dll which is supposed to go into the windows system directory, two more dll's (JMidi.jll, Jplayer.jll) that go into the Netscape/program/java/bin folder, and a class folder called grame which goes directly into the Netscape/program/java/class directory.(I have done all this)
 
I am using the JDK1.1 and Nescape Nav gold 3.1 on a pentium system.  Can you please tell me what this message means and what I need to do to fix this problem.

Any help will be very much appreciated.
0
Comment
Question by:Mystosus
1 Comment
 

Accepted Solution

by:
amarshal earned 200 total points
Comment Utility
You are trying to download native code as an applet, which is throwning a securtity exception (line 4).  Native interfaces, like your dll's, are not allowed in applets.  Allowing such would make Java as insecure as ActiveX.  In addition to being insecure, it makes the Java applet platform depended; it would not run on a Mac or Sun machine.

The NoClassDefError is a result of the security exception disallowing the classes/dlls to be loaded.

Unfortunately, since it is a security exception, there is no fix for this.
0

Featured Post

6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

Join & Write a Comment

INTRODUCTION Working with files is a moderately common task in Java.  For most projects hard coding the file names, using parameters in configuration files, or using command-line arguments is sufficient.   However, when your application has vi…
Introduction This article is the last of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article covers our test design approach and then goes through a simple test case example, how …
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…
This tutorial covers a practical example of lazy loading technique and early loading technique in a Singleton Design Pattern.

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

10 Experts available now in Live!

Get 1:1 Help Now