Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Applet Signing problem

 
Swathi Prakash
Ranch Hand
Posts: 49
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hai ,,

i tried to read the file using url method in applet..
i signed Applet using these

jar cvf test.jar samp.class
jarsigner -keystore mykeystore test.jar signtest

before these i created the keystore using these

keytool -genkey -keystore mykeystore -keyalg RSA -alias signtest

keytool -selfcert -alias signtest -keystore mykeystore


i m getting the error like these

access denied (java.util.PropertyPermission * read,write)

plz help me.
 
Tom Katz
Ranch Hand
Posts: 169
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I had this problem recently. If you're using a JDK 1.4 or up, signed applets will have problems reading files from hard disks UNLESS you make changes to the local policy file settings. Check in your %JDK_HOME%/jre/lib/security/java.policy file. If you add a line similar to



It should give you rights to read/write to that file. You can also add permissions to do things like read a user's home directory from the system, etc.

The problem I ran into after figuring this out was how to make sure that each user's java.policy file had these changes. I believe there's a programmatic way to set these policy rights that you might look into as well.
 
Swathi Prakash
Ranch Hand
Posts: 49
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thanks for u r help tom. till i m getting the same error.plz help me.

is it is required my file should be in same directory.


plz help me. i m going to read the file "name.css".which is in some other directory.

i gave like this. till i m geting the same error. plz help me..

permission java.util.PropertyPermission "name.css","read,write";

 
Tom Katz
Ranch Hand
Posts: 169
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sorry, I have not had enough coffee yet- you need to put the full path of your file in the java.policy file, or it WILL be looking in the same directory.

Post more details about the error you're getting, what you're trying to do, etc.
 
Swathi Prakash
Ranch Hand
Posts: 49
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I properly signed my applet to read and write a file . it is working perfectly in Appletviewer.but in IE it is not worknig. in that java console it is showing the error like below..


access denied (java.util.PropertyPermission * read,write)


i dont know what is the problem is ..plz help me.


Thanks in advance....

Swathi
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic