问题1:

运行起来不报错,不过在Console没有zookeeper的心跳信息,也就是说没有配置上zookeeper,而出错的原因是下面蓝色这段解析不了

spring-dubbo-provider.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="dubbo-service" />
<!-- 使用zookeeper注册中心暴露服务地址:部署zookeeper控制台的电脑ip -->
<dubbo:registry address="zookeeper://127.0.0.1:2181" />
<!-- 用dubbo协议在20880端口暴露服务 host="192.168.3.53" -->
<dubbo:protocol name="dubbo" host="192.168.3.53" port="20883" />
<!-- 声明需要暴露的服务接口,对应的具体实现类是自定义bean -->
<dubbo:service interface="com.zk1.service.IUserService"
ref="userService" />
<!-- 服务实现 -->
<bean id="userService" class="com.zk1.service.impl.UserServiceImpl" />

</beans>

解决方法:

把 dubbo-2.5.3.jar解压,把解压出来的dubbo.xsd 随便你放一个地方,打开eclipse--》Preferences--》XML--》XML Catalog --》add --》File System 把刚才dubbo.xsd弄进来,再改一下Location下面的Keyhttp://code.alibabatech.com/schema/dubbo 改为 http://code.alibabatech.com/schema/dubbo/dubbo.xsd 然后保存

p,li { white-space: pre-wrap }

问题2:

2016-12-19 20:20:21 AbstractConfig:301 WARN - [DUBBO] keefer: keefer: unknown error, dubbo version: 2.5.3, current host: 127.0.0.1
java.net.UnknownHostException: keefer: keefer: unknown error
at java.net.InetAddress.getLocalHost(InetAddress.java:1505)
at com.alibaba.dubbo.config.ServiceConfig.doExportUrlsFor1Protocol(ServiceConfig.java:299)
at com.alibaba.dubbo.config.ServiceConfig.doExportUrls(ServiceConfig.java:281)
at com.alibaba.dubbo.config.ServiceConfig.doExport(ServiceConfig.java:242)
at com.alibaba.dubbo.config.ServiceConfig.export(ServiceConfig.java:143)
at com.alibaba.dubbo.config.spring.ServiceBean.onApplicationEvent(ServiceBean.java:109)
at org.springframework.context.event.SimpleApplicationEventMulticaster.invokeListener(SimpleApplicationEventMulticaster.java:163)
at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:136)
at org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:381)
at org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:335)
at org.springframework.context.support.AbstractApplicationContext.finishRefresh(AbstractApplicationContext.java:855)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:541)
at org.springframework.web.context.ContextLoader.configureAndRefreshWebApplicationContext(ContextLoader.java:444)
at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:326)
at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:107)
at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4853)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5314)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:145)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1407)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1397)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)

解决方法:

在 spring-dubbo-provider.xml 文件里边

<dubbo:protocol name="dubbo" port="20883" />改成下面这个,加上host地址(记着,本人用127.0.0.1测试无效)

<dubbo:protocol name="dubbo" host="192.168.3.53" port="20883" />

问题3:

严重: Exception sending context initialized event to listener instance of class org.springframework.web.util.Log4jConfigListener
java.lang.IllegalStateException: Web app root system property already set to different value: 'webapp.root' = [/home/keefer/JAVA/workspace/.metadata/.plugins/org.eclipse.wst.server.core/tmp0/wtpwebapps/zk1service/] instead of [/home/keefer/JAVA/workspace/.metadata/.plugins/org.eclipse.wst.server.core/tmp0/wtpwebapps/zk1client/] - Choose unique values for the 'webAppRootKey' context-param in your web.xml files!
at org.springframework.web.util.WebUtils.setWebAppRootSystemProperty(WebUtils.java:161)
at org.springframework.web.util.Log4jWebConfigurer.initLogging(Log4jWebConfigurer.java:119)
at org.springframework.web.util.Log4jConfigListener.contextInitialized(Log4jConfigListener.java:49)
at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4853)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5314)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:145)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1407)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1397)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)

解决方法:

将web.xml文件里边的spring监听器

<listener>
<description>spring监听器</description>
<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
<listener-class>org.springframework.web.util.Log4jConfigListener</listener-class>
</listener>

修改成

<listener>
<description>spring监听器</description>
<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
</listener>

dubbo消费者这端不用log4j日志配置,去掉就好

zookeeper dubbo 问题解决录的更多相关文章

  1. 适合初学者的一个分布式环境搭建过程(spring boot + zookeeper + dubbo + mybatis + mysql)

    本人也是才开始接触 阿里巴巴的开源分布式框架 dubbo,因为现在微服务框架 spring boot也非常的火,然后结合dubbo的官网搭建这个开发环境. 一.首先 zookeeper作为集群管理服务 ...

  2. zookeeper+dubbo简单使用

    首先下载zookeeper,直接百度官网下载即可! 下载完之后,把cfg配置文件改名为zoo.cfg,如下: 在bin目录下启动zkServer即可! 项目结构: 简单讲解:首先dubbo是一个mav ...

  3. Zookeeper + Dubbo + SpringMVC + dubbo-admin

    第一步:在CentOS/Windows上安装Zookeeper[前提] A:CentOS     Zookeeper作为Dubbo服务的注册中心,Dubbo原先基于数据库的注册中心,没采用Zookee ...

  4. Zookeeper+Dubbo+SpringMVC环境搭建

    项目码云GIT地址:https://gitee.com/xshuai/dubbo/ 开发工具 MyEclipse 10.7 JDK 1.7 容器 Tomcat 8(运行dubbo) zookeeper ...

  5. IDEA上创建 Maven SpringBoot + zookeeper +dubbo 实例

    概述 首先声明,本文是学习总结类型的博客内容,如有雷同纯属学习.本位主要结合zookeeper和dubbo做个简单实例.目前来说,一般网站架构随着业务的发展,逻辑越来越复杂,数据量越来越大,交互越来越 ...

  6. zookeeper+dubbo简单部署方案

    1.zookeeper服务 首先,我们需要下载:zookeeper-3.4.9 解压后,在conf文件夹中添加一个配置文件zoo.cfg,内容如下: tickTime=2000 dataDir=/Us ...

  7. springboot+Zookeeper+Dubbo入门

    最近想学习dubbo,就利用周末写了一个特别简单的demo,不知道有没有用,先记录一下. 1.安装zookeeper并启动(安装看我上一篇博客https://www.cnblogs.com/huang ...

  8. zookeeper+dubbo【转载】

    转载地址:http://ahua186186.iteye.com/blog/1912421 注:zookeeper集群是myid文件是没有后缀名的. 转自: http://www.verydemo.c ...

  9. windows下 zookeeper dubbo 安装+配置+demo 详细图文教程

    Java集群优化——dubbo+zookeeper构建 互联网的发展,网站应用的规模不断扩大,常规的垂直应用架构已无法应对,分布式服务架构以及流动计算架构势在必行,Dubbo是一个分布式服务框架,在这 ...

随机推荐

  1. 承接Hololens内容定制外包

    近日,微软宣布第三批微软Hololens开发者版开始发货,包括:头显.头显手提包和一个遥控器.前两批开发者版本分别在今年3月30日和5月9日开始发货的. 第三批AR头显Hololens开发者版发货 虽 ...

  2. http load 的使用以及参数解释

    http load 的使用以及参数解释   1.参数含义 参数     全称      含义 -p        -parallel     并发的用户进程数.-f        -fetches   ...

  3. 【sql】之查询昨天的记录

    http://blog.csdn.net/cangchen/article/details/44978531

  4. Arrays和Collection之间的转换

    1.将数组转换成固定大小的列表: public static <T> List<T> asList(T... a)参数 T... a:数组元素 返回值 List<T> ...

  5. VES Hand Book Contents

    3...ABOUT THE VES4...Foreword 6...Chapter 1......Introduction6......Visual Effects and Special Effec ...

  6. CSS3常用30种选择器总结

    CSS3常用30种选择器总结 HTML5/CSS3时尚的圆盘时钟动画 带当前日期 www.html5tricks.com/demo/html5-css3-clock-with-date/index.h ...

  7. Oracle Merge备忘示例

    Oracle的merge语法非常实用,用于Insert.Update判断情况.以下是自己书写的一个示例,以免时间长了语法形式忘记了. MERGE INTO T_FR_GUOSZX T USING (S ...

  8. 【linux编程】linux中HZ和Jiffies的关系

    读cubic源码的时候遇到了HZ和jiffies,不懂这两者代表什么.网上描述的是这样的 全局变量jiffies用来记录自系统启动以来产生的节拍的总数.启动时,内核将该变量初始化为0,此后,每次时钟中 ...

  9. sas编程-日期相差计算函数 intnx

    sas编程-日期相差计算函数 intnx 示例代码: data _null_;    lastdate=intnx('year',today(),-100);    format lastdate  ...

  10. LeetCode 374. Guess Number Higher or Lower

    We are playing the Guess Game. The game is as follows: I pick a number from 1 to n. You have to gues ...