Google
 
Web unafbapune.blogspot.com

Friday, June 23, 2006

 

Bug Patch Mina 0.8.2

Update on 6July06:It turns out the root cause of the problem is related to my Decoder implementation. More details can be found in the JIRA Issue.

The lesson is: Don't use Mina 0.8.2. Go for Mina 0.9.4+ or else risk data corruption.

Update on 4July06: JIRA Issue submitted to the Mina group.

Just found a nasty race condition in using
org.apache.mina.util.Queue
in Mina 0.8.2.

When invoked from IOAdapter$SessionHandlerAdapter.dowrite(), the Queue.isEmpty() is not properly synchronized. This causes data corruption when the network IO is under high load! I was hit by it when I changed my log4j configuration to use pure asyn appenders.

The good news is it's easy to patch. I simply took the gut out of the original Mina's queue implementation, and replaced it with a simple delegation to
java.util.concurrent.ConcurrentLinkedQueue
There are some features lost such as the removal of the List interface (from the Mina's Queue class). But in this case the additional List interface methods are not actually used anywhere else in Mina 0.8.2!

IMHO, Mina should really take advantage of JKD5 features such as non-blocking synchronization , instead of having synchronized statements/blocks all over the places. After all, isn't Mina all about performance ?

(Will try to post the patch back to the Mina group when I got a chance.)

Friday, June 16, 2006

 

Java Xml Binding

Thinking of which Java XML binding technology to use for building your
next web services ? JAXB, JiBX, Castor, XmlBean, XStream ?

No more. With Spring Web Services 1.0M1, simply use the same
Marshaller/Unmarshaller interfaces, and the different O/X mapping
implementations can be instantly swapped in and out as you wish! No
brainer. Or at least it seems so.

Sunday, June 11, 2006

 

Latest Jaxb RI 2.0.1 Fluent API Plugin available!

Due to the specific web service environment in my workplace, I didn't have a chance to touch JAXB RI 2.0.x for quite a while after writing the Fluent API plugin. There is recently an interesting request by Kenny MacLeod about enhancing the plugin to generate fluent setter method with variable arguments for List member fields.

So I spent quite some time to refresh myself as to what exactly I have done, and went tweaking, and tweaking. Finally, the enhanced plugin is now available for download :)

The plugin has also been submitted to maven 2 for distribution. Details here and here.

This page is powered by Blogger. Isn't yours?