NPEs happening a lot happen in all applications. It isn't Spring specific. NPEs is my bane in Java development. I get it a lot, and that was even before I ever used Spring.
But I will say that you just can't get around a NPE happening if an object is set to null and you try to call a method etc.
1) check for null before calling the object
2) never leave an object at null
3) Make sure it is set.
4) You can do exception handling with AOP, but that won't stop NPEs or other exceptions, just a nice centralized location for Exception Handling.
Calling the instance method of a null object.
Accessing or modifying the field of a null object.
Taking the length of null as if it were an array.
Accessing or modifying the slots of null as if it were an array.
Throwing null as if it were a Throwable value.
Applications should throw instances of this class to indicate other illegal uses of the null object.
I’ve looked at a lot of different solutions, and in my humble opinion Aspose is the way to go. Here’s the link: http://aspose.com