Hello:

I have a question about mina - wondering if someone out there has a couple 
minutes to help out:

I have a server running mina-2.0.0M1 (which is pretty old) which opens both a 
non-SSL and SSL ports. There are two issues I'm seeing in production - I'm not 
sure that this is mina related - still investigating, but right now, it looks 
to be comms related.

1. Every 4 days or so (so far, can't correlate to anything) the server "locks 
up" and refuses all subsequent requests (?). Trying to narrow down, I have been 
informed that there may be an issue with mina-core-2.0.0M1, and I should 
upgrade to mina-core-2.0.0M6. I've done this - the compile was pretty 
straightforward. The init code is attached below - does this look correct - 
just want to make sure that I'm not doing something wrong which might cause 
resources to leak over time.

2. I've noticed one recurring error in my log files - in my HttpRequestDecoder 
(extends MessageDecoderAdapter), I am throwing an exception trying to parse up 
the headers - the code ends up getting "partial line" headers (for example, the 
decoder attempts to parse a line "Content-Ty" with nothing else on the line) - 
it seems like the HTTP packet is not complete - should I be concerned about 
this? An exception is thrown, and the caller will re-send anyways, but the 
error is seen a fair bit throughout the logs, and I'm wondering if this might 
be contributing to the lock up issue (?).

Any help is appreciated - I'm flying a bit blind trying to track this down.

Regards,

Brian Parkinson
ecobee inc.
[email protected]

---

Here's how the mina server is set up:

private void start()
{
        makeConnection(8382, false);
        makeConnection(8383, true);
}

private void makeConnection(int port, boolean sslEnabled) throws Exception
{
        // Create an acceptor
        NioSocketAcceptor acceptor = new NioSocketAcceptor();
        
    DefaultIoFilterChainBuilder chain = acceptor.getFilterChain();

        // Create a service configuration
    chain.addLast("protocolFilter", new ProtocolCodecFilter(new 
HttpServerProtocolCodecFactory()));
                
        if(sslEnabled)
        {
                Log.info(Server.class, "start", "Adding SSL filter."); 
                
                SslFilter sslFilter = new 
SslFilter(SslContextFactory.getServerContext());
                
                chain.addFirst("sslFilter", sslFilter);
        }
        
        if(logEnabled_)
        {
                Log.info(Server.class, "start", "Adding log filter."); 
                
                chain.addLast("logger", new LoggingFilter());
        }
                
    // Add in the custom filter which manages session information within the 
server.
        // Add to the front of the chain, as we trap everything we need to here.
    chain.addFirst("myFilter", new ServerFilter(sslEnabled));

    // Set up the local address.
        acceptor.setDefaultLocalAddress(new InetSocketAddress(port));
        
        // Create the server handler and bind id to the acceptor.
        RequestHandler handler = new RequestHandler(sslEnabled);
        acceptor.setHandler(handler);
        acceptor.bind();
}

Reply via email to