You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@mina.apache.org by Akbar Munir <na...@akbarmunir.com> on 2007/01/16 14:04:51 UTC

Mina 1.0.1 on Windows XP (SP2)

I have been using Mina 0.8 for a while now. When 1.0 came out, I tried to
upgrade but was having the most basic problem of not being able to receive
any message on the server side. Other IoHandler notifications were also not
being called. I did post on this forum and some people tested the code on
their machines and found it to be working fine over there.

With Mina 1.0.1, I am having the same problem. None of the IoHandler
notifications are called. If I use SocketConnector, it never connects. I
have written the most basic code possible. Also tried Mina Reverser example
with a 3rd party client. The client was able to connect to the Reverser
server, but did not receive anything from it. Ethereal shows that connection
is established, and then packets are sent from Client to the Server, with
ACKs coming from Server to the Client. But the "messageReceived" in the
"ReverseProtocolHandler" is never called. I am using following :

1. Netbeans 5.5 (Have also tried with 5.0)
2. Java 6 (Have also tried with 1.50.09)
3. Windows XP (SP2)

Though I asked this question before too, but I would greatly appreciate if
someone can point me to my ignorance? :(. I really would want to move to
latest release of Mina.

Thanks,
Akbar.
-- 
View this message in context: http://www.nabble.com/Mina-1.0.1-on-Windows-XP-%28SP2%29-tf3020798.html#a8389748
Sent from the mina dev mailing list archive at Nabble.com.


Re: Mina 1.0.1 on Windows XP (SP2)

Posted by Akbar Munir <na...@akbarmunir.com>.
Thanks for help. The problem is gone now. By mistake, I used the log4j1.3
library of slfj whereas the actual log4j I was using in the project was 1.2.
I think it must have been throwing some exception inside which were caught
in the code. I did not get a clue of it till I started to step in the MINA
code.

Thanks,
Akbar.


Akbar Munir wrote:
> 
> Sure. I have attached the server code at the end of this mail. The
> IoHandler I am using is a basic one, with only one System.out.println in
> each of the notifications.
> 
> While debugging, this is where I get stuck. The message is indeed received
> by the framework. It comes all the way to the class "ExecutorFilter" and
> the method "ExecutorFilter.fireEvent()" is called. In this method, the
> event is added to the eventQueue of the SessionBuffer. But right at the
> next line "if( buf.processingCompleted )", the condition is always false,
> so the event never gets fired.
> 
> The server code is :
> 
> ---------------- START ----------------------------
> public class CServer
> {
>     public static void main(String[] a_strArrayOfArguments) throws
> Exception
>     {
> 	new SocketAcceptor().bind(new InetSocketAddress(1122), new CIoHandler(),
> null);
> 	System.out.println("Server started");
>     }
> }
> -------------- END ---------------------------------
> 
> The IoHandler code is :
> 
> ------------- START --------------------------------
> public class CIoHandler extends IoHandlerAdapter
> {
>     public void exceptionCaught(IoSession session, Throwable cause) throws
> Exception
>     {
> 	System.out.println("Caught");
>     }
>     
>     public void messageReceived(IoSession session, Object message) throws
> Exception
>     {
> 	System.out.println("Received: " + message);
>     }
>     
>     public void messageSent(IoSession session, Object message) throws
> Exception
>     {
> 	System.out.println("Sent: " + message);
>     }
>     
>     public void sessionClosed(IoSession session) throws Exception
>     {
> 	System.out.println("Closed");
>     }
>     
>     public void sessionCreated(IoSession session) throws Exception
>     {
> 	System.out.println("Created");
>     }
>     
>     public void sessionIdle(IoSession session, IdleStatus status) throws
> Exception
>     {
> 	System.out.println("Idle: " + status);
>     }
>     
>     public void sessionOpened(IoSession session) throws Exception
>     {
> 	System.out.println("Opened");
>     }
> }
> ------------------- END ----------------------------------------
> 
> 
> Mark Webb-4 wrote:
>> 
>> Is there any code you can post that would help us?
>> 
>> On 1/16/07, Akbar Munir <na...@akbarmunir.com> wrote:
>>>
>>>
>>> I have been using Mina 0.8 for a while now. When 1.0 came out, I tried
>>> to
>>> upgrade but was having the most basic problem of not being able to
>>> receive
>>> any message on the server side. Other IoHandler notifications were also
>>> not
>>> being called. I did post on this forum and some people tested the code
>>> on
>>> their machines and found it to be working fine over there.
>>>
>>> With Mina 1.0.1, I am having the same problem. None of the IoHandler
>>> notifications are called. If I use SocketConnector, it never connects. I
>>> have written the most basic code possible. Also tried Mina Reverser
>>> example
>>> with a 3rd party client. The client was able to connect to the Reverser
>>> server, but did not receive anything from it. Ethereal shows that
>>> connection
>>> is established, and then packets are sent from Client to the Server,
>>> with
>>> ACKs coming from Server to the Client. But the "messageReceived" in the
>>> "ReverseProtocolHandler" is never called. I am using following :
>>>
>>> 1. Netbeans 5.5 (Have also tried with 5.0)
>>> 2. Java 6 (Have also tried with 1.50.09)
>>> 3. Windows XP (SP2)
>>>
>>> Though I asked this question before too, but I would greatly appreciate
>>> if
>>> someone can point me to my ignorance? :(. I really would want to move to
>>> latest release of Mina.
>>>
>>> Thanks,
>>> Akbar.
>>> --
>>> View this message in context:
>>> http://www.nabble.com/Mina-1.0.1-on-Windows-XP-%28SP2%29-tf3020798.html#a8389748
>>> Sent from the mina dev mailing list archive at Nabble.com.
>>>
>>>
>> 
>> 
>> -- 
>> ..Cheers
>> Mark
>> 
>> 
> 
> 

-- 
View this message in context: http://www.nabble.com/Mina-1.0.1-on-Windows-XP-%28SP2%29-tf3020798.html#a8390354
Sent from the mina dev mailing list archive at Nabble.com.


Re: Mina 1.0.1 on Windows XP (SP2)

Posted by Akbar Munir <na...@akbarmunir.com>.
Sure. I have attached the server code at the end of this mail. The IoHandler
I am using is a basic one, with only one System.out.println in each of the
notifications.

While debugging, this is where I get stuck. The message is indeed received
by the framework. It comes all the way to the class "ExecutorFilter" and the
method "ExecutorFilter.fireEvent()" is called. In this method, the event is
added to the eventQueue of the SessionBuffer. But right at the next line
"if( buf.processingCompleted )", the condition is always false, so the event
never gets fired.

The server code is :

---------------- START ----------------------------
public class CServer
{
    public static void main(String[] a_strArrayOfArguments) throws Exception
    {
	new SocketAcceptor().bind(new InetSocketAddress(1122), new CIoHandler(),
null);
	System.out.println("Server started");
    }
}
-------------- END ---------------------------------

The IoHandler code is :

------------- START --------------------------------
public class CIoHandler extends IoHandlerAdapter
{
    public void exceptionCaught(IoSession session, Throwable cause) throws
Exception
    {
	System.out.println("Caught");
    }
    
    public void messageReceived(IoSession session, Object message) throws
Exception
    {
	System.out.println("Received: " + message);
    }
    
    public void messageSent(IoSession session, Object message) throws
Exception
    {
	System.out.println("Sent: " + message);
    }
    
    public void sessionClosed(IoSession session) throws Exception
    {
	System.out.println("Closed");
    }
    
    public void sessionCreated(IoSession session) throws Exception
    {
	System.out.println("Created");
    }
    
    public void sessionIdle(IoSession session, IdleStatus status) throws
Exception
    {
	System.out.println("Idle: " + status);
    }
    
    public void sessionOpened(IoSession session) throws Exception
    {
	System.out.println("Opened");
    }
}
------------------- END ----------------------------------------


Mark Webb-4 wrote:
> 
> Is there any code you can post that would help us?
> 
> On 1/16/07, Akbar Munir <na...@akbarmunir.com> wrote:
>>
>>
>> I have been using Mina 0.8 for a while now. When 1.0 came out, I tried to
>> upgrade but was having the most basic problem of not being able to
>> receive
>> any message on the server side. Other IoHandler notifications were also
>> not
>> being called. I did post on this forum and some people tested the code on
>> their machines and found it to be working fine over there.
>>
>> With Mina 1.0.1, I am having the same problem. None of the IoHandler
>> notifications are called. If I use SocketConnector, it never connects. I
>> have written the most basic code possible. Also tried Mina Reverser
>> example
>> with a 3rd party client. The client was able to connect to the Reverser
>> server, but did not receive anything from it. Ethereal shows that
>> connection
>> is established, and then packets are sent from Client to the Server, with
>> ACKs coming from Server to the Client. But the "messageReceived" in the
>> "ReverseProtocolHandler" is never called. I am using following :
>>
>> 1. Netbeans 5.5 (Have also tried with 5.0)
>> 2. Java 6 (Have also tried with 1.50.09)
>> 3. Windows XP (SP2)
>>
>> Though I asked this question before too, but I would greatly appreciate
>> if
>> someone can point me to my ignorance? :(. I really would want to move to
>> latest release of Mina.
>>
>> Thanks,
>> Akbar.
>> --
>> View this message in context:
>> http://www.nabble.com/Mina-1.0.1-on-Windows-XP-%28SP2%29-tf3020798.html#a8389748
>> Sent from the mina dev mailing list archive at Nabble.com.
>>
>>
> 
> 
> -- 
> ..Cheers
> Mark
> 
> 

-- 
View this message in context: http://www.nabble.com/Mina-1.0.1-on-Windows-XP-%28SP2%29-tf3020798.html#a8390101
Sent from the mina dev mailing list archive at Nabble.com.


Re: Mina 1.0.1 on Windows XP (SP2)

Posted by Mark Webb <el...@gmail.com>.
Is there any code you can post that would help us?

On 1/16/07, Akbar Munir <na...@akbarmunir.com> wrote:
>
>
> I have been using Mina 0.8 for a while now. When 1.0 came out, I tried to
> upgrade but was having the most basic problem of not being able to receive
> any message on the server side. Other IoHandler notifications were also
> not
> being called. I did post on this forum and some people tested the code on
> their machines and found it to be working fine over there.
>
> With Mina 1.0.1, I am having the same problem. None of the IoHandler
> notifications are called. If I use SocketConnector, it never connects. I
> have written the most basic code possible. Also tried Mina Reverser
> example
> with a 3rd party client. The client was able to connect to the Reverser
> server, but did not receive anything from it. Ethereal shows that
> connection
> is established, and then packets are sent from Client to the Server, with
> ACKs coming from Server to the Client. But the "messageReceived" in the
> "ReverseProtocolHandler" is never called. I am using following :
>
> 1. Netbeans 5.5 (Have also tried with 5.0)
> 2. Java 6 (Have also tried with 1.50.09)
> 3. Windows XP (SP2)
>
> Though I asked this question before too, but I would greatly appreciate if
> someone can point me to my ignorance? :(. I really would want to move to
> latest release of Mina.
>
> Thanks,
> Akbar.
> --
> View this message in context:
> http://www.nabble.com/Mina-1.0.1-on-Windows-XP-%28SP2%29-tf3020798.html#a8389748
> Sent from the mina dev mailing list archive at Nabble.com.
>
>


-- 
..Cheers
Mark