Using other HTTP connectors with JBoss 5.1
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 proto开发者_如何学编程col="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?
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() %>
精彩评论