ERROR
An applet that sends the XML request to the server through AppServerLink and is run from Microsoft Visual J++ returns the following error:"com.ms.security.SecurityExceptionEx[Host] "The same applet request run from JBuilder, however, returns properly.
This error is caused by the sandbox restrictions of the Java Security Model applicable to programs whose applets are run from a Web browser, such as Microsoft Visual J++.
In contrast, JBuilder runs the applets using AppletViewer, a debugging aid for viewing and testing applets, and are not subject to the sandbox restrictions.
Code:
import com.ms.security.*;
import java.awt.*;
import java.awt.event.*;
import java.applet.*;
public class Applet1 extends Applet {
//Construct the applet
public Applet1() {
}
//Initialize the applet
public void init() {
try {
if (Class.forName("com.ms.security.PolicyEngine") != null) {
PolicyEngine.assertPermission(PermissionID.NETIO);
}
} catch (Throwable cnfe) {
}
}
}
Note:
The best solution is to assert the permission while developing and testing the applet and remove it when deploying on the webserver.
Article ID:000004857
Get help from ArcGIS experts
Download the Esri Support App