栏目分类:
子分类:
返回
名师互学网用户登录
快速导航关闭
当前搜索
当前分类
子分类
实用工具
热门搜索
名师互学网 > IT > 软件开发 > 后端开发 > Java

【springboot】06

Java 更新时间: 发布时间: IT归档 最新发布 模块sitemap 名妆网 法律咨询 聚返吧 英语巴士网 伯小乐 网商动力

【springboot】06

2022-06-24 10:42:26.260  INFO 40840 --- [           main] com.siemens.mocker.MockerApp             : Starting MockerApp on md60278c with PID 40840 (D:codejavaProjectspindle_mocker_backendtargetclasses started by z003nujf in D:codejavaProjectspindle_mocker_backend)
2022-06-24 10:42:26.263  INFO 40840 --- [           main] com.siemens.mocker.MockerApp             : No active profile set, falling back to default profiles: default
2022-06-24 10:42:28.378  INFO 40840 --- [           main] o.s.b.w.embedded.tomcat.TomcatWebServer  : Tomcat initialized with port(s): 8080 (http)
2022-06-24 10:42:28.388  INFO 40840 --- [           main] o.apache.catalina.core.StandardService   : Starting service [Tomcat]
2022-06-24 10:42:28.388  INFO 40840 --- [           main] org.apache.catalina.core.StandardEngine  : Starting Servlet engine: [Apache Tomcat/9.0.41]
2022-06-24 10:42:28.504  INFO 40840 --- [           main] o.a.c.c.C.[Tomcat].[localhost].[/]       : Initializing Spring embedded WebApplicationContext
2022-06-24 10:42:28.504  INFO 40840 --- [           main] w.s.c.ServletWebServerApplicationContext : Root WebApplicationContext: initialization completed in 2165 ms
2022-06-24 10:42:28.627  INFO 40840 --- [           main] c.a.d.s.b.a.DruidDataSourceAutoConfigure : Init DruidDataSource
2022-06-24 10:42:28.733  WARN 40840 --- [           main] ConfigServletWebServerApplicationContext : Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'mockDataController': Unsatisfied dependency expressed through field 'mockDataService'; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'MockDataService': Unsatisfied dependency expressed through field 'mockWorkerService'; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'MockWorkerService': Unsatisfied dependency expressed through field 'deviceFactory'; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'DeviceFactory': Unsatisfied dependency expressed through field 'typeServiceMap'; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'DeviceMockerService': Unsatisfied dependency expressed through field 'deviceInfoService'; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'DeviceInfoService': Unsatisfied dependency expressed through field 'baseMapper'; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'deviceInfoDao' defined in file [D:codejavaProjectspindle_mocker_backendtargetclassescomsiemensmockerdaoDeviceInfoDao.class]: Unsatisfied dependency expressed through bean property 'sqlSessionFactory'; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'sqlSessionFactory' defined in class path resource [com/baomidou/mybatisplus/autoconfigure/MybatisPlusAutoConfiguration.class]: Unsatisfied dependency expressed through method 'sqlSessionFactory' parameter 0; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'dataSource' defined in class path resource [com/alibaba/druid/spring/boot/autoconfigure/DruidDataSourceAutoConfigure.class]: Invocation of init method failed; nested exception is org.springframework.boot.autoconfigure.jdbc.DataSourceProperties$DataSourceBeanCreationException: Failed to determine a suitable driver class
2022-06-24 10:42:28.733  INFO 40840 --- [           main] o.apache.catalina.core.StandardService   : Stopping service [Tomcat]
2022-06-24 10:42:28.867  INFO 40840 --- [           main] ConditionEvaluationReportLoggingListener : 

Error starting ApplicationContext. To display the conditions report re-run your application with 'debug' enabled.
2022-06-24 10:42:28.867 ERROR 40840 --- [           main] o.s.b.d.LoggingFailureAnalysisReporter   : 

***************************
APPLICATION FAILED TO START
***************************

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).


Process finished with exit code 1

判断数据库版本以及各式是否正确
#mysql8以下的版本,请检查pom.xml文件种依赖的mysql jar包的版本
driver-class-name: com.mysql.jdbc.Driver
url: jdbc:mysql://localhost:3306/test?useUnicode=true&characterEncoding=UTF-8&useSSL=false
 
 

#mysql8的版本
driver-class-name: com.mysql.cj.jdbc.Driver
url: jdbc:mysql://localhost:3306/test?useUnicode=true&characterEncoding=utf8&useSSL=false&serverTimezone=Asia/Shanghai
系统未加载到配置文件

项目没有加载到yml或者properties文件,特别是自己的pom打包是jar的项目,请查看自己的pom.xml文件中的packaging。
步骤1
jar
如果pom中指定使用jar,系统不会自动读取到yml或者properties文件的,需要我们手动配置pom.xml。
步骤2.

    

        
            
                src/main/java
                
                    ***.properties
                    ***.yaml
                    ***.xml
                
                false
            
        
        
            
                org.springframework.boot
                >spring-boot-maven-plugin
            
        
    
转载请注明:文章转载自 www.mshxw.com
本文地址:https://www.mshxw.com/it/992934.html
我们一直用心在做
关于我们 文章归档 网站地图 联系我们

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

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