Hi, you should really see MINA as a framework on top of NIA, ie what yu do with a single socket, you have to do the same with a MINA connection. The big difference is that a MINA session is associated with some context, but otherwise, it behaves the same.
The message you got just indicates that the underlying socket has been closed by the server. You have to deal with this, either by re-openning the connection, or by understanding why the server has closed the connection (I don't now if the protocol close a connection for some reason like a bad message has been sent, but if this is the case, you have to check your codec). One thing is sure is that once the session has been terminated, you have to create a new one. At some point, analysing the bytes sent on the wire could help (wireshark to the rescue !) to check that you are sending a correct message. Btw, please when you post a message, tell us which MINA version you are using, with the java and OS version. It can help ! On Mon, Sep 14, 2009 at 8:40 AM, Alex, Hitha <hitha.a...@sabre-holdings.com> wrote: > I am getting errors when trying to send more than one message to a > legacy tcp/ip service using a Apache camel mina endpoint in camel 1.6. > Everything works as expected when requests are send one at a time I am > not sure, if the issue is due to remote host forcibly closing > connection. My simple java socket client works fine by sending multiple > concurrent transactions to the same legacy server. I have a feeling it > is something in my mina configuration or codec setting. Does mina reuse > connections for multiple messages? The legacy system is expecting > separate connections per request. > I am using an extension of CumulativeProtocolDecoder. Do I need to do > something in dispose() method to forcibly close the connection or > session? > > > > Any clues will be appreciated. > > > > Following is the error I am getting. > > Caused by: java.io.IOException: An existing connection was forcibly > closed > by the remote host > at sun.nio.ch.SocketDispatcher.read0(Native Method) > at sun.nio.ch.SocketDispatcher.read(SocketDispatcher.java:25) > at sun.nio.ch.IOUtil.readIntoNativeBuffer(IOUtil.java:233) > at sun.nio.ch.IOUtil.read(IOUtil.java:200) > at sun.nio.ch.SocketChannelImpl.read(SocketChannelImpl.java:236) > > at > > org.apache.mina.transport.socket.nio.SocketIoProcessor.read(SocketIoProc > essor.java:218) > at > > org.apache.mina.transport.socket.nio.SocketIoProcessor.process(SocketIoP > rocessor.java:198) > > > > > > Thanks, > > > > Hitha > > 682-605-1897 > > > > > > > > -- Regards, Cordialement, Emmanuel Lécharny www.iktek.com