You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@mina.apache.org by "Emmanuel Lecharny (JIRA)" <ji...@apache.org> on 2009/02/13 09:11:59 UTC

[jira] Commented: (DIRMINA-662) DummySession.close(false) throws NullPointerException

    [ https://issues.apache.org/jira/browse/DIRMINA-662?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12673173#action_12673173 ] 

Emmanuel Lecharny commented on DIRMINA-662:
-------------------------------------------

I confirm the issue. It's a bug in the DummyIoSession processor implementation :

        processor = new IoProcessor<AbstractIoSession>() {
            public void add(AbstractIoSession session) {
            }

            public void flush(AbstractIoSession session) {
                DummySession s = (DummySession) session;
                WriteRequest req = s.getWriteRequestQueue().poll(session);
--->          Object m = req.getMessage();

Here, if the session has been closed, the writeQueue has been emptied, and we won't get back any request. This will immediately cause a NPE to be generated while trying to get the message from a null request.

Fixed in : http://svn.apache.org/viewvc?rev=744025&view=rev



> DummySession.close(false) throws NullPointerException
> -----------------------------------------------------
>
>                 Key: DIRMINA-662
>                 URL: https://issues.apache.org/jira/browse/DIRMINA-662
>             Project: MINA
>          Issue Type: Bug
>          Components: Core
>    Affects Versions: 2.0.0-M4
>         Environment: All?
>            Reporter: David Rosenstrauch
>            Priority: Minor
>
> There appears to be a bug when calling DummySession.close(false):
> Feb 12, 2009 3:39:20 PM org.apache.mina.core.service.IoHandlerAdapter exceptionCaught
> WARNING: EXCEPTION, please implement Handler.exceptionCaught() for proper handling:
> java.lang.NullPointerException
>     at org.apache.mina.core.session.DummySession$6.flush(DummySession.java:138)
>     at org.apache.mina.core.session.DummySession$6.flush(DummySession.java:131)
>     at org.apache.mina.core.session.AbstractIoSession.closeOnFlush(AbstractIoSession.java:246)
>     at org.apache.mina.core.session.AbstractIoSession.close(AbstractIoSession.java:224)
>     at Handler.messageReceived(TestDummyIoSession.java:32)
>     at org.apache.mina.core.filterchain.DefaultIoFilterChain$TailFilter.messageReceived(DefaultIoFilterChain.java:722)
>     at org.apache.mina.core.filterchain.DefaultIoFilterChain.callNextMessageReceived(DefaultIoFilterChain.java:434)
>     at org.apache.mina.core.filterchain.DefaultIoFilterChain.access$1200(DefaultIoFilterChain.java:48)
>     at org.apache.mina.core.filterchain.DefaultIoFilterChain$EntryImpl$1.messageReceived(DefaultIoFilterChain.java:802)
>     at org.apache.mina.core.filterchain.IoFilterAdapter.messageReceived(IoFilterAdapter.java:120)
>     at org.apache.mina.core.filterchain.DefaultIoFilterChain.callNextMessageReceived(DefaultIoFilterChain.java:434)
>     at org.apache.mina.core.filterchain.DefaultIoFilterChain.fireMessageReceived(DefaultIoFilterChain.java:426)
>     at TestDummyIoSession.testSessionCloseListener(TestDummyIoSession.java:17)
>     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>     at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
>     at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>     at java.lang.reflect.Method.invoke(Method.java:597)
>     at junit.framework.TestCase.runTest(TestCase.java:164)
>     at junit.framework.TestCase.runBare(TestCase.java:130)
>     at junit.framework.TestResult$1.protect(TestResult.java:106)
>     at junit.framework.TestResult.runProtected(TestResult.java:124)
>     at junit.framework.TestResult.run(TestResult.java:109)
>     at junit.framework.TestCase.run(TestCase.java:120)
>     at junit.framework.TestSuite.runTest(TestSuite.java:230)
>     at junit.framework.TestSuite.run(TestSuite.java:225)
>     at org.eclipse.jdt.internal.junit.runner.junit3.JUnit3TestReference.run(JUnit3TestReference.java:130)
>     at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
>     at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:460)
>     at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:673)
>     at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:386)
>     at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:196) 

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.