zoukankan      html  css  js  c++  java
  • 让Springboot启动时不连接数据库

    写了个简单的Springboot工程,启动时始终会报错:

    “If you want an embedded database please put a supported one on the classpath. If you have database settings to be loaded from a particular profile you may need to active it (no profiles are currently active).”

          其意思是:“如果您想要一个嵌入式数据库,请将一个受支持的数据库放到类路径中。如果要从特定概要文件加载数据库设置,则可能需要激活它(当前没有概要文件处于活动状态)。”

           也就是说,项目中没有数据库相关的配置。Springboot在启动时默认会注入数据源,但是系统中又找不到数据库的配置,因此报错。

    解决:
    如果项目确实不需要连接数据库,请在启动类中添加注解 
    @EnableAutoConfiguration(exclude={DataSourceAutoConfiguration.class})


     
    问题解决。

  • 相关阅读:
    cookie和session
    图书馆里系统前端页面
    图书管理系统后端接口
    Vue组件
    axios前端登录
    django配置跨域并开发测试接口
    axios封装
    初始化vue项目
    model的基础操作
    Windows 系统版本介绍
  • 原文地址:https://www.cnblogs.com/panchanggui/p/14715032.html
Copyright © 2011-2022 走看看