[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: problem with java.util.Map



On Sun, 06 Aug 2000, Don Berendsen wrote:
> I've run into some problems using TreeMaps with ozone 0.5.3, Java 1.3, 
> Win98.
> 
> Trying to return any entrySet (or keySet) results in a 
> java.lang.NullPointerException. Is this a programming error? See example 
> below.

The entrySet() method of TreeMap returns an inner class that represents an
_stateless_ set view on the map. When returning this inner class from an
database method, ozone tries to serialize it in order to return it to the
client. This does not work.

Try to make a new set, put all the entries from the TreeMap into it and return
this new set to the client. This should work but it would run slow and is
probably not what you want because changes to this new set are not reflected in
the map and vice versa.

So, the best solution would be to put the code that deals with the set right on
the server inside a method of MapTesterImpl.


Falko
-- 
______________________________________________________________________
Falko Braeutigam                              mailto:falko@smb-tec.com
SMB GmbH                                        http://www.smb-tec.com