问题描述:
启动Springboot项目时爆出“Error starting ApplicationContext. To display the conditions report re-run your application with 'debug' enabled.”
问题描述内容是:配置DataSource失败:未指定“URL”属性,也无法对任何嵌入式数据盎司进行配置
原因是:未能确定合适的驱动程序类
报错部分的源代码:
package com.example.summer_task.controller; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.ResponseBody; @Controller @RequestMapping("/staff") public class StaffController { @GetMapping("/hello") @ResponseBody public String hello(){ return "hello"; } }
解决方式:
修改了pom.xml文件
修改如下:
4.0.0 com.example sunshop0.0.1-SNAPSHOT sunshop sunshop 1.8 UTF-8 UTF-8 2.3.12.RELEASE org.springframework.boot spring-boot-starter-weborg.springframework.boot spring-boot-devtoolstrue org.springframework.boot spring-boot-starter-testtest org.junit.vintage junit-vintage-engineorg.springframework.boot spring-boot-dependencies${spring-boot.version} pom import org.apache.maven.plugins maven-compiler-plugin3.8.1 1.8 UTF-8 org.springframework.boot spring-boot-maven-plugin${spring-boot.version} com.example.sunshop.SunshopApplication true repackage repackage
还没有评论,来说两句吧...