zhjyrdvjues 2023-03-18 16:24 采纳率: 50%
浏览 24

java错误 运行报错 还望帮我看一下

2023-03-18 14:45:39.429 INFO 16024 --- [ main] c.s.DormitorymsSpringApplication : Starting DormitorymsSpringApplication using Java 1.8.0_301 on 情兽 with PID 16024 (D:\fox-dowm\新建文件夹\dormitoryms_spring\target\classes started by 小情兽 in D:\fox-dowm\新建文件夹\dormitoryms_spring)
2023-03-18 14:45:39.435 INFO 16024 --- [ main] c.s.DormitorymsSpringApplication : No active profile set, falling back to 1 default profile: "default"
2023-03-18 14:45:42.170 INFO 16024 --- [ main] o.s.b.w.embedded.tomcat.TomcatWebServer : Tomcat initialized with port(s): 8080 (http)
2023-03-18 14:45:42.185 INFO 16024 --- [ main] o.apache.catalina.core.StandardService : Starting service [Tomcat]
2023-03-18 14:45:42.185 INFO 16024 --- [ main] org.apache.catalina.core.StandardEngine : Starting Servlet engine: [Apache Tomcat/9.0.63]
2023-03-18 14:45:42.423 INFO 16024 --- [ main] o.a.c.c.C.[Tomcat].[localhost].[/] : Initializing Spring embedded WebApplicationContext
2023-03-18 14:45:42.424 INFO 16024 --- [ main] w.s.c.ServletWebServerApplicationContext : Root WebApplicationContext: initialization completed in 2914 ms
2023-03-18 14:45:42.534 WARN 16024 --- [ main] ConfigServletWebServerApplicationContext : Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'dormitoryAdminController': Unsatisfied dependency expressed through field 'dormitoryAdminService'; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'dormitoryAdminServiceImpl': Unsatisfied dependency expressed through field 'baseMapper'; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'dormitoryAdminMapper' defined in file [D:\fox-dowm\新建文件夹\dormitoryms_spring\target\classes\com\southwind\mapper\DormitoryAdminMapper.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 [org/springframework/boot/autoconfigure/jdbc/DataSourceConfiguration$Hikari.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [com.zaxxer.hikari.HikariDataSource]: Factory method 'dataSource' threw exception; nested exception is org.springframework.boot.autoconfigure.jdbc.DataSourceProperties$DataSourceBeanCreationException: Failed to determine a suitable driver class
2023-03-18 14:45:42.538 INFO 16024 --- [ main] o.apache.catalina.core.StandardService : Stopping service [Tomcat]
2023-03-18 14:45:42.560 INFO 16024 --- [ main] ConditionEvaluationReportLoggingListener :

Error starting ApplicationContext. To display the conditions report re-run your application with 'debug' enabled.
2023-03-18 14:45:42.589 ERROR 16024 --- [ 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).

  • 写回答

4条回答 默认 最新

  • lshen01 2023-03-18 16:29
    关注

    参考GPT和自己的思路:

    这个错误表明程序启动过程中无法确定适合的驱动程序类。可能的原因是未正确配置数据库连接信息或缺少正确的数据库驱动程序包。

    建议您检查以下内容:

    1. 检查您的数据库连接配置信息是否正确。

    2. 检查您是否正确添加了适合您的数据库的驱动程序包。

    3. 如果您正在使用嵌入式数据库(如H2、HSQL或Derby),请确保将其放置在类路径上。

    4. 您可以通过使用'--debug'选项重新运行应用程序以显示更详细的调试信息,以获得更精确的解决方案。

    希望这些信息能帮到您。

    评论

报告相同问题?

问题事件

  • 创建了问题 3月18日

悬赏问题

  • ¥15 知道这个是什么图吗,想知道制作详细做法,或者模版也行
  • ¥15 CubeMX配置lwip实现TCP数据传输
  • ¥15 关于#51单片机#的问题:不能用中断、定时器之类的辅助实现
  • ¥15 blastfoam初学者尝试跑算例遇到问题
  • ¥25 pyqt6常规布局问题!我刚学 有点难度!
  • ¥20 基于ros2的orbslam3的实时运行
  • ¥100 支付行业技术人员来一个。常年包养
  • ¥15 kotlin multiplaform Compose项目 需要实现一个文件选择器获取手机上的文件
  • ¥15 Python没爬取到数据,求看这个是什么原因
  • ¥15 sqlite 读取数据如何避免float类型转化为指数形式