how to grant "all privileges" to applets launched from Forte?

How can I set the security policy for applets launched from Forte using appletviewer.exe to grant "all privileges"? I've gotten it to work under the Java Plugin when launched from an object tag under IE6 when the html document containing it gets served from localhost using Forte's built-in Tomcat by adding the following line to c:\Program Files\Java\j2re1.4.0_01\lib\security\java.policy --

grant codeBase "http://localhost/-" {

permission java.security.AllPermission;

};

But NOTHING I've tried to grant the same privileges to the applet when launched directly from Forte seems to work. At this point, I'm trying to figure out what I'm doing wrong.

One problem is that I don't even know with absolute certainty WHICH JVM is being used. I'm "pretty sure" it's using the one specified in Forte's ide.cfg file ("C:\j2sdk1.4.0_01"), but I have three installed (c:\j2sdk1.4.0_01, c:\j2sdk1.4.0, and c:\j2sdk1.3.1_02, plus what appears to be the JPI in c:\program files\java) and don't really know of any way to conclusively verify that the JDK path isn't being ignored or overridden somewhere downstream by another parameter somewhere in Forte.

Another problem is that I'm not entirely sure what "URL" Forte is passing appletviewer to launch it when I hit f6. I ASSUME it's being launched from the same directory where the .java source file sits and Forte puts the .class file if I hit f9 to compile it (beneath d:\java), but it's entirely possible that Forte might be launching it from localhost or a temp directory somewhere altogether different.

For that matter, I'm not even certain that Forte isn't somehow overriding the default security settings for appletviewer.

so... WHERE is the properties file I need to edit, WHAT "grant" do I need to add to it, and are there any other settings lurking in Forte I need to change (or at least verify haven't been changed from their defaults)?

[1965 byte] By [S,Jeff] at [2007-11-25 16:46:32]
# 1

Well, it trashed my entire week, but I finally managed to get it to work through brute force process of elimination by establishing:

1) The java.policy file relevant to applet viewer IS the one in the "lib/security" subdirectory of the JDK specified in Forte's ide.cfg file.

2) The policy file is newly consulted EACH time an applet is launched from Forte in AppletViewer via f6.

3) AppletViewer sees the applet as having been loaded via http, NOT from the local filesystem

4) The proper codeBase is the machine's name (in Win2k, specified as "full computer name" on the "Computer Name" tab of My Computer -> properties). And, assuming the machine you're running Forte is part of a network and has a public and/or private IP address, the proper name is NOT likely to be "localhost" or "127.0.0.1". In my case, my machine's "full name" (as far as Forte/Java) is concerned is "jeff."

SO, giving concrete values to everything above, I had to add the following line to C:\j2sdk1.4.0_01\jre\lib\security\java.policy:

grant codeBase "http://jeff/-" {

permission java.security.AllPermission;

};

Fun, fun, fun ;-)

> Jeff S wrote:

> How can I set the security policy for applets launched from Forte using appletviewer.exe to grant "all privileges"? I've gotten it to work under the Java Plugin when launched from an object tag under IE6 when the html document containing it gets served from localhost using Forte's built-in Tomcat by adding the following line to c:\Program Files\Java\j2re1.4.0_01\lib\security\java.policy --

>

> grant codeBase "http://localhost/-" {

> permission java.security.AllPermission;

> };

>

> But NOTHING I've tried to grant the same privileges to the applet

> when launched directly from Forte seems to work. At this point, I'm

> trying to figure out what I'm doing wrong.

>

> One problem is that I don't even know with absolute certainty WHICH

> JVM is being used. I'm "pretty sure" it's using the one

> specified in Forte's ide.cfg file ("C:\j2sdk1.4.0_01"), but

> I have three installed (c:\j2sdk1.4.0_01, c:\j2sdk1.4.0, and

> c:\j2sdk1.3.1_02, plus what appears to be the JPI in c:\program

> files\java) and don't really know of any way to conclusively verify

> that the JDK path isn't being ignored or overridden somewhere

> downstream by another parameter somewhere in Forte.

>

> Another problem is that I'm not entirely sure what "URL"

> Forte is passing appletviewer to launch it when I hit f6. I ASSUME

> it's being launched from the same directory where the .java source

> file sits and Forte puts the .class file if I hit f9 to compile it

> (beneath d:\java), but it's entirely possible that Forte might be

> launching it from localhost or a temp directory somewhere altogether

> different.

>

> For that matter, I'm not even certain that Forte isn't somehow

> overriding the default security settings for appletviewer.

>

> so... WHERE is the properties file I need to edit, WHAT

> "grant" do I need to add to it, and are there any other

> settings lurking in Forte I need to change (or at least verify

> haven't been changed from their defaults)?

>

S,Jeff at 2007-7-2 23:25:14 > top of Java-index,Archived Forums,Sun ONE Studio 4...