PRB: Security Exception when Launching an Applet with Images

Last reviewed: January 29, 1998
Article ID: Q169815
The information in this article applies to:
  • Microsoft Win32 Virtual Machine for Java

SYMPTOMS

When trying to launch a Java Applet with animation support from outside the DevStudio environment, the applet fails to launch properly 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 either of the following methods:

  • Use a build of the Microsoft Java VM newer than 1516. You can find a newer build at http://www.microsoft.com/java.

    -or-

  • You can load the applet from a Web server, since it will not be a file URL and is allowed to connect to the host from which it was loaded. NOTE: the image files need to also exist on the server in the same or subordinate folder of the applet.

    -or-

  • You can run the applet from DevStudio, which relaxes the security restrictions imposed on an applet. Essentially, placing the class files of the applet in the system classpath

    -or-

  • You can place the applet in a signed CAB file, again to relax the security restrictions imposed on an applet.

MORE INFORMATION

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

Steps to Reproduce Behavior

  1. Install the Microsoft Java VM build 1516.

  2. Create a default Applet Wizard applet, with animation support.

  3. Launch Internet Explorer outside of Developer Studio by clicking on the project's HTML page.

The applet will fail to load properly, and you will get the above exception.

REFERENCES

For more information on Cab&Sign, please refer to the Sample CabAndSign that comes with the Visual J++.

For additional information on the current release of the VM, please refer to the following Knowledge Base article:

   ARTICLE-ID: Q163637
   TITLE     : INFO: Availability of Current Build of Microsoft VM
               for Java

For the latest Knowledge Base articles and other support information on Visual J++ and the SDK for Java, see the following page on the Microsoft Technical Support site:

   http://support.microsoft.com/support/visualj/
   http://support.microsoft.com/support/java/

Keywords          : kberrmsg JVM VJMisc
Technology        : kbInetDev
Platform          : WINDOWS
Issue type        : kbprb


================================================================================


THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY.

Last reviewed: January 29, 1998
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.