When using Org.mybatis.spring.mapper.MapperScannerConfigurer for automatic scanning in spring, the sqlsessionfactory is set. May cause Propertyplaceholderconfigurer to fail, that is, an expression such as ${jdbc.username} will not be able to get to the content in the properties file. This is caused by the fact that Mapperscannerconigurer is actually parsing the load bean definition phase, which, if set sqlsessionfactory, causes some classes to be initialized in advance, this time, Propertyplaceholderconfigurer has not had time to replace the variables in the definition, causing the expression to be copied as a string.
So in the configuration
<Bean id= "sqlsessionfactory" class= "Org.mybatis.spring.SqlSessionFactoryBean " Name= "Sqlsessionfactoryname">
When setting a unique name
When configuring Mapperscannerconfigurer,
<property Name= "Sqlsessionfactorybeanname" value= "Sqlsessionfactoryname" />
To complete the injection
Spring Property-placeholder Mapperscannerconfigurer Unable to read configuration resolution