maven工程中dubbo与spring整合
1)引入相应jar包
<!-- 引入dubbo服务 start-->
<dependency>
<groupId>com.alibaba</groupId>
<artifactId>dubbo</artifactId>
<version>2.5.3</version>
<exclusions>
<exclusion>
<groupId>org.springframework</groupId>
<artifactId>spring</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>com.github.sgroschupf</groupId>
<artifactId>zkclient</artifactId>
<version>0.1</version>
</dependency>
<!-- 引入dubbo服务 end-->
2)相应配置信息dubbo.xml
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:dubbo="http://code.alibabatech.com/schema/dubbo"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
http://code.alibabatech.com/schema/dubbo http://code.alibabatech.com/schema/dubbo/dubbo.xsd"> <dubbo:application name="demo-system" owner="demo-system"/> <dubbo:registry protocol="zookeeper" address="192.168.10.102:2181"/> <dubbo:protocol name="dubbo" port="-1" heartbeat="2000"/> <!-- 调用服务接口 -->
<dubbo:reference id="dictionaryService" interface="com.iafclub.demo.remote.DictionaryService" check="false" timeout="10000"/> <!--提供服务接口-->
<dubbo:service interface="com.iafclub.demo.remote.DictionaryService" ref="dictionaryServiceImpl"/>
</beans>
3)web.xml配置
<!-- ContextLoaderListener初始化Spring上下文时需要使用到的contextConfigLocation参数 -->
<context-param>
<param-name>contextConfigLocation</param-name>
<!-- 配置spring.xml和spring-mybatis.xml这两个配置文件的位置,固定写法 -->
<param-value>
classpath:spring.xml,
classpath:spring-mybatis.xml,
classpath:spring-activitymq.xml,
classpath:dubbo.xml,
classpath:spring-redis.xml
</param-value>
</context-param>
4)完成整合
maven工程中dubbo与spring整合的更多相关文章
- maven工程中防止mapper.xml文件被漏掉、未加载的方法
maven工程中防止mapper.xml文件被漏掉.未加载的方法 就是在pom.xml文件中添加以下内容 <!-- 如果不添加此节点mybatis的mapper.xml文件都会被漏掉. --&g ...
- 【Dubbo实战】 Dubbo+Zookeeper+Spring整合应用篇-Dubbo基于Zookeeper实现分布式服务(转)
Dubbo与Zookeeper.Spring整合使用 Dubbo采用全Spring配置方式,透明化接入应用,对应用没有任何API侵入,只需用Spring加载Dubbo的配置即可,Dubbo基于Spri ...
- Dubbo+Zookeeper+Spring整合应用篇-Dubbo基于Zookeeper实现分布式服务(转)
Dubbo与Zookeeper.Spring整合使用 Dubbo采用全Spring配置方式,透明化接入应用,对应用没有任何API侵入,只需用Spring加载Dubbo的配置即可,Dubbo基于Spri ...
- maven工程中pom.xml的错误
更新maven工程,出现如下错误信息. Could not calculate build plan: Failure to transfer org.apache.maven.plugins:mav ...
- 在eclipse中的maven工程中执行maven命令的步骤
执行maven命令的步骤: 1.找到maven工程的pom.xml文件,点中右键 2.在弹出的对话框中选择run as 3.在弹出的对话框中输入compile 再执行即可
- 如何在maven工程中加载oracle驱动
maven中引入oracle驱动报错Missing artifact com.oracle:ojdbc14:jar:10.2.0.4.0 时间:2015年09月22日 浏览:9361次 在maven ...
- 如何在 Maven 工程中引入其他jar包 并生效?(以 Netty 为例)
1.到 Maven 官网 查找 相关 框架 https://mvnrepository.com/artifact/io.netty/netty-all/4.1.32.Final 2.把相关 Xml体 ...
- 本地jar包在maven工程中pom引用
背景 在使用Maven的过程中,经常碰到有些jar包在中央仓库没有的情况.如果公司有私服,那么就把jar包安装到私服上.如果没有私服,那就把jar包安装到本地Maven仓库.下面是如何把jar包导 ...
- 解决eclipse maven工程中src/main/resources目录下创建的文件夹所显示样式不是文件夹,而是"包"图标样式的问题
参考:http://blog.csdn.net/luwei42768/article/details/72268246 eclipse项目中创建maven项目后,有时在执行命令maven update ...
随机推荐
- java.lang.reflect.InvocationTargetException at shade.com.datastax.spark.connector.google.common.base.Throwables.propagate(Throwables.java160)
org.apache.spark.SparkException: Job aborted due to stage failure: Task 1 in stage 29.1 failed 4 tim ...
- 从MongoDB及mysql 谈B/B+树
一 B树的由来 B树指的是一类树,包括B-树,B+树,B*树等,是一种自平衡的搜索树,它类似普通的平衡二叉树,不同的一点是B树允许每个节点有更多的子节点.B树是专门为外部存储器设计的,如磁盘,它对于读 ...
- javaIO -- 流的体系设计思路、基础分类
一.流 1. 流的含义 在程序设计中,流是对于数据流动传输的一种抽象描述任何有能力产出数据的数据源,或者有能力接受数据的接收端对象都是一个流. 2. 流的源和目的 数据可能从本地文件读取,或者写入, ...
- C++中的swap(交换函数)
交换两个变量的值很简单. 比如 int a = 1; b = 2; 交换a b的值 这个很简单 很容易想到的是找个中间变量比如 int temp = a; a = b; b = temp; 不需要 ...
- 使用Duilib开发Windows软件(5)——使用VLC做视频播放
需求:调用PC上的摄像头拍照. 实现思路:接入视频流,截屏获取照片. 早期的vlc安装包(Windows)是附带sdk包的,现在的安装后已经没有了,原因如下: VLC SDK下载连接:https:// ...
- c++学习(二)------this指针学习
在c++中,类的不同实例有自己的数据(储存在不同地方),有很多拷贝.而类的成员函数却只有一份备份. 而不同的类的实例却可以调用同一个函数,这是通过this指针来完成的. *this代表当前类本身,th ...
- java.lang.ClassCastException: com.sun.proxy.$Proxy4 cannot be cast
解决方案 在配置文件中配置proxy-target-class="true" <aop:aspectj-autoproxy proxy-target-class=" ...
- MyBatis 源码篇-MyBatis-Spring 剖析
本章通过分析 mybatis-spring-x.x.x.jar Jar 包中的源码,了解 MyBatis 是如何与 Spring 进行集成的. Spring 配置文件 MyBatis 与 Spring ...
- hdu 2844 多重背包的转化问题 以及这个dp状态的确定
在杭电上测试了下 这里的状态转移方程有两个.,. 现在有价值val[1],val[2],…val[n]的n种硬币, 它们的数量分别为num[i]个. 然后给你一个m, 问你区间[1,m]内的所有数目, ...
- 请问IOS中做一个手机网站的app壳复杂吗?
公司开发了一个平台,手机网站已经做出来了,想开发一个苹果应用app,但公司没人会IOS开发,为了减小成本,现在想直接做一个壳来加载手机网站,请问在ios中复杂吗?是否有相应的控件直接加载url就行? ...