Java

XStream and joda time

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.

|

Netbeans UI builder switching from Java 6 to Java 5 or the other way around

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.
|

Working with Mule

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

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)

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 One - day 3

Java One, day 3. Yet again, a lot as my notes. Read More...
|

Java One - day 2

Java One, day 2. Yet again, a lot as my notes. Read More...
|

Java + You - Java One topic

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 Happy Read More...
|

Fun stuff on Java Community Days

How to kill time on Java One... Read More...
|

Sun Community one.

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.

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 Happy Schedule listing follows for the really really interested people. Read More...
|

Coode assist is back again in Eclipse 3.4 M3

Finally, an eclipse build that works Happy Read More...
|

Catching up with Java 5.0

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.

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.
|