United StatesChange Country, Oracle Worldwide Web Sites Communities I am a... I want to...
Bug ID: JDK-6674383 Problems running applets in the Hyper Text Appllication (HTA) from windows
JDK-6674383 : Problems running applets in the Hyper Text Appllication (HTA) from windows

Details
Type:
Bug
Submit Date:
2008-03-12
Status:
Closed
Updated Date:
2011-02-16
Project Name:
JDK
Resolved Date:
2009-01-30
Component:
deploy
OS:
windows_vista
Sub-Component:
plugin
CPU:
x86,generic
Priority:
P2
Resolution:
Fixed
Affected Versions:
6,6u10,6u11
Fixed Versions:
6u12 (b03)

Related Reports
Backport:
Duplicate:
Duplicate:
Relates:

Sub Tasks

Description
FULL PRODUCT VERSION :
java version "1.6.0_10-ea"
Java(TM) SE Runtime Environment (build 1.6.0_10-ea-b12)
Java HotSpot(TM) Client VM (build 11.0-b11, mixed mode, sharing)

ADDITIONAL OS VERSION INFORMATION :
Microsoft Windows Version 6.0.6001

A DESCRIPTION OF THE PROBLEM :
We have a web application that runs as a Hyper Text Application(HTA)  to give us more control.  Our we app uses Java Applets for some of its interfaces.  We didn't have a problem with this until the release of Vista.  When the applet tries to start up in an HTA under Windows Vista, Windows Data Execution Prevention (DEP) process shuts down the HTA and gives no further information as to why.  This was explained to Microsoft and they are stating it is a problem SUN will have to address. We have a Microsoft case number SRX070305603739 for your reference.

STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
1 - Create a HTA file called MyHta.hta that contains the following HTML
<html>
    <head>
		<title>Application</title>
    </head>
    <frameset id="topFrameset" rows="100%">
        <frame name="topframe" src="JarUpdate.htm" UNSELECTABLE="on" application="yes" trusted="yes" frameborder="0" marginwidth="0" marginheight="0" scrolling="no">
    </frameset>
</html>

2 - Create html page called JarUpdate.htm with the following:
<html>
<head>
    <title>Updated Jar Check</titl
</head>

<body LEFTMARGIN="0" TOPMARGIN="0">
<table width="100%" height="100%">
    <tr>
        <td height="80%">&nbsp;</td>
    </tr>
    <tr align="center" valign="top">
        <td>
            <object id="The Id" classid="clsid:CAFEEFAC-0016-0000-FFFF-ABCDEFFEDCBA"
                width="500" height="210" align="middle" valign="bottom"
                border="0">
            <param name="archive" value="appletTest.jar"/>
                <param name="code" value="MyApplet"/>
            </object>
        </td>
    </tr>
</table>
</body>
</html>

3 - Create a class called MyApplet with the following:
import javax.swing.*;

public class MyApplet extends JApplet {
    public void init() {
        this.getContentPane().add(new JButton("I am a Button"));
    }
}

4 - Jar the class in a jar file called appletTest.jar

5 - Stick them all in the same directory and run the HTA file.  If you open the file in internet explorer it will ask you if you want to run or save the file.  run it.

6 - The HTA application will run and then give and error "Microsoft (R) HTML Application host has stopped working" and gives options to Check online for help, close program, or to debug.  No other information is given.

We were hopping the new Java Plugin would solve this problem and it has not.  Any assistance on correcting this issue would be greate.

EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
The applet would run and you would see a button on the web page
ACTUAL -
HTA shuts down and gives error message

ERROR MESSAGES/STACK TRACES THAT OCCUR :
The HTA application will run and then give and error "Microsoft (R) HTML Application host has stopped working" and gives options to Check online for help, close program, or to debug.  No other information is given.

REPRODUCIBILITY :
This bug can be reproduced always.

                                    

Comments
EVALUATION

According to Microsoft, the cause is due to the Java Plug-in module makes use of ATL 7.1 in VS2003, which uses a ???thunking??? architecture for window-related function calls.  Later versions of ATL also use this thunking, but in version 7.1, the allocated memory was not marked as executable, and this conflicts with the NoeXecute compatibility and Data Execution Prevention features that are pervasive in Vista.

A workaround fix, which doesn't involve upgrading to a newer version of compiler such as VS2008, is to build our activex controls with the atlthunk.cpp and a few header files from ATL8.0.
                                     
2008-10-15
SUGGESTED FIX

http://sa.sfbay.sun.com/projects/deployment_data/6u12/6674383.4
                                     
2008-11-11



Hardware and Software, Engineered to Work Together