SOAP/SAAJ/XML Issues When Migrating to Java 6 (with Axis 1.2)

When you migrate an application using Apache Axis 1.2 from Java 4 or 5 to Java 6 (JRE 1.6) you will most likely encounter a handful of strange SOAP/SAAJ/XML errors and ClassCastExceptions. This is due to the fact that Sun's implementation of SAAJ 1.3 has been integrated directly into the 1.6 JRE. Due to this integration it's loaded by the bootstrap class loader and thus cannot see various classes that you might be referencing in your old code.

As mentioned on Spring pages:
Java 1.6 ships with SAAJ 1.3, JAXB 2.0, and JAXP 1.4 (a custom version of Xerces and Xalan). Overriding these libraries by putting different version on the classpath will result in various classloading issues, or exceptions in org.apache.xml.serializer.ToXMLSAXHandler. The only option for using more recent versions is to put the newer version in the endorsed directory (see above).
Fortunately, there is a simple solution, at least for Axis 1.2.
Continue reading →

If You Don't Use Pair Programming and Code Reviews as Teaching Tools You Waste Money

There is an easy way how to save many man-days and thus also money on a project by adding some work to the key team members. You must be thinking that I'm crazy if I want to add even more work to the already overloaded senior developers and an architect but I'm sure you will agree at the end. The additional work, which will later save you many, many more, are code reviews and pair programming of an inexperienced and a senior developer.
Continue reading →

Knowing I'm Bad Programmer Makes Me Good Programmer

I know that I'm not a good programmer and this knowledge makes me actually a very good one. As Kent Beck says: "I'm not an excellent programmer, I'm just a good one with excellent habits." [1] I know I'm a bad (read "a little above average", if you plan to hire me ;-)) programmer and therefore my code will contain bugs. So I like to write unit tests even before the code itself, and I prefer having the test fail first for thus I'm sure that it works (well, at least in a basic way). Being a bad programmer I also know that my design isn't perfect and no matter how hard I try it's very likely that it will need to be changed in the future. I therefore don't try to account for all possible future changes and to make it so flexible that it could deal with all of them because I know I'd be wrong in this. Instead, I prefer simple designs and well isolated parts of code so that it will be easy to reorganize and refactor them as needed. Last but not least, knowing my weaknesses I appreciate very much when somebody else reviews my design and code and I'm very receptive of different points of view and ideas. For the same reason I do not hesitate to ask my collegues for an opinion or an advice when I'm unsure. (Kent Beck yeasterday twittered: "amazing how fast you can finish if you care more about feedback than avoiding criticism".)

Continue reading →

Tip: Enable a shortcut for Occurrences in File in Eclipse under Gnome (default C+S+u)

The useful Eclipse action Search - Occurrences in File - Identifier
Continue reading →

Most interesting links of October

Few of my favourite themes this month - TDD, performance, build tools/Maven. Plus a usefel JS library, news from the Java community x Oracle world etc.
Continue reading →

Tip: Retrieving server certificate used in SSL communication (e.g. POP3s)

If you would like to get the security certificate
Continue reading →

Most interesting links of September

The most interesting articles and other IT resources I've encountered the previous month, delayed a bit due to my holiday in Andalusia. In no particular order. Included some performance stuff, few tools and few general SW engineering things.
Continue reading →

The power of batching or speeding JDBC by 100

We all know that one coarse-grained operation is more efficient than a number of fine-grained ones when communicating over the network boundary but until recently I haven't realized how big that difference may be. While performing a simple query individually for each input record proceeded with the speed of 11k records per hour
Continue reading →

Exposing a POJO as a JMX MBean easily with Spring

JMX is a great way to check or change state variables or invoke a method in a (remote) running application via a management GUI such as JConsole. And Spring makes it trivial to expose any POJO as a JMX MBean with only little configuration in a few minutes. The Spring JMX documentation is very good, however there are few points that I struggled with for a while and would therefore like to record here the right solutions.

I needed to monitor a command-line java application using Spring 2.5 on IBM JVM 1.4 1.5 running on a server with a jconsole on Sun JVM 1.6 as the JMX client on my PC.


Continue reading →

Implementing retrial with a MDB or an MQ batch job? (WAS 7, MQ 6)

We need to listen for messages distributed via Websphere MQ to get informed when an employee joins or leaves IBM. And because the resources used in the processing (a database, a webservice) may be temporarily unavailable, we must be able to deal with such outages, which may range from minutes to hours, by repeatedly retrying the processing after some delay. And we must be also able to deal with "poison messages", that means messages whose processing always fails either because their content is invalid or because their data isn't consistent with the database. The question is whether this would be better implemented as a Message-Driven Bean (MDB) or a batch job regularly checking its queue given that we have Websphere Application Server 7 (and thus Java EE 5) and Websphere MQ 6, which both have some important changes compared to the previous versions. It turns out that it depends - both approaches have some advantages and disadvantages and so it's a question of the likelihood of particular problems and business requirements and priorities.


Continue reading →

SSH magic: Authorize only once for multiple ssh/scp invocations

OpenSSH has a nice feature that makes it possible to open one "master connection", which can be shared by multiple subsequent ssh/scp/sftp "slave connections". The advantage is that you need to supply password only when opening the master connection and thus you can easily perform a sequence of remote commands without constant re-authentication. Let's see how to do it in such a way that it can be used in a script.
Continue reading →

Jetty-maven-plugin: Running a webapp with a DataSource and security

This post describes how to configure the jetty-maven-plugin and the Jetty servlet container to run a web application that uses a data source and requires users to log in, which are the basic requirements of most web applications. I use Jetty in development because it's fast and easy to work with.
Continue reading →

Most interesting links of August

I hope everybody is enjoying the holiday and not spending hours on tech blogs and sites. At least I do :-) and thus this month's list is a short one:
Continue reading →

An encrypted backup of a disk/partition to a Samba share with Clonezilla

You will learn how to customize Clonezilla Live (v. 1.2.5-24) for an easy backup of a partition (or a disk) to an encrypted file stored on a remote Samba server and how to test the backup by restoring it to a VMware virtual machine. We will few scripts to simplify the task, including a custom Clonezilla startup script to mount a TrueCrypt volume on a Samba share.

Content: What is Clonezilla? | Preparing Clonezilla for a custom backup | Backup | Encryption of the backup | Restoration and testing of the backup | The complete backup - encrypt - test cycle | Summary

PS: If you are scared by the length of this post then read only "The complete backup – encrypt – test cycle" :-)

Update 2010-09-23: Added "The complete backup – encrypt – test cycle", little reorganization.

What is Clonezilla?

Clonezilla is a live Linux distribution containing tools for performing backup and restoration of disks and partitions. It is basically a collection of various open-source tools such as partimage and gzip and custom scripts that "glue" them together to create a single backup tool driven by a wizard-like user interface. You install it to a CD or USB flash disk, boot from that medium, answer few questions and a backup or a restoration may start.


Continue reading →

Most interesting links of July

This month about performance, the Java language and patterns, the development process, and a few interesting news.


Continue reading →

Copyright © 2024 Jakub Holý
Powered by Cryogen
Theme by KingMob