Say just <T>. Extends Object doesn't add anything. Put beanName first and type second (same as in ApplicationContext.getBean).