views:

82

answers:

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 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?

A: 

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() %>
iimuhin
Non-blocking functionality is definitely a plus for me, since it doesn't create a thread for every request, so it scales better. My app is fairly Ajax- and comet-heavy. Does APR provide this as well?
Matt Ball
`<%= application.getServerInfo() %>` printed `JBoss Web/2.1.3.GA`. It turns out that JBoss doesn't include Tomcat, but a _fork_ of Tomcat, which they call JBoss Web. It looks like JBoss Web 2.1.x _and_ 3.0.x both correspond to (I guess, are forks of?) Tomcat 6.0. http://docs.jboss.org/jbossweb/2.1.x/
Matt Ball