convert to spring java configuration