<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<body link="#355491" alink="#4262a1" vlink="#355491" style="background: #e2e2e2; margin: 0; padding: 20px;">

<div>
        <table cellpadding="0" bgcolor="#FFFFFF" border="0" cellspacing="0" style="border: 1px solid #dadada; margin-bottom: 30px; width: 100%; -moz-border-radius: 6px; -webkit-border-radius: 6px;">
                <tbody>
                        <tr>

                                <td>

                                        <table border="0" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF" style="border: solid 2px #ccc; background: #dadada; width: 100%; -moz-border-radius: 6px; -webkit-border-radius: 6px;">
                                                <tbody>
                                                        <tr>
                                                                <td bgcolor="#000000" valign="middle" height="58px" style="border-bottom: 1px solid #ccc; padding: 20px; -moz-border-radius-topleft: 3px; -moz-border-radius-topright: 3px; -webkit-border-top-right-radius: 5px; -webkit-border-top-left-radius: 5px;">
                                                                        <h1 style="color: #333333; font: bold 22px Arial, Helvetica, sans-serif; margin: 0; display: block !important;">
                                                                        <!-- To have a header image/logo replace the name below with your img tag -->
                                                                        <!-- Email clients will render the images when the message is read so any image -->
                                                                        <!-- must be made available on a public server, so that all recipients can load the image. -->
                                                                        <a href="http://community.jboss.org/index.jspa" style="text-decoration: none; color: #E1E1E1">JBoss Community</a></h1>
                                                                </td>

                                                        </tr>
                                                        <tr>
                                                                <td bgcolor="#FFFFFF" style="font: normal 12px Arial, Helvetica, sans-serif; color:#333333; padding: 20px;  -moz-border-radius-bottomleft: 4px; -moz-border-radius-bottomright: 4px; -webkit-border-bottom-right-radius: 5px; -webkit-border-bottom-left-radius: 5px;"><h3 style="margin: 10px 0 5px; font-size: 17px; font-weight: normal;">
    Native Netty based server / Embedded Tomcat
</h3>
<span style="margin-bottom: 10px;">
    created by <a href="http://community.jboss.org/people/hanhanter">Eugene Adams</a> in <i>JBoss Remoting</i> - <a href="http://community.jboss.org/message/549674#549674">View the full discussion</a>
</span>
<hr style="margin: 20px 0; border: none; background-color: #dadada; height: 1px;">

<div class="jive-rendered-content"><p>Hi,</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>I have a custom server which relies heavily on threading(with Netty as IOLayer).&#160; 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.&#160; What do I have to look out for and where do I start?&#160; I have deployed the service as a .sar, but it gives me exceptions like the following after I try to hit the JMX console :</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>2010-06-25 09:35:09,401 ERROR <a class="jive-link-external-small" href="org.apache.coyote.http11.Http11AprProtocol">org.apache.coyote.http11.Http11AprProtocol</a> (http-jmx.my.server.domain%2F192.168.1.100-8080-1) Error reading request, ignoredjava.lang.ExceptionInInitializerError&#160;&#160;&#160;&#160;&#160;&#160;&#160; at java.nio.ByteBuffer.allocateDirect(ByteBuffer.java:288)&#160;&#160;&#160;&#160;&#160;&#160;&#160; at org.apache.coyote.http11.InternalAprInputBuffer.(DirectByteBuffer.java:33)&#160;&#160;&#160;&#160;&#160;&#160;&#160; ... 7 more</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>The error is on Bits.java:592 :</p><p><p>static boolean unaligned() {</p><p>&#160;&#160;&#160; if (unalignedKnown)</p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160; return unaligned;</p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160; PrivilegedAction pa</p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160; = new sun.security.action.GetPropertyAction("os.arch");</p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160; String arch = (String)AccessController.doPrivileged(pa);</p><p>&#160;&#160;&#160; unaligned = arch.equals("i386") || arch.equals("x86") || arch.equals("amd64"); &amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;</p><p>&#160;&#160;&#160; unalignedKnown = true;</p><p>&#160;&#160;&#160; return unaligned;</p><p>&#160;&#160;&#160; }</p></p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>How do I configure my service in jboss as a native embedded application and ... why is it giving this error?</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>Thanks!</p></div>

<div style="background-color: #f4f4f4; padding: 10px; margin-top: 20px;">
    <p style="margin: 0;">Reply to this message by <a href="http://community.jboss.org/message/549674#549674">going to Community</a></p>
        <p style="margin: 0;">Start a new discussion in JBoss Remoting at <a href="http://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2050">Community</a></p>
</div></td>
                        </tr>
                    </tbody>
                </table>


                </td>
            </tr>
        </tbody>
    </table>

</div>

</body>
</html>