Sunday, 19 September 2010

Java: System.console(), IDEs and testing

The method System.console() can return null if there is no console device present. This comes as a surprise to people when they run their code in an IDE. This post is about overcoming such problems.

Thursday, 16 September 2010

Java: "Content is not allowed in prolog" - causes of this XML processing error

Content is not allowed in prolog is an error generally emitted by the Java XML parsers when data is encountered before the <?xml... declaration. You may inspect the document in a text editor and think nothing is wrong, but you need to go down to the byte level to understand the problem. You probably have a character encoding bug.