4

I've been trying to send information from Java to Java script using the JSObject but i keep receiving a java.lang.ClassNotFoundException: com.sun.deploy.appcontext.AppContext exception i'm using netbeans 7.1.

Here is the full stack trace

java.lang.NoClassDefFoundError: com/sun/deploy/appcontext/AppContext
    at MapTest.MapApplet.init(MapApplet.java:23)
    at sun.applet.AppletPanel.run(AppletPanel.java:434)
    at java.lang.Thread.run(Thread.java:722)
Caused by: java.lang.ClassNotFoundException: com.sun.deploy.appcontext.AppContext
   at java.net.URLClassLoader$1.run(URLClassLoader.java:366)
   at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
   at java.security.AccessController.doPrivileged(Native Method)
   at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
   at java.lang.ClassLoader.loadClass(ClassLoader.java:423)
   at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)
   at java.lang.ClassLoader.loadClass(ClassLoader.java:356)
   ... 3 more

It is referring to this line of code

    win = JSObject.getWindow(this);

These are all my imports

import netscape.javascript.JSObject;
import java.lang.*;
import java.applet.*;
import java.awt.Graphics;

I really need help with this can't seem to find solutions anywhere.

Thanks.

2
  • 1
    How are you testing your Applet? JSObject is not supported in Appletviewer. Commented Mar 3, 2012 at 13:10
  • I've only ran the program on netbeans. Commented Mar 3, 2012 at 13:40

1 Answer 1

1

I came across a similar error and was able to solve it by adding deploy.jar found in the local Java install to the project build path. Not sure how to do this in netbeans but for others using maven you can try adding the folowing dependency:

<dependency>
    <groupId>sun</groupId>
    <artifactId>deploy</artifactId>
    <version>7.0</version>
    <scope>system</scope>
    <systemPath>${java.home}/lib/deploy.jar</systemPath>
</dependency>
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.