my dog learned polymorphism*
The moose likes Applets and the fly likes AccessControlException and DefClassNotFound Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Applets
Bookmark "AccessControlException and DefClassNotFound" Watch "AccessControlException and DefClassNotFound" New topic
Author

AccessControlException and DefClassNotFound

michael byrd
Greenhorn

Joined: Jan 21, 2006
Posts: 23
Hi.
I have an client application that controls a machine over the network.
However, I want to run the application on an Applet.
So, I created a new file called Appz.java:

public class Appz extends java.applet.Applet {

public GeradorDeFuncoes gf;
/** Creates a new instance of Appz */
public void init(){
gf = new GeradorDeFuncoes();
gf.setVisible(true);

}

}


GeradorDeFuncoes is the name of my application class that runs over JFrame.


then i created a HTML File (index.html):
<html>
<head>

<title> Eletronic Lab </title>
</head>

<applet code="geradordefuncoes.Appz" archive="AbsoluteLayout.jar">
</applet>

</html>





I opened the browser with this HTML file and:
java.io.EOFException
at java.io.DataInputStream.readInt(Unknown Source)
at java.io.ObjectInputStream$BlockDataInputStream.readInt(Unknown Source)
at java.io.ObjectInputStream.readInt(Unknown Source)
at javax.swing.ImageIcon.readObject(Unknown Source)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at java.io.ObjectStreamClass.invokeReadObject(Unknown Source)
at java.io.ObjectInputStream.readSerialData(Unknown Source)
at java.io.ObjectInputStream.readOrdinaryObject(Unknown Source)
at java.io.ObjectInputStream.readObject0(Unknown Source)
at java.io.ObjectInputStream.defaultReadFields(Unknown Source)
at java.io.ObjectInputStream.readSerialData(Unknown Source)
at java.io.ObjectInputStream.readOrdinaryObject(Unknown Source)
at java.io.ObjectInputStream.readObject0(Unknown Source)
at java.io.ObjectInputStream.readArray(Unknown Source)
at java.io.ObjectInputStream.readObject0(Unknown Source)
at java.io.ObjectInputStream.access$300(Unknown Source)
at java.io.ObjectInputStream$GetFieldImpl.readFields(Unknown Source)
at java.io.ObjectInputStream.readFields(Unknown Source)
at java.awt.Container.readObject(Unknown Source)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at java.io.ObjectStreamClass.invokeReadObject(Unknown Source)
at java.io.ObjectInputStream.readSerialData(Unknown Source)
at java.io.ObjectInputStream.readOrdinaryObject(Unknown Source)
at java.io.ObjectInputStream.readObject0(Unknown Source)
at java.io.ObjectInputStream.readObject(Unknown Source)
at java.beans.Beans.instantiate(Unknown Source)
at java.beans.Beans.instantiate(Unknown Source)
at geradordefuncoes.GeradorDeFuncoes.initComponents(GeradorDeFuncoes.java:732)
at geradordefuncoes.GeradorDeFuncoes.<init>(GeradorDeFuncoes.java:28)
at geradordefuncoes.Appz.init(Appz.java:22)
at sun.applet.AppletPanel.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
java.security.AccessControlException: access denied (java.io.FilePermission /fotos/frequencia.JPG read)
at java.security.AccessControlContext.checkPermission(Unknown Source)
at java.security.AccessController.checkPermission(Unknown Source)
at java.lang.SecurityManager.checkPermission(Unknown Source)
at java.lang.SecurityManager.checkRead(Unknown Source)
at sun.awt.SunToolkit.getImageFromHash(Unknown Source)
at sun.awt.SunToolkit.getImage(Unknown Source)
at javax.swing.ImageIcon.<init>(Unknown Source)
at javax.swing.ImageIcon.<init>(Unknown Source)
at geradordefuncoes.GeradorDeFuncoes.initComponents(GeradorDeFuncoes.java:1149)
at geradordefuncoes.GeradorDeFuncoes.<init>(GeradorDeFuncoes.java:28)
at geradordefuncoes.Appz.init(Appz.java:22)
at sun.applet.AppletPanel.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
java.io.EOFException
at java.io.DataInputStream.readInt(Unknown Source)
at java.io.ObjectInputStream$BlockDataInputStream.readInt(Unknown Source)
at java.io.ObjectInputStream.readInt(Unknown Source)
at javax.swing.ImageIcon.readObject(Unknown Source)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at java.io.ObjectStreamClass.invokeReadObject(Unknown Source)
at java.io.ObjectInputStream.readSerialData(Unknown Source)
at java.io.ObjectInputStream.readOrdinaryObject(Unknown Source)
at java.io.ObjectInputStream.readObject0(Unknown Source)
at java.io.ObjectInputStream.defaultReadFields(Unknown Source)
at java.io.ObjectInputStream.readSerialData(Unknown Source)
at java.io.ObjectInputStream.readOrdinaryObject(Unknown Source)
at java.io.ObjectInputStream.readObject0(Unknown Source)
at java.io.ObjectInputStream.readArray(Unknown Source)
at java.io.ObjectInputStream.readObject0(Unknown Source)
at java.io.ObjectInputStream.access$300(Unknown Source)
at java.io.ObjectInputStream$GetFieldImpl.readFields(Unknown Source)
at java.io.ObjectInputStream.readFields(Unknown Source)
at java.awt.Container.readObject(Unknown Source)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at java.io.ObjectStreamClass.invokeReadObject(Unknown Source)
at java.io.ObjectInputStream.readSerialData(Unknown Source)
at java.io.ObjectInputStream.readOrdinaryObject(Unknown Source)
at java.io.ObjectInputStream.readObject0(Unknown Source)
at java.io.ObjectInputStream.readObject(Unknown Source)
at java.beans.Beans.instantiate(Unknown Source)
at java.beans.Beans.instantiate(Unknown Source)
at geradordefuncoes.GeradorDeFuncoes.initComponents(GeradorDeFuncoes.java:732)
at geradordefuncoes.GeradorDeFuncoes.<init>(GeradorDeFuncoes.java:28)
at geradordefuncoes.Appz.init(Appz.java:22)
at sun.applet.AppletPanel.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
java.security.AccessControlException: access denied (java.io.FilePermission /fotos/frequencia.JPG read)
at java.security.AccessControlContext.checkPermission(Unknown Source)
at java.security.AccessController.checkPermission(Unknown Source)
at java.lang.SecurityManager.checkPermission(Unknown Source)
at java.lang.SecurityManager.checkRead(Unknown Source)
at sun.awt.SunToolkit.getImageFromHash(Unknown Source)
at sun.awt.SunToolkit.getImage(Unknown Source)
at javax.swing.ImageIcon.<init>(Unknown Source)
at javax.swing.ImageIcon.<init>(Unknown Source)
at geradordefuncoes.GeradorDeFuncoes.initComponents(GeradorDeFuncoes.java:1149)
at geradordefuncoes.GeradorDeFuncoes.<init>(GeradorDeFuncoes.java:28)
at geradordefuncoes.Appz.init(Appz.java:22)
at sun.applet.AppletPanel.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
Exception in thread "thread applet-geradordefuncoes.Appz" java.lang.NullPointerException
at sun.plugin.util.GrayBoxPainter.showLoadingError(Unknown Source)
at sun.plugin.AppletViewer.showAppletException(Unknown Source)
at sun.applet.AppletPanel.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)



Can someone help me plz?
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: AccessControlException and DefClassNotFound
 
Similar Threads
Logging problem log4j:ERROR
AccessControlException with a custom ClassLoader
maven -- java.lang.OutOfMemoryError: Java heap space
JasperReport problem
java.io.InvalidClassException