遇到一个Spring配置问题,请教各位大虾!
实例工厂方法创建Bean时配置init-method配置文件报错,但程序能正常运行,找不到原因很是郁闷!下面是配置:
<?xml version="1.0" encoding="UTF-8"?>
<beans
xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:p="http://www.springframework.org/schema/p"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd">
<bean id="personServiceFactory" class="service.impl.PersonServiceBeanFactory"/>
<bean lazy-init="false" init-method="init" destroy-method="destory" id="personService" factory-bean="personServiceFactory" factory-method="createPersonServiceBean"/>
</beans>
以下是报错:
Multiple annotations found at this line:
- Destroy-method 'destory' not found in bean class
'service.PersonService'
------解决方案--------------------你的bean中没有找到destory方法
------解决方案--------------------这个事bean销毁是首先调用的方法。没找到就跳过了