This content has been marked as final. Show 3 replies
Move your html file one step down in your directory tree, so
that your project dir looks like this
Then change the html file like this
I believe this should do it.
I had a similar problem. After moving the httml file one step down in the directory tree, the error is gone. However, I still have a problem to load the JDBC driver from Applet, but the same driver loads fine from JFrame.
appletviewer -J-Djava.security.policy=test.policy TestApplet.html
I have set following permission in test.policy file.
Then, I get following error.
at java.lang.Class.forName0(Native Method)
I have loaded the driver as below.
DriverManager.getConnection(url, username, password);
I am pretty sure that I have set the CLASSPATH variable correctly, otherwise it would NOT have worked from JFrame.
Does anybody out there know why it doesn't work from Applet although it works from Frame?
Thanks in advance.
Use the fully-qualified path to the driver - I believe the applet is performing as per the following tutorial sentence:
Whenever an applet needs to load some data from a file that's specified with a relative URL (a URL that doesn't completely specify the file's location), the applet usually uses either the code base or the document base to form the complete URL.
Alternatively, you could try setting the code/document base.
(and next time start your own thread, please)