mina-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Wilson Yeung" <wilsy...@gmail.com>
Subject exception in OrderedThreadPoolExecutor
Date Fri, 15 Feb 2008 01:21:49 GMT
After sending a bunch of UDP datagrams, sleep for 30 seconds, then
this gets printed to console:

     [java] Exception in thread "pool-1-thread-1" java.lang.NullPointerException
     [java] 	at
org.apache.mina.filter.executor.OrderedThreadPoolExecutor.getSessionBuffer(OrderedThreadPoolExecutor.java:447)
     [java] 	at
org.apache.mina.filter.executor.OrderedThreadPoolExecutor.access$900(OrderedThreadPoolExecutor.java:52)
     [java] 	at
org.apache.mina.filter.executor.OrderedThreadPoolExecutor$Worker.run(OrderedThreadPoolExecutor.java:492)
     [java] 	at java.lang.Thread.run(Thread.java:613)

And then no more messages are ever sent despite how I might try.

If I modify OrderedThreadPoolExecutor like so:

clara:executor wilson$ svn diff OrderedThreadPoolExecutor.java
Index: OrderedThreadPoolExecutor.java
===================================================================
--- OrderedThreadPoolExecutor.java	(revision 627903)
+++ OrderedThreadPoolExecutor.java	(working copy)
@@ -489,7 +489,9 @@
                     }

                     try {
-                        runTasks(getSessionBuffer(session));
+                       if (session != null) {
+                            runTasks(getSessionBuffer(session));
+                        }
                     } finally {
                         idleWorkers.incrementAndGet();
                     }

Then all is well.  Any ideas?  Am I abusing Mina, or is it an honest
to goodness Mina bug?

Wilson

Mime
View raw message