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

码农世界 2024-05-19 后端 63 次浏览 0个评论

问题描述:

        启动Springboot项目时爆出“Error starting ApplicationContext. To display the conditions report re-run your application with 'debug' enabled.”

        问题描述内容是:配置DataSource失败:未指定“URL”属性,也无法对任何嵌入式数据盎司进行配置

        原因是:未能确定合适的驱动程序类

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

 报错部分的源代码:

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
                        
                    
                
            
        
    

 

转载请注明来自码农世界,本文标题:《Springboot项目解决Error starting ApplicationContext. To display the conditions report re-run your applic》

百度分享代码,如果开启HTTPS请参考李洋个人博客
每一天,每一秒,你所做的决定都会改变你的人生!

发表评论

快捷回复:

评论列表 (暂无评论,63人围观)参与讨论

还没有评论,来说两句吧...

Top