小工具知识网

当前位置: 首页 > 行业知识 > Springboot项目解决Error starting ApplicationContext. To display the conditions report re-run your applic

行业知识

Springboot项目解决Error starting ApplicationContext. To display the conditions report re-run your applic

2026-11-13 05:40:43 来源:互联网转载

问题描述:

        启动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    sunshop    0.0.1-SNAPSHOT    sunshop    sunshop            1.8        UTF-8        UTF-8        2.3.12.RELEASE                            org.springframework.boot            spring-boot-starter-web                            org.springframework.boot            spring-boot-devtools            true                            org.springframework.boot            spring-boot-starter-test            test                                                org.junit.vintage                    junit-vintage-engine                                                                                org.springframework.boot                spring-boot-dependencies                ${spring-boot.version}                pom                import                                                                org.apache.maven.plugins                maven-compiler-plugin                3.8.1                                    1.8                    1.8                    UTF-8                                                        org.springframework.boot                spring-boot-maven-plugin                ${spring-boot.version}                                    com.example.sunshop.SunshopApplication                    true                                                                            repackage                                                    repackage                                                                                    

 

上一篇:奥的斯服务器怎么调试?

下一篇:UI 易用性测试 以及自动化实现!