部署boot项目时报Cannot datermine embedded database driver class for database type NONE数据库链接什么的也都没有问题,经过百度

因为spring boot只要你在pom中引入了mybatis-spring-boot-starter 他就会默认需要加载数据库相关的配置

你要是没有在配置文件中配置数据相关信息,它会加载默认的配置(不存在的) 然后就报错了, 所以你要是要用数据库相关的东西 你就完善配置
不用数据库相关的东西 就不要在pom中引入相关依赖。

解决方法:1)应用没有使用到DataSource,但是在pom.xml里引入了spring-boot-starter-jdbc spring-boot-starter-jdbc带入了tomcat-jdbc,它里面有org.apache.tomcat.jdbc.pool.DataSource spring boot里的PooledDataSourceConfiguration,判断classpath下面有DataSource的实现类,尝试去创建DataSource bean 在初始化DataSourceProperties时,尝试通过jdbc的url来探测driver class 因为应用并没有配置url,所以最终在DataSourceProperties.determineDriverClassName()里抛出Cannot determine embedded database driver class for database type NONE,去除pom文件中没有用到的数据库jar

    2)在启动类注解上加上exclude = { DataSourceAutoConfiguration.class, DataSourceTransactionManagerAutoConfiguration.class }

    @SpringBootApplication(exclude = { DataSourceAutoConfiguration.class, DataSourceTransactionManagerAutoConfiguration.class })

boot 项目启动报Cannot datermine embedded database driver class for database type NONE的更多相关文章

  1. 创建spring boot项目启动报错遇到的问题

    1.Spring boot,Mybatis 启动报错 Failed to auto-configure a DataSource *************************** APPLICA ...

  2. spring boot项目启动报DataSource错误

    初建一个简单的spring boot 项目,启动后会报错. Exception encountered during context initialization - cancelling refre ...

  3. spring boot项目启动报错

    在eclipse中运行没有任何问题,项目挪到idea之后就报错 Unable to start EmbeddedWebApplicationContext due to miss EmbeddedSe ...

  4. spring boot项目启动报(No session repository could be auto-configured, check your configuration (session store type is 'null'))

    找到项目的application配置文件,增加 spring.session.store-type=none,重新启动问题解决 注:因为项目未使用redis管理session,可以如上设置,如果想使用 ...

  5. 项目启动报错:No suitable driver found for jdbc:oracle:thin:@192.168.7.146:1521:oracle

    No suitable driver found for jdbc:oracle:thin:@192.168.7.146:1521:oracle 这个错误的原因主要有以下几方面的原因: 1. url配 ...

  6. 【spring cloud】【spring boot】项目启动报错:Cannot determine embedded database driver class for database type NONE

    解决参考文章:https://blog.csdn.net/hengyunabc/article/details/78762097 spring boot启动报错如下: Error starting A ...

  7. Springboot项目启动报错,提示Cannot determine embedded database driver class for database type NONE

    我在springboot项目里面引入了数据库的配置: <dependency> <groupId>org.mybatis.spring.boot</groupId> ...

  8. spriing boot 启动报错:Cannot determine embedded database driver class for database type NONE

    最近在学习使用spring boot.使用maven创建好工程,只引用需要用到的spring boot相关的jar包,除此之外没有任何的配置. 写了一个最简单的例子,如下所示: package com ...

  9. Springboot 之 启动报错-Cannot determine embedded database driver class for database type NONE

    Springboot 之 启动报错-数据库 springboot项目在启动时,报如下错误: Error starting ApplicationContext. To display the auto ...

随机推荐

  1. C# 委托 应用实例

    用一句话解释委托:委托是一种可以把引用存储为函数的类型. 有些类似Spring框架对于接口的用法,向Action中注入Service对象.Action并不知道调用哪个服务层,只有容器通过配置文件 向A ...

  2. 题解 poj 3304

    题目描述 线段和直线判交板子题 分析题目,如果存在这一条直线,那么过这条直线作垂线,一定有一条垂线穿过所有线段,否则不存在.题目转化为寻找一条直线与所有线段有交点. 直线线段判交方法: 1.先判断线段 ...

  3. Oracle用户授权

    一.用户授权 1)普通权限 grant ${autoType1, autoType2, autoType3, ...} to ${userName} identified by ${password} ...

  4. Excel 提取年月日①

    问题场景 从任务数据表中比较所有任务的预计完成时间和实际完成时间,来判断该任务是逾期还是按期完成了,根据实际场景是不需要考虑时分秒,只需对比该任务预计完成和实际完成的年月日. 可通过提取年月日用函数进 ...

  5. SpringSecurity权限管理系统实战—四、整合SpringSecurity(上)

    目录 SpringSecurity权限管理系统实战-一.项目简介和开发环境准备 SpringSecurity权限管理系统实战-二.日志.接口文档等实现 SpringSecurity权限管理系统实战-三 ...

  6. JAVA 下载单个文件

    public void toDownLoad(String ape505, HttpServletRequest request, HttpServletResponse response) thro ...

  7. Jmeter 常用函数(25)- 详解 __V

    如果你想查看更多 Jmeter 常用函数可以在这篇文章找找哦 https://www.cnblogs.com/poloyy/p/13291704.html 作用 执行变量名表达式,并返回执行结果 它可 ...

  8. CentOS 安装、配置Nginx反向代理

    安装: yum install epel-release yum install nginx 配置: [root@bogon ~]# vim /etc/nginx/conf.d/default.con ...

  9. qemu-img check命令详解

    1.问题现象 生产环境上,对计算节点文件系统修复,导致某些虚机的镜像文件数据丢失,出现异常,最终造成虚机无法启动,查看对应计算节点的nova日志,报如下错误 nova-compute: File &q ...

  10. idea 推送jar包到maven私库

    1.推送到本地仓库 idea直接install即可 2.推送到公司私库 2.1 使用配置公司仓库地址的setting文件 <?xml version="1.0" encodi ...