[Minor] throw exception if declared dependency is missing

Instead of running into a NPE, now an exception is thrown so the user
knows which component is missing which dependency.