部署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. 类型SQL注入实验 Part1

    准备为PHPstudy环境 <?php $id = $_GET['t']; $conn = mysql_connect("127.0.0.1","root" ...

  2. HTML学习第三天

    超链接: <a href=""></a>             target链接打开方式 1._blank新窗口打开 2._self当前窗口打开     ...

  3. C#LeetCode刷题之#54-螺旋矩阵(Spiral Matrix)

    问题 该文章的最新版本已迁移至个人博客[比特飞],单击链接 https://www.byteflying.com/archives/3672 访问. 给定一个包含 m x n 个元素的矩阵(m 行, ...

  4. java.util.Scanner中hasNext()方法和next()方法的区别

    先说结论: 两者均根据空格划分数据 两者在没有数据输入时均会等待输入 next()方法会将空格划分的数据依次输出,运行一次,输出一个 hasNext()方法会跟着next()方法移动,当前数据不为空, ...

  5. 不用虚机不用Docker使用Azure应用服务部署ASP.NET Core程序

    一般我们写好了应用程序想要部署发布它,要么发布到物理机,要么发布到虚拟机,要么发布到容器来运行它.现在有了Azure应用服务,我们可以完全不用管这些东西,只管写好自己的代码,然后使用VisualStu ...

  6. 可以用命令行控制eclipse断点增加删除、远程调试创建与启动的插件

    java # 创建断点(支持条件断点) curl -X PUT -H "Content-Type:application/json" --data '{"language ...

  7. 一进“dos”就自动进入上次的目录

    这个原来在别的地方发过,但是后来发现有bug,处理windows下带有空格的长文件夹会出错.因为原来那个帖子已经不能编辑了,所以修改后写在这里. 这里的“dos”,就是windows下的命令行窗口,所 ...

  8. Scala中的函数高级使用

    1.偏函数 1.基本介绍 在对符合某个条件,而不是所有情况进行逻辑操作时,使用偏函数是一个不错的选择 将包在大括号内的一组case语句封装为函数,我们称之为偏函数,它只对会作用于指定类型的参数或指定范 ...

  9. 在string.replace中使用具名组匹配

    let reg = /(?<year>\d{4})-(?<month>\d{2})-(?<day>\d{2})/; let re = '2015-01-02'. r ...

  10. Gitlab安装使用

    Gitlab安装使用 1. 为什么要使用gitlab Git的优点多多这里就不详细介绍了: Git是版本控制系统,Github是在线的基于Git的代码托管服务: Github有个小缺陷 (也不能算是缺 ...