Java Plug-in 1.5.0_12 Using JRE version 1.5.0_12 Java HotSpot(TM) Client VM User home directory = C:\Documents and Settings\Emminent
---------------------------------------------------- c: clear console window f: finalize objects on finalization queue g: garbage collect h: display this help message l: dump classloader list m: print memory usage o: trigger logging p: reload proxy configuration q: hide console r: reload policy configuration s: dump system and deployment properties t: dump thread list v: dump thread stack x: clear classloader cache 0-5: set trace level to <n> ----------------------------------------------------
load: class java.Backup not found. java.lang.ClassNotFoundException: java.Backup at sun.applet.AppletClassLoader.findClass(Unknown Source) at java.lang.ClassLoader.loadClass(Unknown Source) at sun.applet.AppletClassLoader.loadClass(Unknown Source) at java.lang.ClassLoader.loadClass(Unknown Source) at sun.applet.AppletClassLoader.loadCode(Unknown Source) at sun.applet.AppletPanel.createApplet(Unknown Source) at sun.plugin.AppletViewer.createApplet(Unknown Source) at sun.applet.AppletPanel.runLoader(Unknown Source) at sun.applet.AppletPanel.run(Unknown Source) at java.lang.Thread.run(Unknown Source) Caused by: java.io.IOException: open HTTP connection failed. at sun.applet.AppletClassLoader.getBytes(Unknown Source) at sun.applet.AppletClassLoader.access$100(Unknown Source) at sun.applet.AppletClassLoader$1.run(Unknown Source) at java.security.AccessController.doPrivileged(Native Method) ... 10 more
appletcode ( App.html)/WEB-INF/classes/java(applet class file ,AllQuestion folder)
this online exam project where i am reading the questions from folder AllQuestions and display it in applet when i click the button this folder is in java as shown in above directory structure
Nothing that's inside of the WEB-INF directory will be served to a browser. You'll need to move all files related to the applet into a publicly accessible directory (like the one where the HTML file resides in). That includes class files, jar files (if any) and data files (like questionDir).
Whenever you mention that you're getting exceptions you should post the full stack trace. There's additional information in the exception message that helps diagnose the problem. Without that, people here can only guess what's going on.
feroz pasha
Greenhorn
Joined: Aug 22, 2008
Posts: 13
posted
0
Java Plug-in 1.5.0_12 Using JRE version 1.5.0_12 Java HotSpot(TM) Client VM User home directory = C:\Documents and Settings\Emminent
---------------------------------------------------- c: clear console window f: finalize objects on finalization queue g: garbage collect h: display this help message l: dump classloader list m: print memory usage o: trigger logging p: reload proxy configuration q: hide console r: reload policy configuration s: dump system and deployment properties t: dump thread list v: dump thread stack x: clear classloader cache 0-5: set trace level to <n> ----------------------------------------------------
The Direcory location=null Full directory path=/localhost:7001/appletcodenull java.security.AccessControlException: access denied (java.io.FilePermission \localhost:7001\appletcodenull 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 java.io.File.isDirectory(Unknown Source) at Backup.init(Backup.java:131) at sun.applet.AppletPanel.run(Unknown Source) at java.lang.Thread.run(Unknown Source)
this is the exception i am getting sir help me what is the next step shall i take to over come the exception
Ulf Dittmer
Marshal
Joined: Mar 22, 2005
Posts: 35443
9
posted
0
The fact that the file path contains the string "null" should be a clear indication of what is going wrong.
Aside from that, applets are not allowed to perform file I/O without being signed, or unless the local security policy has been altered. It looks as if neither is the case. See HowCanAnAppletReadFilesOnTheLocalFileSystem for more detail.
Applets can look only for files from the server from where it is served from.
Ananth Chellathurai
feroz pasha
Greenhorn
Joined: Aug 22, 2008
Posts: 13
posted
0
i have set the access permission buy keytool -genkey -keyalg rsa -alias feroz after i made the certificate:
keytool -export -alias feroz -file yourcert.crt
after that i have created a bat file which contains
javac Backup.java jar cvf Backup.jar Backup.class jarsigner Backup.jar feroz
The batch-file compiles the applet, makes a jar-archive and signs the jar-file.
but when i am running my html file iam getting this exception.
Java Plug-in 1.5.0_12 Using JRE version 1.5.0_12 Java HotSpot(TM) Client VM User home directory = C:\Documents and Settings\emminent
---------------------------------------------------- c: clear console window f: finalize objects on finalization queue g: garbage collect h: display this help message l: dump classloader list m: print memory usage o: trigger logging p: reload proxy configuration q: hide console r: reload policy configuration s: dump system and deployment properties t: dump thread list v: dump thread stack x: clear classloader cache 0-5: set trace level to <n> ----------------------------------------------------
file:/C:/AppletCode/AllQuestions/Question1.java java.lang.SecurityException: class "Backup$1"'s signer information does not match signer information of other classes in the same package at java.lang.ClassLoader.checkCerts(Unknown Source) at java.lang.ClassLoader.preDefineClass(Unknown Source) at java.lang.ClassLoader.defineClass(Unknown Source) at java.security.SecureClassLoader.defineClass(Unknown Source) at sun.applet.AppletClassLoader.findClass(Unknown Source) at java.lang.ClassLoader.loadClass(Unknown Source) at sun.applet.AppletClassLoader.loadClass(Unknown Source) at java.lang.ClassLoader.loadClass(Unknown Source) at java.lang.ClassLoader.loadClassInternal(Unknown Source) at Backup.init(Backup.java:154) at sun.applet.AppletPanel.run(Unknown Source) at java.lang.Thread.run(Unknown Source) what should i do