Received a NPE when I was exporting a WAR file in eclipse on a old project. Error below:
Took me longer than I would like to admit to figure this one out! The project has a dependency on another project. In that project I was using a newer version of Joda-Time than the lib I had in the main project. Reverting back the lib in the dependent project got it to work.
This NPE exception applies to any library where the version is not the same in both projects.
For example you have 2 projects:
Project 1 is webapp that exports to WAR file. That project uses 3rd party lib/jar Joda-2.1 and also uses the jar from the build of Project 2.
Project 2 also uses the same 3rd party lib/jar but different version Joda-2.2.
When you try to build Project 1 to WAR you will get the above NPE in Eclipse