springboot 整合dubbo 消费模块引入springboot 之后自动注入jdbc 模块导致启动报错问题
方案一:
排除方法 pom文件直接将数据起步模块内排除数据源自动注入 jdbc jar <!--mybatis-plus 集成 -->
<!--mybitis-->
<dependency>
<groupId>org.mybatis.spring.boot</groupId>
<artifactId>mybatis-spring-boot-starter</artifactId>
<version>1.3.2</version>
<exclusions><!--排除数据库连接 web消费不需要连接数据库 boot会自动注入 发生报错-->
<exclusion>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-jdbc</artifactId>
</exclusion>
</exclusions>
</dependency>
<!--mybatis-plus 集成 -->
<!-- mybatis-plus begin -->
<dependency>
<groupId>com.baomidou</groupId>
<artifactId>mybatis-plus-boot-starter</artifactId>
<version>${mybatis-plus-boot-starter.version}</version>
<exclusions>
<exclusion>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-jdbc</artifactId>
</exclusion>
</exclusions>
</dependency> 方案二:
执行在main 方法入库 注解进行排除数据源自动策略
@SpringBootApplication(exclude = DataSourceAutoConfiguration.class)
public class ConsumerApplication { public static void main(String[] args) {
SpringApplication.run(ConsumerApplication.class, args);
}
}
springboot 整合dubbo 消费模块引入springboot 之后自动注入jdbc 模块导致启动报错问题的更多相关文章
- Springboot整合Dubbo和Zookeeper
Dubbo是一款由阿里巴巴开发的远程服务调用框架(RPC),其可以透明化的调用远程服务,就像调用本地服务一样简单.截至目前,Dubbo发布了基于Spring Boot构建的版本,版本号为0.2.0,这 ...
- springboot整合dubbo\zookeeper做注册中心
springboot整合dubbo发布服务,zookeeper做注册中心.前期的安装zookeeper以及启动zookeeper集群就不说了. dubbo-admin-2.5.4.war:dubbo服 ...
- 【转】SpringBoot学习笔记(7) SpringBoot整合Dubbo(使用yml配置)
http://blog.csdn.net/a67474506/article/details/61640548 Dubbo是什么东西我这里就不详细介绍了,自己可以去谷歌 SpringBoot整合Dub ...
- SpringBoot整合dubbo(yml格式配置)
yml文件 如果只作为服务的消费者不用暴露端口号,扫描的包名根据自己service改 dubbo: application: name: springboot-dubbo-demo #应用名 regi ...
- dubbo学习实践(4)之Springboot整合Dubbo及Hystrix服务熔断降级
1. springboot整合dubbo 在provider端,添加maven引入,修改pom.xml文件 引入springboot,版本:2.3.2.RELEASE,dubbo(org.apache ...
- springboot启动报错:Failed to configure a DataSource
一.背景 springboot的出现,让项目搭建变得更方便快捷,同时简化掉很多的样板化配置代码,提高开发效率. 通过idea生成springboot项目,启动报错:Failed to configur ...
- Springboot 之 启动报错-Cannot determine embedded database driver class for database type NONE
Springboot 之 启动报错-数据库 springboot项目在启动时,报如下错误: Error starting ApplicationContext. To display the auto ...
- SpringBoot启动报错Failed to determine a suitable driver class
SpringBoot启动报错如下 Error starting ApplicationContext. To display the conditions report re-run your app ...
- SpringBoot注册Windows服务和启动报错的原因
SpringBoot注册Windows服务和启动报错的原因 Windows系统启动Java程序会弹出黑窗口.黑窗口有几点不好.首先它不美观:其次容易误点导致程序关闭:但最让我匪夷所思的是:将鼠标光标选 ...
随机推荐
- XML再深入
XML 命名空间 XML 命名空间提供避免元素命名冲突的方法. 使用前缀来避免命名冲突 在 XML 中的命名冲突可以通过使用名称前缀从而容易地避免. 该 XML 携带某个 HTML 表格和某件家具的信 ...
- 两个command的疑惑
1.在cqrs模式中有command和query command 命令 没有返回值,但会更改对象的状态 query 查询 有返回值 但不会改变用户的状态,对下同而言没有副作用 2.在今天的实际 ...
- django内置组件——ContentTypes
一.什么是Django ContentTypes? Django ContentTypes是由Django框架提供的一个核心功能,它对当前项目中所有基于Django驱动的model提供了更高层次的抽象 ...
- Zepto和Jquery区别
---恢复内容开始--- <zepto移动端事件> 1.$("#xx").tap(function(){ //tap在屏幕点击时触发 alert("sssss ...
- C#工具类之数据库连接
一.SQL Server /// <summary> /// 数据库的通用访问代码 /// 此类为抽象类, /// 不允许实例化,在应用时直接调用即可 /// </summary&g ...
- 使用canvas及js简单生成验证码方法
在很多时候都需要用到验证码,前端验证码需要知道Html5中的canvas知识点.验证码生成步骤是:1.生成一张画布canvas 2.生成随机数验证码 3.在画布中生成干扰线 4.把验证码文本填充到 ...
- C#中.Net的值传递和引用传递
/// <summary> /// 电脑类 /// </summary> public class Computer { public string Type { get; s ...
- python 函数,内置函数
1.函数 1.1 定义函数 ·函数代码块以 def 关键词开头,后接函数标识符名称和圆括号 (). ·任何传入参数和自变量必须放在圆括号中间,圆括号之间可以用于定义参数. ·函数的第一行语句可以选择性 ...
- MySQL之innochecksum初探
innochecksum是一个用于校验innodb表空间文件完整性的工具,这是一个官方自带的工具,关于它的介绍,可以查看MySQL官方文档,下文主要是通过innodb_ruby来对innochecks ...
- 路由 vue-router
vue-router官方文档 1.router跳转页面 编程式的导航 this.$router.push('/index'); 2.mode Router构造配置 const router = new ...