Spring中出现org.springframework.beans.factory.BeanCreationException

异常节选

org.springframework.beans.factory.BeanCreationException: 
Error creating bean with name 'factory' defined in class path resource 
[applicationContext.xml]: Instantiation of bean failed; 
nested exception is java.lang.IllegalStateException: 
No bean class specified on bean definition

处理方法
将动态工厂改为静态,动态bean改为静态bean
动态工厂

	public static ISomeService getSomeService(){
		return new SomeServiceImpl();
	}

静态bean

<bean id="myService" class="com.lexie.service.ServiceFactory" 
factory-method="getSomeService"/>

你可能感兴趣的:(spring)