You UserNameValidator class is an unmanaged one, and not one of the classes that Wicket automatically injects (not a Behavior / Component).
Thus you need to call CdiContainer.get().getNonContextualManager().inject(this);
into your class constructor to trigger CDI injection and use injected beans.