Microsoft KB Archive/169815

= PRB: Security Exception When Launching an Applet with Images =

Article ID: 169815

Article Last Modified on 8/25/2005

-

APPLIES TO


 * Microsoft Java Virtual Machine

-



This article was previously published under Q169815



SYMPTOMS
When you try to launch a Java applet with animation support from outside the DevStudio environment, the applet fails to launch correctly, and the Java log shows the following AppletSecurityException error:


 * Security Exception: Couldn't connect to with origin from file ****com.ms.applet.AppletSecurity.checkConnect at com/ms/applet/BrowserAppletFrame.getImageFromHash at com/ms/applet/BrowserAppletContext.getImage at java/applet/Applet.getImage...



RESOLUTION
To work around the problem, you can use one of the following methods:


 * You can load the applet from a Web server, because it will not be a file Uniform Resource Locator (URL) and is permitted to connect to the host from which it was loaded.

Note The image files must also exist on the server in the same or subordinate folder of the applet.
 * You can run the applet from DevStudio, which relaxes the security restrictions imposed on an applet. Essentially, putting the class files of the applet in the system classpath.
 * You can put the applet in a signed CAB file, again to relax the security restrictions imposed on an applet.



MORE INFORMATION
This problem occurs only under the Microsoft VM build 1516, when loading the applet via a file URL.

Steps to Reproduce the Behavior

 * 1) Install the Microsoft VM for Java build 1516.
 * 2) Create a default Applet Wizard applet, with animation support.
 * 3) Launch Internet Explorer outside Developer Studio by clicking the project's HTML page.

The applet will fail to load correctly, and you will receive the exception earlier in this article.

