Exception in thread “main” org.springframework.beans.factory.BeanCreationException: Error creating bean with name ‘sqlSessionFactoryBean’ defined in class path resource [applicationContext.xml]: Error setting property values; nested exception is org.springframework.beans.NotWritablePropertyException: Invalid property 'dataSource ’ of bean class [org.mybatis.spring.SqlSessionFactoryBean]: Bean property 'dataSource ’ is not writable or has an invalid setter method. Did you mean ‘dataSource’?
<bean id="sqlSessionFactoryBean" class="org.mybatis.spring.SqlSessionFactoryBean">
<property name="dataSource " ref="dataSource"/>
<bean id="sqlSessionFactoryBean" class="org.mybatis.spring.SqlSessionFactoryBean">
<property name="dataSource" ref="dataSource"/>
看出啥区别了嘛,没错(傻了吧),property的name属性值里多了个空格,就一个空格,浪费了我一个小时