在 IE9 中加载/重新加载页面时,Java 小程序在 java7 中失败
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/11205710/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Java applet fails in java7 on page load/reload in IE9
提问by Eugene Trofimenko
I am running an Applet in a web application (ASP.NET), deploymentusing deployJava.js. It worked/works fine on Java 6 u XX.
我在 Web 应用程序 (ASP.NET) 中运行小程序,使用deployJava.js 进行部署。它在 Java 6 u XX 上运行良好。
After the latest update to Java 7u5 I've run into an incomprehensible issue. On IE9 the Applet works fine, at first, but after any reloading (F5 or postback) the Applet simply freezes.
在对 Java 7u5 进行最新更新后,我遇到了一个难以理解的问题。在 IE9 上,Applet 起初工作正常,但在任何重新加载(F5 或回发)后,Applet 只是冻结。
Java Plug-in 10.5.0.05
Using JRE version 1.7.0_05-b05 Java HotSpot(TM) Client VM
User home directory = C:\Users\***
basic: Starting applet teardown
basic: Finished applet teardown
basic: Removed progress listener: sun.plugin.util.ProgressMonitorAdapter@2e749c
plugin2manager.parentwindowDispose
On Firefox and Chrome the Applet works fine. After downgrading the JRE version to 6 one, all browsers (including IE-9) work fine.
在 Firefox 和 Chrome 上,Applet 工作正常。将JRE版本降到6一后,所有浏览器(包括IE-9)都可以正常工作。
I've read a couple of Java/Oracle/IE9 tickets with the same problem and tried the prescribed work-around's but they haven't helped:
我已经阅读了几个具有相同问题的 Java/Oracle/IE9 票证并尝试了规定的解决方法,但它们没有帮助:
- Clear Java cache
- Disabling/Enabling any IE9 settings
- Security, Java scripting, ActiveX filtering, compatibility mode etc)
- Clearing doctype
- 清除 Java 缓存
- 禁用/启用任何IE9 设置
- 安全、Java 脚本、ActiveX 过滤、兼容模式等)
- 清除文档类型
BTW: After IE9 freezes I check the iexplorer.exe process and it picks up 130 - 180 Mb of RAM. After deleting this process, iexplorer.exe reloads and works fine until the next browser/applet reload.
顺便说一句:IE9 死机后,我检查了 iexplorer.exe 进程,它占用了 130 - 180 Mb 的 RAM。删除此进程后,iexplorer.exe 会重新加载并正常工作,直到下一次浏览器/小程序重新加载。
Please ask for more details if I'm not making myself clear enough. Thanks.
如果我说得不够清楚,请询问更多详细信息。谢谢。
Could anyone helps me to resolve IE9&Java7 issue?
谁能帮我解决 IE9&Java7 问题?
回答by Andre Weissflog
We had the same problems in IE9, and were able to fix those by using the "object"-Tag instead of "applet", and force IE9 into IE9-document-mode through a X-UA meta tag in the HTML header. This both fixed stability problems with the Java6- and the latest Java7 runtimes.
我们在 IE9 中遇到了同样的问题,并且能够通过使用“object”-Tag 而不是“applet”来修复这些问题,并通过 HTML 标头中的 X-UA 元标记强制 IE9 进入 IE9-document-mode。这都修复了 Java6- 和最新的 Java7 运行时的稳定性问题。
回答by user1496290
We have seen this identical behavior with several of our Java applets.
我们已经在几个 Java 小程序中看到了这种相同的行为。
This issue was actually introduced in Java 7u4 and continues into 7u5.
这个问题实际上是在 Java 7u4 中引入的,并且一直延续到 7u5。
Even worse... the culprit appears to be the Java Plugin itself... so disabling 7u5 and enabling 6uXX isn't enough to address the issue. You must uninstallJava 7.
更糟糕的是……罪魁祸首似乎是 Java 插件本身……所以禁用 7u5 和启用 6uXX 不足以解决这个问题。您必须卸载Java 7。
Basically we are seeing two issues:
基本上我们看到两个问题:
- Applet simply not loading at all on the nth load attempt
- Browser deadlock
- 小程序在第 n 次加载尝试时根本没有加载
- 浏览器死锁
We have entered a bug with Oracle for this issue and have not received much of a response.
我们已经为此问题输入了 Oracle 错误,但没有收到太多回复。
The issue can easily be reproduced with Oracle's own Java Test Applet:
使用 Oracle 自己的 Java 测试小程序可以轻松重现该问题:
http://www.java.com/en/download/testjava.jsp
Here is the bug we have entered. Have you entered one as well?
这是我们输入的错误。你也输入过吗?
http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=7176027
This is a fairly catastrophic issue for our products/customers.
这对我们的产品/客户来说是一个相当灾难性的问题。
If/when you enter a bug report with Oracle, please reference the bug above as well!
如果/当您使用 Oracle 输入错误报告时,也请参考上面的错误!
回答by Fred Myers
I was having all those problems with our Applet, too -- and only with IE9 and Java 7. None of the suggestions I found online gave any improvement.
我的 Applet 也遇到了所有这些问题——而且只有 IE9 和 Java 7。我在网上找到的建议都没有带来任何改进。
Fortunately, somebody at Oracle must have been listening to all the complaints. Java 7 Update 6 became the default JRE download on 22 August 2012, and our Applet works fine now -- even without all the "fixes" I put in.
幸运的是,甲骨文的某个人一定一直在倾听所有的抱怨。Java 7 Update 6 于 2012 年 8 月 22 日成为默认的 JRE 下载,我们的 Applet 现在工作正常——即使没有我输入的所有“修复”。
回答by Jean-Philippe Leclerc
I had this problem before. I don't understand why it happens but I solved it by using a different VM at each load:
我以前遇到过这个问题。我不明白为什么会发生这种情况,但我通过在每次加载时使用不同的 VM 来解决它:
var attributes = {
code: '...',
archive: '...',
width: '...',
height: '...',
separate_jvm: true
};
var parameters = {
};
var version = '1.7';
deployJava.runApplet(attributes, parameters, version);
回答by lmiguelmh
I know this is a really old question, but I think those of us who have this problem in an old system really need an answer. In my case I am not reloading anything, my applet is injected using javascript (deploy.js), but I think the same solution could work.So after trying lots of things during two days this is the solution I got working:
我知道这是一个非常古老的问题,但我认为我们这些在旧系统中遇到此问题的人确实需要一个答案。在我的情况下,我没有重新加载任何东西,我的小程序是使用 javascript (deploy.js) 注入的,但我认为相同的解决方案可以工作。因此,在两天内尝试了很多事情之后,这是我开始工作的解决方案:
Load the Applet in a popup and close it after execution every time. I think this works because every time the popup DOM is loaded as "new" by the browser.
在弹出窗口中加载 Applet 并在每次执行后关闭它。我认为这是有效的,因为每次弹出 DOM 都被浏览器加载为“新”。
var attributes = {
code: '...Applet.class',
archive: '...applet.jar',
codebase: '/context',
width: 1,
height: 1,
separate_jvm: true
};
var parameters = {
someCallback: 'opener.appletCallback',
};
var aPopup = null;
function deployAppletInAPopup() {
setTimeout(function () {
aPopup = window.open('', '', 'width=100,height=100');
aPopup.document.open();
deployJava.runAppletIntoDocument(aPopup.document, attributes, parameters, "1.6");
aPopup.document.close();
}, 10);
}
function appletCallback() {
setTimeout(function () {
if (aPopup) {
aPopup.close();
}
aPopup = null;
}, 10);
}
[...]
<button onclick="deployAppletInAPopup()">Deploy Applet into a Popup</button>
I am using Windows 10, IE11 and jdk-8u181-windows-i586. This problem only in Java 8.
我使用的是 Windows 10、IE11 和 jdk-8u181-windows-i586。这个问题只出现在 Java 8 中。