Skip to main content

Yours Truly, Confused

Posted by editor on March 9, 2006 at 11:37 AM EST

Baffling bits that break RMI

I feel a great affinity for today's "(Not So) Stupid Question", as it relates directly to a number of RMI problems I had to hack through years ago. The question from "Ashley" phrases it perfectly: "What's the deal with serialVersionUID?"

That's great: what's the deal? Because when you get bit by it, you immediately have to wonder if the cure is worse than the disease.

Not to give too much away, or take material from potential comments on the article, but serialVersionUID is meant to prevent mismatches when dealing with the serialized form of an object, in case the class has changed in ways that will prevent creating a new instance of the class from the serialized form. Where I found this popping up was in RMI, which uses serialization to exchange objects across the wire. The nightmare is that if you make any change to a class, even changing some implementation, but not the methods or the fields, you get a new serialVersionUID and hence a version mismatch exception when you try to use the class in an RMI context. Until we really understood serialVersionUID, we had to update all our servers and all our clients at the same time, which was a nightmare.

So that's one reason you might want to set it yourself. There are surely others. More importantly, what do you set serialVersionUID to, why, and when do you have to? Hopefully, we'll get answers to this question in the comments to today's Feature Article, (Not So) Stupid Questions 8: serialVersionUID.


In Projects and Communities, the classic tutorial Jan Newmarch's Guide to Jini Technologies has recently been updated, including a new Jini in One Hour section that offers a crash course in setting up and running Jini services on a network.

The GlassFish project has announced an incentive for filing bugs: "Download GlassFish milestone 5 and file a valid bug; one will be selected and the submitter will receive an Apple 20 GB iPod Photo." Carla Mott's blog has details.


In today's Forums, byhisdeeds wonders about strategies for Concurrent locks for large number of objects: "I'm recursing over about 2000 objects with multiple threads and need to have some locking to prevent two or more threads accessing the same object while it is being processed. I thought of attaching a semaphore to each object and letting the threads acquire it while using the object, which would allow the other threads to block till that object had been processed. My question is: 1) Is there a better way to handle this case than create 2000+ semaphores? 2) Is the memory footprint of the 2000+ semaphores large?"

In Re: Sources for Solaris 9?, hideya asks: "As far as I know, there is no one who has run LG3D on Solaris 9... Solaris users, is there any input here? Otherwise, we should clearly say in the getting started guide that the Solaris build is tested only with Solaris 10."


Greg Murray has some JavaScript Recomendations for AJAX Component Writers in today's Weblogs: "At Sun there are many teams creating JavaScript based components. With AJAX there are many choices on how to use different aspects of JavaScript. Here are some recommendations we came up with for using JavaScript with the focus on creating AJAX components that will interact with server based on Java technologies."

Graham Hamilton assesses AOP: Madness and Sanity: "The much-abused term 'AOP' covers a wide range of uses, some of them eminently sane and some of them eminently crazy. Here are some comments on both the good and the bad."

In JDK Community: Dream or Reality, Andreas Schaefer writes: "Currently I am not working on any patches for the JDK because I want to ensure that my time spent on this is spent worthwhile and so I want to see if it makes it into the JDK or not and in case it fails I want to know why."


In Also in Java Today, the rebelutionary weblogs relates an interesting discussion from the OpenSymphony administrators mailing list regarding heavy-duty enterprise functionality in enterprise Java frameworks, asserting that 98% of Java developers "just don't need it". "Most people don't need any of that to build their Java/J2EE applications. When I say most, I mean the 98% of people who aren't banks and although they understand 2PC have never actually needed it in their lives. The other 2% are probably banks and pay for WebLogic or WebSphere as a part of an 'enterprise software license agreement' all-you-can-eat-buffet deal anyway"

A new series from Bruce Tate looks at ways other languages solve major problems and what those solutions mean to Java developers. In Crossing borders: Exploring Active Record, he explores Active Record, the persistence engine behind Ruby on Rails. Active Record bucks many Java conventions, from the typical configuration mechanisms to fundamental architectural choices. The result is a framework that embraces radical compromises and fosters radical productivity.


In today's java.net News Headlines :

Registered users can submit news items for the java.net News Page using our news submission form. All submissions go through an editorial review before being posted to the site. You can also subscribe to the java.net News RSS feed.


Current and upcoming Java Events :

Registered users can submit event listings for the java.net Events Page using our events submission form. All submissions go through an editorial review before being posted to the site.


Archives and Subscriptions: This blog is delivered weekdays as the Java Today RSS feed. Also, once this page is no longer featured as the front page of java.net it will be archived along with other past issues in the java.net Archive.



Baffling bits that break RMI