Java 7 update 11 在 IE8 上使用 Apache Tomcat 6.0.36 破坏了 webb 应用程序

标签 java apache tomcat internet-explorer-8

<分区>

我在 Apache Tomcat 6.0.36 上运行 Web 应用程序,并使用 IE8 作为带有 Windows 7 的 Web 浏览器。我最近应用了 Java 零日补丁 (Java 7 Update 11)。

现在我所有的 Web 应用程序都出现白屏并显示消息“Internet Explorer 无法显示该网页”这是我从 catalina 日志文件中获得的错误消息。

Jan 18, 2013 3:44:55 PM org.apache.catalina.startup.Catalina start
INFO: Server startup in 38198 ms
Jan 18, 2013 3:51:17 PM org.apache.tomcat.util.net.NioEndpoint setSocketOptions
SEVERE:
java.net.SocketException: Invalid argument: no further information
at sun.nio.ch.Net.setIntOption0(Native Method)
at sun.nio.ch.Net.setSocketOption(Unknown Source)
at sun.nio.ch.SocketChannelImpl.setOption(Unknown Source)
at sun.nio.ch.SocketAdaptor.setIntOption(Unknown Source)
at sun.nio.ch.SocketAdaptor.setTrafficClass(Unknown Source)
at org.apache.tomcat.util.net.SocketProperties.setProperties(SocketProperties.java:184)
at org.apache.tomcat.util.net.NioEndpoint.setSocketOptions(NioEndpoint.java:1089)
at org.apache.tomcat.util.net.NioEndpoint$Acceptor.run(NioEndpoint.java:1314)
at java.lang.Thread.run(Unknown Source)

非常感谢任何有关如何解决此问题的想法。

谢谢。

最佳答案

原因是 setTrafficClass 调用和咬了同样的子弹一次。如果您使用 Java6 来运行 Tomcat 进程,它应该可以工作。与 Windows 网络堆栈功能有关。某些应用程序提供属性“skipTrafficClass_call=true”,但这是应用程序行为的一部分。这是一个非常老的问题,但 Java7 做了一个小而重要的改变。

引自网络:

"I've tracked down the first of these issues. Calling java.nio.channels.SocketChannel.socket().setTrafficClass() after socketChannel.connect() has been called triggers a SocketException. Moving the setTrafficClass() call to before connect() fixes the issue." " Tests on Java 6 show that the setTrafficClass() was having no effect if called after connect(). It looks like Java 7 has started to throw an exception when the setter has no effect."

A number of developers on the JDC have posted comments to indicate that the ToS bits are not set on Windows 2000 and XP. This is not a bug in the setTrafficClass implementation but rather that the IP_TOS option must be enabled by creating a registry setting. The registry setting is :-

HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\Tcpip\Parameters\DisableUserTOSSetting

http://docs.oracle.com/javase/6/docs/api/java/net/Socket.html#setTrafficClass%28int%29

http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4696356

http://tomcat.10.n6.nabble.com/Tomcat-7-Cluster-Issue-td4562937.html

您可以为连接器尝试较旧的 Http11Protocol 处理程序,这在 tomcat/conf/server.xml 文件中给出。更改 http(8080) 和 https(8443) 连接器。

<!-- protocol: org.apache.coyote.http11.Http11Protocol, same as HTTP/1.1
           org.apache.coyote.http11.Http11NioProtocol
           org.apache.coyote.http11.Http11AprProtocol
-->
<Connector port="8080" protocol="org.apache.coyote.http11.Http11Protocol"
       connectionTimeout="20000" redirectPort="8443" 
       disableUploadTimeout="true" useBodyEncodingForURI="true" />

编辑 似乎 Tomcat 7.0.30+ 解决了这个问题,您可以使用 Windows+Java7+Tomcat7+NIO 连接器。从现在开始,所有 java 网络应用程序都应该在打开连接之前设置可选的套接字选项,Java6 允许免费通过,但 Java7 会抛出异常。 http://svn.apache.org/viewvc?view=revision&revision=1358591

关于Java 7 update 11 在 IE8 上使用 Apache Tomcat 6.0.36 破坏了 webb 应用程序,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14415049/

相关文章:

java - 树中相邻 child 的比较不会发生?

php - Imagick 的 readImageBlob 函数抛出类似 'No Decode Delegate For This Image Format' 的错误

java - 记录 JDBC 访问的所有数据库对象

java - 前端 Maven 插件不能 "bower install"

java - 创建或替换并解析 Java 源代码,我无法使用 Java 源代码创建函数

apache - 如何正确配置具有自动续订的 certbot?

node.js - 如何在 Tomcat 上从 nodejs 部署 socket.io

java - 具有多个资源类的 Spring/Jersey Rest API 返回 404

java - Log4j2 自定义过滤器

windows - 在 Windows 7 上的 Apache 2.4.23 上安装 mod_security2.so