File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Applets and the fly likes APPLET tag is not working with self-signed applet jar Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Java » Applets
Bookmark "APPLET tag is not working with self-signed applet jar" Watch "APPLET tag is not working with self-signed applet jar" New topic
Author

APPLET tag is not working with self-signed applet jar

Navneet Singh
Greenhorn

Joined: Aug 19, 2007
Posts: 29

I've self-signed applet jar. I've created the policy file also (granting all permission). This applet is basically uploading multiple files using HttpClient to post request. I'm able to run via appletviewer command like:
appletviewer -J-Djava.security.policy=mypolicy signedapplet.html . It works fine. But when i embed it into my html file and try to open the html by clicking on it, the applet got successfully loaded but when i browse a file then it throws an exception. Exception on java console..
java.security.AccessControlException: access denied (java.io.FilePermission C:\Documents and Settings\Navneet\My Documents\Jassi.doc read)

I don't know where i went wrong. If it works on appletviewer, why not on html.Do i need to do something extra to work it.

Any suggestion/solutions are most welcome.

thanks in advance


SCJP 1.4
SCWCD
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 39541
    
  27
For starters, if the applet is signed properly, then there is no need for any policy changes. Signing the applet confers all right to it.

Secondly, the browser JRE will not know about any security policy file changes unless you make them to the policy file that governs that particular JRE. Looks through its installation directories to find its policy file.

Lastly, it's always a bit of a gamble what happens if an applet is started by double-clicking an HTML file. Put the HTML and applet on a web server, and start it properly through its web page. That'll be a more reliable indicator of what happens in a real environment.


Ping & DNS - updated with new look and Ping home screen widget
Navneet Singh
Greenhorn

Joined: Aug 19, 2007
Posts: 29

thanks for the reply.
I followed the process what u've said. But still it doesn't work. I'm getting the same exception. I followed the way for signing applet jar as described in "http://java.sun.com/developer/onlineTraining/Programming/JDCBook/signed.html" then i've put the jar where my signedApplet.html is located. I've written following code in signedApplet.html
"<html>
<body>
<applet height="271" width="226" code="JFileChooserTest"
archive="SUploadFilesApplet.jar,lib/commons-httpclient-2.0.jar,lib/commons-logging-1.1.1.jar">

</applet>
</body>

</html>"

Is that because of self-signed application? I've also uploaded the CompanyCer.cer in my IE.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: APPLET tag is not working with self-signed applet jar
 
Similar Threads
Acess Denied Exception
Help with signed applet...
how to deploy a Swing Applet that accesses the System Clipboard
Self signing JAR works but one issue
Low Priority: AppletViewer doesn't work, real world does?