Having @Autowired
and final on a field are contradictory.
The latter says: this variable has one and only one value, and it’s initialized at construction time.
The former says: Spring will construct the object, leaving this field as null (its default value). Then Spring will use reflection to initialize this field with a bean of type WorkspaceRepository.
If you want final fields autowired, use constructor injection, just like you would do if you did the injection by yourself:
@Autowired
public WorkspaceController(WorkspaceRepository repository) {
this.repository = repository;
}