417561 Refactor annotation related code

Log a warning if not able to check valid classname when scanning a directory (wars that are not unpacked are still able to be scanned even though Resource.getFile().getName() will return null).