How to Modify the Default NetBeans Template

By default every single class that you create with NetBeans will start with a header that tells you how to change the template. This header has found it’s way into just about every file in all my projects and it serves no useful purpose, why it can’t just be an empty comment I don’t know but this document describes how to change it.Continue reading

Netbeans 7.3 Maven Profiler Issue

Neatbeans 7.3 has just been released (yeah) and, like every release it has brought a host of new bugs with it. I try not to document bugs because they tend not to be around for very long and bug databases are normally a better place to look but this one falls into the difficult to find category so I’ll document it here.Continue reading

NetBeans License Magic

As a general rule I don’t include license information at the top of each source file (I’m sure a lawyer would be outraged)  because no one but me should ever see the source. I’ve recently started work on an open source project though so I thought I’d best investigate how to get NetBeans to automatically include some Apache 2.0 license blurb at the top of each source file.Continue reading

Validating SAX Parser

I’ve been working with the built in Java XML libraries quite a bit lately and one of the things I’ve noticed is that there are very few good snippets of what I call recipe code – little bits of code that show you how to complete a specific task. In this article I show you how to use JAXP 1.3/1.4 to load a schema from the classpath and create a validating SAX parser.Continue reading

VerifyError Expecting a stackmap frame

I’ve just added a couple of new projects to my Hudson CI system and I noticed that one of the projects, which was configured to build with Java 7, had every test fail with an exception. I decided to use Java 7 after I’d already started working on the project so Java 7 features were only used in the tests at this point so my guess was a problem with the JVM.Continue reading

Which Java XML Library Should You Use

In the past I have always used either JDOM or Dom4J to interact with XML but I’ve never really been overly happy with either library. JDOM is very simple to use and great for simple XML structures but as soon as you want to do something a little more complex it becomes hard work. Dom4J is more powerful but I find the API to be, shall we just say, strange. I’ve never really found any problems with either project I just thought it was time to question why I was using them.Continue reading

Pretty Printing XML with JAXP

Java has a wide selection of built in XML handling capabilities but they are little used by most developers because they are felt, unfairly I think, to be difficult to use. I freely admit that I fell into that camp until fairly recently when I became a convert. Over the next few days I hope to writing some short articles giving hints and tips on using JAXP and the build in Java XML tools. First up is pretty printing.Continue reading