Native Netty based server / Embedded Tomcat
hanhanter Jun 25, 2010 8:03 AMHi,
I have a custom server which relies heavily on threading(with Netty as IOLayer). Now this server has run as an independent server as a client of JBoss for a few years, but I am toying around with embedding this server inside JBoss, same as the native Tomcat service. What do I have to look out for and where do I start? I have deployed the service as a .sar, but it gives me exceptions like the following after I try to hit the JMX console :
2010-06-25 09:35:09,401 ERROR [org.apache.coyote.http11.Http11AprProtocol] (http-jmx.my.server.domain%2F192.168.1.100-8080-1) Error reading request, ignored
java.lang.ExceptionInInitializerError
at java.nio.ByteBuffer.allocateDirect(ByteBuffer.java:288)
at org.apache.coyote.http11.InternalAprInputBuffer.<init>(InternalAprInputBuffer.java:62)
at org.apache.coyote.http11.Http11AprProcessor.<init>(Http11AprProcessor.java:90)
at org.apache.coyote.http11.Http11AprProtocol$Http11ConnectionHandler.createProcessor(Http11AprProtocol.java:636)
at org.apache.coyote.http11.Http11AprProtocol$Http11ConnectionHandler.process(Http11AprProtocol.java:587)
at org.apache.tomcat.util.net.AprEndpoint$Worker.run(AprEndpoint.java:2036)
at java.lang.Thread.run(Thread.java:619)
Caused by: java.lang.NullPointerException
at java.nio.Bits.unaligned(Bits.java:592)
at java.nio.DirectByteBuffer.<clinit>(DirectByteBuffer.java:33)
... 7 more
The error is on Bits.java:592 :
static boolean unaligned() {
if (unalignedKnown)
return unaligned;
PrivilegedAction pa
= new sun.security.action.GetPropertyAction("os.arch");
String arch = (String)AccessController.doPrivileged(pa);
unaligned = arch.equals("i386") || arch.equals("x86") || arch.equals("amd64"); <<<<<<<<<<<<<<<<
unalignedKnown = true;
return unaligned;
}
How do I configure my service in jboss as a native embedded application and ... why is it giving this error?
Thanks!