注意:所有文章除特别说明外,转载请注明出处.
1.错误:java.lang.UnsatisfiedLinkError: F:\Software\Apache-Tomcat\apache-tomcat-7.0.90\bin\tcnative-1.dll: Can’t load AMD 64-bit .dll on a IA 32-bit platform
解决:直接在网上下载一个 tcnative-1.dll 64位的复制到tomcat/bin目录下即可,这里是因为两者冲突造成。
2.错误:Failed to configure a DataSource: ‘url’ attribute is not specified and no embedded datasource could be configured.
解决:排除此类的autoconfig。启动以后就可以正常运行。@SpringBootApplication(exclude= {DataSourceAutoConfiguration.class})
…
3.错误:Field userMapper in com.shop.service.impl.UserServiceImpl required a bean of type ‘com.shop.mapper.UserMapper’ that could not be found.
解决:这里是因为注解未找到对一个的mapper,所以报错,去inspections取消对应的提示。
4.新创建SQLSessionFactory
@Resource
private DataSource dataSource;
@Bean
public SqlSessionFactory sqlSessionFactory() throws Exception {
SqlSessionFactoryBean sessionFactoryBean = new SqlSessionFactoryBean();
sessionFactoryBean.setDataSource(dataSource);
return sessionFactoryBean.getObject();
}
SLF4J: Class path contains multiple SLF4J bindings.
解决:表示maven棒我们引入了两个日志jar包,删掉其中一个便可。