Sunday, October 5, 2008

Relaxing Sunday afternoon with the IBM JDK and Servicemix 4.

I may have strange habits, nothing says 'relaxing Sunday afternoon' like diving into a project on an AIX system while hanging out in a cafe. 

Unlike many developers I actually enjoy my time with AIX, its a different environment that works well with my development style. Currently I'm attempting to resolve some testing issues that pop up when using IBM JDK to build & run unit tests of a Servicemix 4 Features SNAPSHOT - debugging this is a relatively simple process of identifying small differences in what comes packaged with Sun SDK vs the IBM JDK.

How does one know how to identify this kind of issue when working with Servicemix 4 on AIX?

Well the simplest way to determine this issue is reviewing the surefire test reports that are generated during a Servicemix 4 build. All test output is redirected to log files, inspecting these you'll most likely find that there will be a "<classname> not found error". If you know the jar that the particular class comes from then you can simply add the jar dependency to the pom file controlling the build of that component and retest. Regardless of if you know the class's parent jar or not it would be a good idea to open a report in SMX4's Jira to bring the issue to light.

What if the class/jar should already be available on the classpath?

In this case run the build with "mvn -X" to see exactly what libraries are being loaded. I tend to redirect the output from running maven with this flag to a file, then searching its contents. Sometimes you may need to reorder the loading order of jars due to naming conflicts, this however is rare (I've only seen that when working on Websphere based projects). A useful exercise when investigating this sort of issue is to build/test on another *nix platform to have a baseline to compare logs (personally I use Linux or Mac builds as a reference point). 

Once you've determined the solution to getting builds/unit tests running again then you'll want to try out your changes on a non-AIX system to verify a platform safe change, then submit a patch :)


No comments: