将其他 HTTP 连接器与 JBoss 5.1 一起使用

发布于 2024-09-18 10:16:38 字数 1381 浏览 4 评论 0原文

我正在尝试使用比 JBoss 默认 HTTP/1.1 连接器“更好”的 HTTP 连接器。按照 BalusC 的建议,我更改了连接器在 server.xml 中:

<Connector protocol="org.apache.coyote.http11.Http11NioProtocol"
                 port="8080" address="${jboss.bind.address}" 
                 connectionTimeout="20000"
                 redirectPort="8443"
                 compression="force" />

但是 JBoss 在启动时抛出 ClassNotFoundException - 我一定是缺少一个 JAR。 (看起来 NIO 连接器需要 Tomcat 6,但我找不到 JBoss 5.1 附带的 Tomcat 版本... grumble,@#$%^ing JBoss 文档)

11:43:19,034 ERROR [Connector] Protocol handler instantiation failed: java.lang.ClassNotFoundException: org.apache.coyote.http11.Http11NioProtocol from BaseClassLoader@1ed3e5f ... blah blah blah ...
11:43:19,263 INFO  [AprLifecycleListener] The Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: C:\Program Files (x86)\Java\jre6\bin; ... lots more classpath stuff...

经过一番谷歌搜索后,看起来这实际上可能不是正确使用的连接器。 这个 jboss.org 线程 让我觉得我应该使用 APR 连接器。也就是说,我真的看不出两者之间的区别。

哪一种连接器是正确的?如何正确设置它?

I'm trying to use a "better" HTTP connector than JBoss' default HTTP/1.1 connector. Following BalusC's recommendations, I changed the connector in server.xml to:

<Connector protocol="org.apache.coyote.http11.Http11NioProtocol"
                 port="8080" address="${jboss.bind.address}" 
                 connectionTimeout="20000"
                 redirectPort="8443"
                 compression="force" />

But JBoss throws a ClassNotFoundException when it starts - I must be missing a JAR. (It looks like the NIO connector requires Tomcat 6, but I can't find what Tomcat version that JBoss 5.1 comes with... grumble, @#$%^ing JBoss documentation)

11:43:19,034 ERROR [Connector] Protocol handler instantiation failed: java.lang.ClassNotFoundException: org.apache.coyote.http11.Http11NioProtocol from BaseClassLoader@1ed3e5f ... blah blah blah ...
11:43:19,263 INFO  [AprLifecycleListener] The Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: C:\Program Files (x86)\Java\jre6\bin; ... lots more classpath stuff...

After a bunch of Googling, it looks like that might not actually be the right connector to use. This jboss.org thread makes me think I should use the APR connector instead. That said, I don't really see the difference between the two.

Which connector is the right one, and how do I get it set up properly?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

紧拥背影 2024-09-25 10:16:38

Nio 连接并不比标准连接器好。它只是具有非阻塞功能。

APR-connector 是本机实现,因此应该更快一些。它还更好地支持 SSL(更多配置选项和加密)。

APR-connection的配置取决于tomcat的版本。

要找出 tomcat 的版本,请创建一个包含以下内容的 JSP 文件:

<%= application.getServerInfo() %>

Nio connection is no better than the standard connector. It just has non-blocking functionality.

APR-connector is a native implementation, so should be somewhat faster. It also supports SSL better (more configuration options and encryptions).

The configuration of APR-connection depends on the version of tomcat.

To find out the version of tomcat create a JSP file with content:

<%= application.getServerInfo() %>
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文