Signed Applet still unable load applet (how to modify client java.policy)

Hi,

I have make an applet to connect to a comm port and read data from it. I have signed the applet as I know this is necessary if need to connect to comm port. Under my own PC, I am able to modify the java.policy to grant permission for all. However, when I put it to other PC, it show me that I do not have the permission. However, when I modify the java.policy under the PC, then the applet work fine again.

My doubt is shouldnt I had sign the applet then the client PC is able to allow the applet to access the file system. Or did the client PC need to install the certificate that I used to sign the applet to their IE. Or is there any way to modify the client java.policy to grant permission to my applet?

Please help as boss is chasing me on this program.

Thanks in advance for any help or comments.

[837 byte] By [sunnylokea] at [2007-10-1 23:31:37]
# 1

You sign the applet and a default jre installation will ask the do you trust question.

Of course the user has to click yes in order for the applet to access the local file system.

If you use 3rd pary jar files the client(s) should install these in the lib/ext.

Signing applets:

http://forum.java.sun.com/thread.jsp?forum=63&thread=524815

second post and last post for the java class file using doprivileged

Still problems?

A Full trace might help us out:

http://forum.java.sun.com/thread.jspa?threadID=656028

harmmeijera at 2007-7-15 14:14:26 > top of Java-index,Security,Signed Applets...
# 2

Hi,

Thanks for it. I had try your doPrivileged function and it works fine, I am able to modify the client java.policy.

However, this does not work for the first time. During the first time I run the applet, it only able to append the grant at the end. But does not take effect.

Only when I run the applet for the second time, it take the grant effect and allow the applet to connect to the comm port.

Any idea on why even I had modify the java.policy to grant permission for all, but yet at the first time I modify the policy file using applet is not take effect?

Thanks in advance.

sunnylokea at 2007-7-15 14:14:26 > top of Java-index,Security,Signed Applets...
# 3
jre needs to be restarted to read the policy.After changing the policy you need to close all browsers to stop the jre.I would not know how to get the jre to re read the polcy programatically.
harmmeijera at 2007-7-15 14:14:26 > top of Java-index,Security,Signed Applets...