I extracted the API out of my application so that multiple sites could use the same code base and it could be developed independent of the primary application. One of the subdirectories in the API is a CFC-based mail wrapper system for creating dynamic multi-part emails for new accounts, lost passwords and so forth.
When I built these originally, I failed to observe one of the seven deadly sins of ColdFusion development and relied upon the default “/” mapping:
<cfimport taglib="/api/email" prefix="mail">
I don’t know why, as nowhere else in my application did I do this. But sure enough, because the directory has been moved, trying to import the directory as a taglib failed with the java.lang.NullPointerException error. Simply changing it to point at itself cleaned up the problems:
<cfimport taglib="." prefix="mail">
Don’t rely on “/”. Even if it works 99% of the time, the 1% it doesn’t will torture you in your sleep when you can’t figure it out!
Comments are closed.