Java
XStream and joda time
14/02/09 18:10
If you have the choice to use an alternative to
java.util.Date you shoud look at Joda Time. Joda Time
is date handling done right and is going to be used
in Java 7 if I am not mistaken. We use it with good
success in our project now.
We also serialize our objects using XStream which is a nice Object to XML framework which just does the trick, and for a long time we thought it was working out of the box. Last wednesday we run into a snag that after serializing Joda Time DateTime objects in one JVM and attempted to deserialize them in another it fails. After looking into it, it appears that XStream does a heroic attemt at serializing and deserializing DateTime objects, and it works fine if you are in the same JVM. Though when you do this across several JVM it fails.
To solve it I had to introduce custom serialization for DateTime and LocalDate, which serialize them into a nice formatted string insted of the internal structure of Joda Time.
We also serialize our objects using XStream which is a nice Object to XML framework which just does the trick, and for a long time we thought it was working out of the box. Last wednesday we run into a snag that after serializing Joda Time DateTime objects in one JVM and attempted to deserialize them in another it fails. After looking into it, it appears that XStream does a heroic attemt at serializing and deserializing DateTime objects, and it works fine if you are in the same JVM. Though when you do this across several JVM it fails.
To solve it I had to introduce custom serialization for DateTime and LocalDate, which serialize them into a nice formatted string insted of the internal structure of Joda Time.
|
Netbeans UI builder switching from Java 6 to Java 5 or the other way around
31/01/09 16:47
The project I'm in are using Swing UI builder to do
our dialogs, but we are forced to use Java 5. This
means that we are using extra libraries as we use the
group layout manager. When creating a new dialog I
managed to get started using Java 6. After noticing
this I tried to go back to using Java 5, but the
generated files from netbeans insisted of using the
javax.swing libraries and not the compatibility
libraries. After searching the web I found no
solution, but I managed to find it on my own.
The generator mode is coded in the .form file that tags along the dialog - if you want to change mode after creation you must edit it in an editor outside of netbeans:
<AuxValue name="FormSettings_layoutCodeTarget" type="java.lang.Integer" value="2"/>
Value 1 means that it uses java 6 - value 2 means that it uses the libraries compatible with Java 5.
The generator mode is coded in the .form file that tags along the dialog - if you want to change mode after creation you must edit it in an editor outside of netbeans:
<AuxValue name="FormSettings_layoutCodeTarget" type="java.lang.Integer" value="2"/>
Value 1 means that it uses java 6 - value 2 means that it uses the libraries compatible with Java 5.
Working with Mule
09/11/08 11:53
Having worked a lot to get Mule to communicate with
JMS using ActiveMQ I thought I should share what I
have learned. Read
More...
Java One and Community day summary
12/05/08 13:08
Read on for my summary of thoughts of Java One. This
article is really a best of/attempt of better writing
of the 6 articles summing up Java One and Sun
community One. Read
More...
Java One - day 4 (last one)
09/05/08 17:50
Day 4, this is the last day of the fun. Not that it
is a major problem, as our brains are slowly filling
up. Read
More...
Java + You - Java One topic
06/05/08 18:14
Day one on Java One. Afraid that these are more my
notes. If you find them too messy, complain and I'll
make a better end of week post
Read
More...
Sun Community one.
05/05/08 17:24
Todays impressions from Sun Community one. This is a
mix of notes taken by me during the lectures and in
between. Read
More...
Java One schedule.
28/04/08 19:50
I just finished going over the schedule. Lots of
interesting stuff - at the first glance, I decided to
reserve a lot. This is 24 different sessions, meaning
24 hours of input. A "tad" ambitious, but it will
probably be fun
Schedule listing follows for the
really really interested people. Read
More...
Coode assist is back again in Eclipse 3.4 M3
01/12/07 13:51
Catching up with Java 5.0
26/03/07 14:33
Find your way through the Java 5 jungle yet? Or still
stuck in Java 1.4 like most of us? If so, read on...
Read
More...
Top 10 Javablogs.
20/12/06 22:54
A coworker gave me this link to this feed of the top
10 most read articles at
Javablogs.com. Always nice when other people
are filtering out the noise.