Java Solaris Communities Sun Store Join SDN My Profile Why Join?
 
Bug Database
Bug Detail
Quick Lists
Top 25 Bugs
Top 25 RFE's
Recently Closed Bugs
Printable Page Printable Page


Bug Database
Bug ID: 6674383
Votes 15
Synopsis Problems running applets in the Hyper Text Appllication (HTA) from windows
Category java_plugin:ocx
Reported Against
Release Fixed 6u12(b03)
State 11-Closed, Verified, bug
Priority: 2-High
Related Bugs 6545701 , 6793073
Submit Date 12-MAR-2008
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 :
 customer  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  customer  and they are stating it is a problem SUN will have to address. We have a  customer  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"  customer ="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>
            < customer  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"/>
            </ customer >
        </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 " customer  (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 " customer  (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.
Posted Date : 2008-03-12 12:05:51.0
Work Around
N/A
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.
Posted Date : 2008-10-15 23:56:22.0
Comments
  
  Include a link with my name & email   

Submitted On 25-MAR-2008
jdtommy
My understanding the underlying cause of DEP receiving an access violation is the plug-in code is compiled under VS 2003 which does not apply DEP correctly when linked.  According to MS there is a type of fix for this in Vista service pack 1 that you can set the DEP level per process in a web app.  They have given a new API to DEP that the we app running can set to turn DEP on, but allow old ATL "Thunk" code compiled before VS 2005 to run with out throwing a DEP access violation.  So, I think if sun would either compile the plug-in under VS 2005 or add the line of code to the plug-in to set the DEP setting for the Applets to the proper setting it would fix this problem.
Article on this:
http://blogs.msdn.com/michael_howard/archive/2008/01/29/new-nx-apis-added-to-windows-vista-sp1-windows-xp-sp3-and-windows-server-2008.aspx


Submitted On 26-MAR-2008
kbrussel
The comment above is correct except for the suggestion that we could fix the Java Plug-In by adding one line of code. Our discussions with Microsoft have indicated that only they can fix the problem with IE 7. Making the API call in our ActiveX control would have no effect from what they have told us. They have also said that IE 8 will contain this API call, meaning that ActiveX controls like ours compiled with older compilers will work again.


Submitted On 28-MAR-2008
jdtommy
This is not true for the HTA.  The HTA has its own DEP policy that is not the same as IE8 and currently is not changeable by the user.  The OS sets the policy for the HTA and it stays that way.  And as of the IE8 beta build available on this post's posting date it is not fixed for vista.  I am not sure if MS plans on changing the DEP policy on the HTA like they did for IE. If they don't then this is still broken and will not get fixed by them unless the API implementation is done in the plugin.  Because MS changed something for IE does not mean that it propagates to the HTA.


Submitted On 09-JAN-2009
bnicer
If I recompiled applets using JDK 1.7 when it is released, would it fix the problem, or is this purely a run-time issue?


Submitted On 22-JAN-2009
hexaae
Please do something about it. Any loaded Java applet from the web makes IE7 crash when IE7's DEP is on.

To solve the bug Sun has to recompile the activeX plugins using latest Microsoft ATL 7.1+ library, as explained here: http://blogs.msdn.com/michael_howard/archive/2008/01/29/new-nx-apis-added-to-windows-vista-sp1-windows-xp-sp3-and-windows-server-2008.aspx


Submitted On 22-JAN-2009
hexaae
Bug solved with JRE 6u12 b03.



PLEASE NOTE: JDK6 is formerly known as Project Mustang