The moose likes Applets and the fly likes Signed jar won't work... Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of OCA Java SE 8 Programmer I Study Guide this week in the OCAJP 8 forum!
JavaRanch » Java Forums » Java » Applets
Bookmark "Signed jar won Watch "Signed jar won New topic

Signed jar won't work...

Tristan Van Poucke
Ranch Hand

Joined: Jun 30, 2008
Posts: 47
I signed the jar for my applet using jarsigner.
the applet is made for browsing your harddisk in order to upload some pictures so I needed a signed applet.
Anyway I signed the applet and still i get this error: access denied ( C:\Documents and Settings\josy\Mijn documenten read)
at Source)
at Source)
at java.lang.SecurityManager.checkPermission(Unknown Source)
at java.lang.SecurityManager.checkRead(Unknown Source)
at Source)
at Source)
at com.arashpayan.filetree.FileTree.populateSubTree(
at com.arashpayan.filetree.FileTree.initRoot(
at com.arashpayan.filetree.FileTree.initComponents(
at com.arashpayan.filetree.FileTree.<init>(
at UploaderPack.Uploader.init(
at Source)
at Source)

Ulf Dittmer

Joined: Mar 22, 2005
Posts: 42958
I haven't done it myself, but I've heard people say running code as privileged code helps. See the last paragraph of "Signing an applet" in
[ July 01, 2008: Message edited by: Ulf Dittmer ]
Norm Radder
Ranch Hand

Joined: Aug 10, 2005
Posts: 691
I just ran an applet from a jar that I signed and it was able to read a file from my C: drive. It wasn't able to read the file before I signed it.

Here are the commands I used to sign the jar file:

@REM Sign AppletReader.jar to new jar file
@rem commandline used to create keystore:
@echo keytool -genkey -alias signApplet -keypass NormsKey -keystore NormsKS -storepass NormsStore
jarsigner -keystore NormsKS -signedjar sAppletReader.jar AppletReader.jar signApplet

Here's the code in the applet:
I agree. Here's the link:
subject: Signed jar won't work...
It's not a secret anymore!