Fix NetworkException bug on java 1.5