springboot整合mybatis时启动项目报错解决办法

springboot整合mybatis时启动项目报错信息如下:


***************************
APPLICATION FAILED TO START
***************************

Description:

Failed to configure a DataSource: 'url' attribute is not specified and no embedded datasource could be configured.

Reason: Failed to determine a suitable driver class


Action:

Consider the following:
	If you want an embedded database (H2, HSQL or Derby), please put it on the classpath.
	If you have database settings to be loaded from a particular profile you may need to activate it (no profiles are currently active).

解决办法:

在框架生成的入口文件中加入代码即可。

(exclude= {DataSourceAutoConfiguration.class})

文件位置和代码效果如下图:

 

springboot整合mybatis时启动项目报错解决办法_第1张图片

保存后运行即可。 

你可能感兴趣的:(学习笔记,张小三,java,eclipse,jsp,SSM,spring,boot,学习笔记)