栏目分类:
子分类:
返回
名师互学网用户登录
快速导航关闭
当前搜索
当前分类
子分类
实用工具
热门搜索
名师互学网 > IT > 前沿技术 > 大数据 > 大数据系统

Failed to configure a DataSource: ‘url’ attribute is not specified and no embedded datasource could

Failed to configure a DataSource: ‘url’ attribute is not specified and no embedded datasource could

Failed to configure a DataSource: ‘url’ attribute is not specified and no embedded datasource could be configured. 报错详细信息
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).

Disconnected from the target VM, address: '127.0.0.1:56285', transport: 'socket'
报错排查

项目依赖如下:



    4.0.0
    
        org.springframework.boot
        spring-boot-starter-parent
        2.6.3
         
    
    com.hfwas
    spring_redis
    0.0.1-SNAPSHOT
    11-spring-redis
    Demo project for Spring Boot
    
        1.8
    
    
        
            org.springframework.boot
            spring-boot-starter-actuator
        
        
            org.springframework.boot
            spring-boot-starter-data-redis
        
        
            org.apache.commons
            commons-pool2
            2.11.1
        
        
            redis.clients
            jedis
            3.3.0
        
        
            org.springframework.boot
            spring-boot-starter-jdbc
        
        
            org.springframework.boot
            spring-boot-starter-web
        

        
            mysql
            mysql-connector-java
            runtime
        
        
            org.projectlombok
            lombok
            true
        
        
            org.springframework.boot
            spring-boot-starter-test
            test
        
    

    
        
            
                org.springframework.boot
                spring-boot-maven-plugin
                
                    
                        
                            org.projectlombok
                            lombok
                        
                    
                
            
        
    

搜索之后,这个报错可能是因为引入了mysql的依赖,但是没有配置url参数导致的 解决办法

去掉mysql的依赖。顺带吧jdbc依赖也去掉

参考https://www.baeldung.com/spring-boot-failed-to-configure-data-source

转载请注明:文章转载自 www.mshxw.com
本文地址:https://www.mshxw.com/it/734268.html
我们一直用心在做
关于我们 文章归档 网站地图 联系我们

版权所有 (c)2021-2022 MSHXW.COM

ICP备案号:晋ICP备2021003244-6号