1. 快速搭建

1,打开浏览器,在地址栏输入http://start.spring.io

 搭建SpringBoot工程以及初期可能遇到的错误

2填写项目信息

        搭建SpringBoot工程以及初期可能遇到的错误

3,点击搭建SpringBoot工程以及初期可能遇到的错误生成项目

 

4,简单演示

新建maven项目

 搭建SpringBoot工程以及初期可能遇到的错误

点击下一步

 搭建SpringBoot工程以及初期可能遇到的错误

         点击下一步

         搭建SpringBoot工程以及初期可能遇到的错误

         点击完成

         复制下载下来的项目到新建项目中

搭建SpringBoot工程以及初期可能遇到的错误

1, 关闭特定的自动配置

使用@SpringBootApplicationexclude(除去,不包括)参数,例如,关闭自动配置数据源。

搭建SpringBoot工程以及初期可能遇到的错误

不然启动的时候可能会出现错误

错误信息如下:

***************************
APPLICATION FAILED TO START
***************************
Description:
Failed to auto-configure a DataSource: 'spring.datasource.url' is not specified and no embedded datasource could be auto-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).

可以写如下图的测试方法,右键Run As-->java application运行,在浏览器里直接访问http://localhost:8080/就能看到页面显示hoan的字样子。

搭建SpringBoot工程以及初期可能遇到的错误


相关文章:

  • 2022-01-31
  • 2022-12-23
  • 2021-10-09
  • 2022-12-23
  • 2021-07-03
  • 2022-12-23
  • 2021-07-13
  • 2021-05-03
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-12-20
  • 2022-12-23
  • 2022-12-23
  • 2021-06-26
相关资源
相似解决方案