官方网址:http://dubbo.apache.org/zh-cn/index.html
学习可以参考官网中文文档:http://dubbo.apache.org/zh-cn/docs/user/quick-start.html
SOA,英文名称(Service Oriented Ambiguity),中文名称:面向服务架构(有一个专门提供服务单元,其他所有单元都调用这个服务)。SOA专门访问数据库服务(项目),开发时可以实现,数据访问控制和代码复用。
1 实现SOA架构时,常用服务: 2 a、Dubbo 做为服务。 3 b、WebService 做为服务。 4 c、Dubbox 做为服务。 5 d、服务方就是web项目,调用web项目的控制器。 6 使用HttpClient可以调用其他项目的控制器。
RPC,英文名称(Remote Procedure Call Protocol),中文名称:远程过程调用协议,RPC解析:客户端(A)通过互联网调用远程服务器,不知道远程服务器具体实现,只知道远程服务器提供了什么功能。RPC最大优点,数据安全性。
1、Apache Dubbo是一款高性能、轻量级的开源Java RPC框架,它提供了三大核心能力:面向接口的远程方法调用,智能容错和负载均衡,以及服务自动注册和发现。Dubbo一个分布式、高性能、透明化的RPC服务框架。作用是,提供服务自动注册、自动发现等高效服务治理方案
1 如果项目表现层、服务层是不同的项目,可以使用dubbo实现两个系统之间的通信。服务层和表现层相互通信,使用dubbo中间件,让表现层调用服务层。工程之间的相互通信可以使用dubbo,,可以统一管理服务,系统之间的调用。 2 如何实现远程通信。 3 1、Webservice,效率不高,基于soap协议,项目中不推荐使用。 4 2、使用restful形式的服务,http+json,很多项目中应用。如果服务太多,服务之间的调用关系混乱,需要治疗服务。 5 3、dubbo,使用rpc协议进行远程调用,直接使用socket通信,传输效率高,并且可以统计出系统之间的调用关系,调用次数。缺点,由于是java开发,只能是两个java项目进行调度。
2、dubbo架构。术语来自官网。可以直接查看官网。
虚线都是异步访问,实线都是同步访问。
蓝色虚线:在启动时完成的功能。
红色虚线(实线)都是程序运行过程中执行的功能。
所有的角色都是可以在单独的服务器上.所以必须遵守特定的协议。
节点角色说明
节点 | 角色说明 |
---|---|
Provider |
暴露服务的服务提供方,提供者,服务发布方 |
Consumer |
调用远程服务的服务消费方,消费者, 调用服务方 |
Registry |
服务注册与发现的注册中心,注册中心.当Container启动时把所有可以提供的服务列表上Registry中进行注册,作用:告诉Consumer提供了什么服务和服务方在哪里 |
Monitor |
统计服务的调用次数和调用时间的监控中心,监听器 |
Container |
服务运行容器,Dubbo容器.依赖于Spring容器 |
调用关系说明
- 服务容器负责启动,加载,运行服务提供者。
- 服务提供者在启动时,向注册中心注册自己提供的服务。
- 服务消费者在启动时,向注册中心订阅自己所需的服务。
- 注册中心返回服务提供者地址列表给消费者,如果有变更,注册中心将基于长连接推送变更数据给消费者。
- 服务消费者,从提供者地址列表中,基于软负载均衡算法,选一台提供者进行调用,如果调用失败,再选另一台调用。
- 服务消费者和提供者,在内存中累计调用次数和调用时间,定时每分钟发送一次统计数据到监控中心。
Dubbo 架构具有以下几个特点,分别是连通性、健壮性、伸缩性、以及向未来架构的升级性。
1 2. Dubbo运行原理: 2 2.0 启动容器,相当于在启动Dubbo的Provider 3 2.1 启动后会去注册中心进行注册.注册所有可以提供的服务列表 4 2.2 在Consumer启动后会去Registry中获取服务列表和Provider的地址.进行订阅. 5 2.3 当Provider有修改后,注册中心会把消息推送给Consummer 6 2.3.1 使用了观察者设计模式(又叫发布/订阅设计模式) 7 2.4 根据获取到的Provider地址,真实调用Provider中功能. 8 2.4.1 在Consumer方使用了代理设计模式.创建一个Provider方类的一个代理对象.通过代理对象获取Provider中真实功能,起到保护Provider真实功能的作用. 9 2.5 Consumer和Provider每隔1分钟向Monitor发送统计信息,统计信息包含,访问次数,频率等.
3、注册中心(推荐zookeeper,也可以使用redis的呢)
注册中心负责服务地址得注册与查找,相当于目录服务,服务提供者和消费者只在启动得时候与注册中心交互,注册中心不转发请求,压力较小,使用dubbo2.3.3以上版本,建议使用zookeeper注册中心。zookeeper是一个树形的目录服务,支持变更推送,适合作为dubbo服务的注册中心,工业强度高,可以用于生产环境,推荐使用。
4、安装zookeeper,必须首先安装jdk,这里安装jdk1.7版本。首先将安装包上传到机器上面哦。
[root@localhost jdk1.7.0_55]# tar -zxvf jdk-7u55-linux-i586.tar.gz -C /home/hadoop/soft
[root@localhost ~]# vim /etc/profile
1 export JAVA_HOME=/home/hadoop/soft/jdk1.7.0_55 2 export PATH=$PATH:$JAVA_HOME/bin
[root@localhost ~]# source /etc/profile
[root@localhost ~]# java
[root@localhost ~]# javac
[root@localhost ~]# java -version
5、开始安装zookeeper,首先将安装包上传到机器上面哦。
解压缩操作哦。
[root@localhost package]# tar -zxvf zookeeper-3.4.6.tar.gz -C /home/hadoop/soft/
然后配置一下zookeeper,就可以启动zookeeper了。
首先创建一个data文件夹。
配置完成了,就可以启动zookeeper。进行验证是否可以正常启动。
1 [root@localhost bin]# ./zkServer.sh start 2 JMX enabled by default 3 Using config: /home/hadoop/soft/zookeeper-3.4.6/bin/../conf/zoo.cfg 4 Starting zookeeper ... STARTED 5 [root@localhost bin]# ./zkServer.sh status 6 JMX enabled by default 7 Using config: /home/hadoop/soft/zookeeper-3.4.6/bin/../conf/zoo.cfg 8 Mode: standalone 9 [root@localhost bin]#
[root@localhost bin]# ./zkServer.sh start 启动
[root@localhost bin]# ./zkServer.sh status 查看启动状态
[root@localhost bin]# ./zkServer.sh stop 关闭
注意:为了外部可以访问,可以将zookeeper的2181的端口号添加到防火墙可以访问。避免出现防火墙拒绝访问的情况出现。
[root@localhost ~]# vim /etc/sysconfig/iptables
然后,重启防火墙,[root@localhost ~]# service iptables restart。或者你直接将防火墙关闭也可以,视自己的情况而定吧。
6、zookeeper安装成功以后,就可以操作,服务如何发布,客户端如何引用服务。
Dubbo采用全Spring配置方式,透明化接入应用,对应用没有任何api侵入,只需要用spring加载dubbo的配置即可,dubbo基于spring的schema扩展进行加载。
远程服务。在本地服务的基础上,只需要简单的配置,即可以完成远程话。
将传统写的xml配置文件中的bean注入以及bean的依赖注入的配置拆分成两份,将服务定义部分放在服务提供方remote-provider.xml,将服务引用部分放在服务消费方remote-consumer.xml配置文件中。并在提供方增加暴漏服务配置<dubbo:service>,在消费方增加引用服务配置<dubbo:reference>。官网截图:
7、发布dubbo服务。定义一个接口。
1 package com.taotao.service; 2 3 import com.taotao.pojo.TbItem; 4 5 /** 6 * 7 * @ClassName: ItemService.java 8 * @author: biehl 9 * @since: 2019年8月2日 下午3:32:36 10 * @Copyright: ©2019 biehl 版权所有 11 * @version: 0.0.1 12 * @Description:商品接口类 13 * 14 */ 15 public interface ItemService { 16 17 /** 18 * 根据itemId查询出商品信息 19 * 20 * @param itemId 21 * @return 22 */ 23 public TbItem getItemById(long itemId); 24 25 }
定义实现接口的实现类。
1 package com.taotao.service.impl; 2 3 import org.springframework.beans.factory.annotation.Autowired; 4 import org.springframework.stereotype.Service; 5 import org.springframework.util.StringUtils; 6 7 import com.taotao.mapper.TbItemMapper; 8 import com.taotao.pojo.TbItem; 9 import com.taotao.service.ItemService; 10 11 /** 12 * 13 * @ClassName: ItemServiceImpl.java 14 * @author: biehl 15 * @since: 2019年8月2日 下午3:51:24 16 * @Copyright: ©2019 biehl 版权所有 17 * @version: 0.0.1 18 * @Description: 商品实现类 19 */ 20 @Service 21 public class ItemServiceImpl implements ItemService { 22 23 @Autowired 24 private TbItemMapper tbItemMapper; 25 26 @Override 27 public TbItem getItemById(long itemId) { 28 TbItem tbItem = new TbItem(); 29 if (!StringUtils.isEmpty(itemId)) { 30 tbItem = tbItemMapper.selectByPrimaryKey(itemId); 31 } 32 // 返回信息以后就可以发布服务 33 return tbItem; 34 } 35 36 }
配置提供dubbo的服务。
1 <?xml version="1.0" encoding="UTF-8"?> 2 <beans xmlns="http://www.springframework.org/schema/beans" 3 xmlns:context="http://www.springframework.org/schema/context" 4 xmlns:p="http://www.springframework.org/schema/p" 5 xmlns:aop="http://www.springframework.org/schema/aop" 6 xmlns:tx="http://www.springframework.org/schema/tx" 7 xmlns:dubbo="http://code.alibabatech.com/schema/dubbo" 8 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 9 xsi:schemaLocation="http://www.springframework.org/schema/beans 10 http://www.springframework.org/schema/beans/spring-beans-4.2.xsd 11 http://www.springframework.org/schema/context 12 http://www.springframework.org/schema/context/spring-context-4.2.xsd 13 http://www.springframework.org/schema/aop 14 http://www.springframework.org/schema/aop/spring-aop-4.2.xsd 15 http://www.springframework.org/schema/tx 16 http://www.springframework.org/schema/tx/spring-tx-4.2.xsd 17 http://code.alibabatech.com/schema/dubbo 18 http://code.alibabatech.com/schema/dubbo/dubbo.xsd 19 http://www.springframework.org/schema/util 20 http://www.springframework.org/schema/util/spring-util-4.2.xsd"> 21 22 <!-- 1、配置包扫描器,扫描所有带@Service注解的类,將創建的對象放到Spring容器中 --> 23 <!-- 也可以将子包扫描进去 --> 24 <!-- 将扫描com.taotao.service、com.taotao.service.impl --> 25 <context:component-scan 26 base-package="com.taotao.service"></context:component-scan> 27 28 <!-- 配置spring的事务,单独提取出来 --> 29 30 <!-- 发布dubbo服务 --> 31 <!-- 提供方应用信息,用于计算依赖关系 --> 32 <dubbo:application name="taotao-manager" /> 33 <!-- 注册中心的地址 --> 34 <dubbo:registry protocol="zookeeper" address="192.168.110.140:2181" /> 35 <!-- 用dubbo协议在20880端口暴露服务 --> 36 <dubbo:protocol name="dubbo" port="20880" /> 37 <!-- 声明需要暴露的服务接口 --> 38 <!-- ref="itemServiceImpl"就是扫描service的时候,注入到容器的bean --> 39 <dubbo:service interface="com.taotao.service.ItemService" ref="itemServiceImpl" timeout="300000" /> 40 <!-- <dubbo:service interface="com.taotao.service.ItemCatService" ref="itemCatServiceImpl" timeout="300000" /> --> 41 42 43 44 45 46 47 </beans>
如图所示:
8、在表现层引用dubbo的服务。提供方和引用方都需要引入dubbo的jar包哦。
1 <!-- dubbo相关 --> 2 <dependency> 3 <groupId>com.alibaba</groupId> 4 <artifactId>dubbo</artifactId> 5 <!-- 排除spring的2.5.6版本,netty3.2.5版本,避免冲突 --> 6 <exclusions> 7 <exclusion> 8 <groupId>org.springframework</groupId> 9 <artifactId>spring</artifactId> 10 </exclusion> 11 <exclusion> 12 <groupId>org.jboss.netty</groupId> 13 <artifactId>netty</artifactId> 14 </exclusion> 15 </exclusions> 16 </dependency> 17 <dependency> 18 <groupId>org.apache.zookeeper</groupId> 19 <artifactId>zookeeper</artifactId> 20 </dependency> 21 <dependency> 22 <groupId>com.github.sgroschupf</groupId> 23 <artifactId>zkclient</artifactId> 24 </dependency>
配置一下引用方的配置。
1 <?xml version="1.0" encoding="UTF-8"?> 2 <beans xmlns="http://www.springframework.org/schema/beans" 3 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 4 xmlns:p="http://www.springframework.org/schema/p" 5 xmlns:context="http://www.springframework.org/schema/context" 6 xmlns:dubbo="http://code.alibabatech.com/schema/dubbo" 7 xmlns:mvc="http://www.springframework.org/schema/mvc" 8 xsi:schemaLocation="http://www.springframework.org/schema/beans 9 http://www.springframework.org/schema/beans/spring-beans-4.2.xsd 10 http://www.springframework.org/schema/mvc 11 http://www.springframework.org/schema/mvc/spring-mvc-4.2.xsd 12 http://code.alibabatech.com/schema/dubbo 13 http://code.alibabatech.com/schema/dubbo/dubbo.xsd 14 http://www.springframework.org/schema/context 15 http://www.springframework.org/schema/context/spring-context-4.2.xsd"> 16 17 <!-- 1、加载属性文件 --> 18 <!-- <context:property-placeholder location="classpath:resource/resource.properties"/> --> 19 20 <!-- 2、配置注解驱动 --> 21 <mvc:annotation-driven /> 22 23 <!-- 3、视图解析器 --> 24 <bean class="org.springframework.web.servlet.view.InternalResourceViewResolver"> 25 <property name="prefix" value="/WEB-INF/jsp/" /> 26 <property name="suffix" value=".jsp" /> 27 </bean> 28 29 <!-- 4、配置包扫描器,扫描@Controller注解的类 --> 30 <context:component-scan base-package="com.taotao.controller"/> 31 32 <!-- 5、配置资源映射 --> 33 <mvc:resources location="/css/" mapping="/css/**"/> 34 <mvc:resources location="/js/" mapping="/js/**"/> 35 36 <!-- 6、多媒体解析器 --> 37 <!-- 配置文件上传解析器 --> 38 <bean id="multipartResolver" class="org.springframework.web.multipart.commons.CommonsMultipartResolver"> 39 <!-- 设定默认编码 --> 40 <property name="defaultEncoding" value="UTF-8"></property> 41 <!-- 设定文件上传的最大值5MB,5*1024*1024 --> 42 <property name="maxUploadSize" value="5242880"></property> 43 </bean> 44 45 46 <!-- 引用服务,也要在spring容器中,直接在这里引用即可 --> 47 <!-- 引用dubbo服务 --> 48 <!-- 名称不一样的哦 --> 49 <dubbo:application name="taotao-manager-web"/> 50 <dubbo:registry protocol="zookeeper" address="192.168.110.140:2181"/> 51 <dubbo:reference interface="com.taotao.service.ItemService" id="itemService" /> 52 <!-- <dubbo:reference interface="com.taotao.service.ItemCatService" id="itemCatService" /> 53 <dubbo:reference interface="com.taotao.content.service.ContentCategoryService" id="contentCategoryService" /> 54 <dubbo:reference interface="com.taotao.content.service.ContentService" id="contentService" /> 55 <dubbo:reference interface="com.taotao.search.service.SearchItemService" id="searchItemService" /> --> 56 57 58 59 60 </beans>
1 package com.taotao.controller; 2 3 import org.springframework.beans.factory.annotation.Autowired; 4 import org.springframework.stereotype.Controller; 5 import org.springframework.web.bind.annotation.PathVariable; 6 import org.springframework.web.bind.annotation.RequestMapping; 7 import org.springframework.web.bind.annotation.ResponseBody; 8 9 import com.taotao.pojo.TbItem; 10 import com.taotao.service.ItemService; 11 12 /** 13 * 14 * @ClassName: ItemController.java 15 * @author: biehl 16 * @since: 2019年8月2日 下午5:10:31 17 * @Copyright: ©2019 biehl 版权所有 18 * @version: 0.0.1 19 * @Description:商品信息的控制层逻辑 20 */ 21 @Controller 22 public class ItemController { 23 24 // itemService就是dubbo配置的id="itemService" 25 @Autowired 26 private ItemService itemService; 27 28 @RequestMapping(value = "/item/{itemId}") 29 @ResponseBody 30 public TbItem getItemById(@PathVariable(value = "itemId") Long itemId) { 31 TbItem tbItem = new TbItem(); 32 tbItem = itemService.getItemById(itemId); 33 return tbItem; 34 } 35 36 }
9、dubbo服务调用测试。记得关闭dubbo服务器的防火墙,不然急死你。
访问http://localhost:8081/item/536563,报错了,然后呢,解决问题呗。是因为mapper映射文件没有发布的问题。在工程的pom配置文件里面添加如下配置内容。
1 [INFO] Scanning for projects... 2 [INFO] 3 [INFO] -------------------< com.taotao:taotao-manager-web >-------------------- 4 [INFO] Building taotao-manager-web 0.0.1-SNAPSHOT 5 [INFO] --------------------------------[ war ]--------------------------------- 6 [INFO] 7 [INFO] --- maven-clean-plugin:2.5:clean (default-clean) @ taotao-manager-web --- 8 [INFO] Deleting D:programeclipseeclipseworkspace_taotao aotao-manager-web arget 9 [INFO] 10 [INFO] >>> tomcat7-maven-plugin:2.2:run (default-cli) > process-classes @ taotao-manager-web >>> 11 [INFO] 12 [INFO] --- maven-resources-plugin:2.7:resources (default-resources) @ taotao-manager-web --- 13 [INFO] Using 'UTF-8' encoding to copy filtered resources. 14 [INFO] Copying 1 resource 15 [INFO] 16 [INFO] --- maven-compiler-plugin:3.2:compile (default-compile) @ taotao-manager-web --- 17 [INFO] Changes detected - recompiling the module! 18 [INFO] Compiling 1 source file to D:programeclipseeclipseworkspace_taotao aotao-manager-web argetclasses 19 [INFO] 20 [INFO] <<< tomcat7-maven-plugin:2.2:run (default-cli) < process-classes @ taotao-manager-web <<< 21 [INFO] 22 [INFO] 23 [INFO] --- tomcat7-maven-plugin:2.2:run (default-cli) @ taotao-manager-web --- 24 [INFO] Running war on http://localhost:8081/ 25 [INFO] Creating Tomcat server configuration at D:programeclipseeclipseworkspace_taotao aotao-manager-web arget omcat 26 [INFO] create webapp with contextPath: 27 八月 03, 2019 10:24:41 下午 org.apache.coyote.AbstractProtocol init 28 信息: Initializing ProtocolHandler ["http-bio-8081"] 29 八月 03, 2019 10:24:41 下午 org.apache.catalina.core.StandardService startInternal 30 信息: Starting service Tomcat 31 八月 03, 2019 10:24:41 下午 org.apache.catalina.core.StandardEngine startInternal 32 信息: Starting Servlet Engine: Apache Tomcat/7.0.47 33 八月 03, 2019 10:24:44 下午 org.apache.catalina.core.ApplicationContext log 34 信息: No Spring WebApplicationInitializer types detected on classpath 35 log4j:WARN No appenders could be found for logger (org.springframework.web.context.support.StandardServletEnvironment). 36 log4j:WARN Please initialize the log4j system properly. 37 log4j:WARN See http://logging.apache.org/log4j/1.2/faq.html#noconfig for more info. 38 八月 03, 2019 10:24:44 下午 org.apache.catalina.core.ApplicationContext log 39 信息: Initializing Spring FrameworkServlet 'taotao-manager-web' 40 八月 03, 2019 10:24:46 下午 org.apache.coyote.AbstractProtocol start 41 信息: Starting ProtocolHandler ["http-bio-8081"] 42 八月 03, 2019 10:27:16 下午 org.apache.catalina.core.StandardWrapperValve invoke 43 严重: Servlet.service() for servlet [taotao-manager-web] in context with path [] threw exception [Request processing failed; nested exception is java.lang.RuntimeException: org.apache.ibatis.binding.BindingException: Invalid bound statement (not found): com.taotao.mapper.TbItemMapper.selectByPrimaryKey 44 org.apache.ibatis.binding.BindingException: Invalid bound statement (not found): com.taotao.mapper.TbItemMapper.selectByPrimaryKey 45 at org.apache.ibatis.binding.MapperMethod$SqlCommand.<init>(MapperMethod.java:189) 46 at org.apache.ibatis.binding.MapperMethod.<init>(MapperMethod.java:43) 47 at org.apache.ibatis.binding.MapperProxy.cachedMapperMethod(MapperProxy.java:58) 48 at org.apache.ibatis.binding.MapperProxy.invoke(MapperProxy.java:51) 49 at com.sun.proxy.$Proxy32.selectByPrimaryKey(Unknown Source) 50 at com.taotao.service.impl.ItemServiceImpl.getItemById(ItemServiceImpl.java:23) 51 at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) 52 at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) 53 at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) 54 at java.lang.reflect.Method.invoke(Method.java:606) 55 at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:302) 56 at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:190) 57 at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:157) 58 at org.springframework.transaction.interceptor.TransactionInterceptor$1.proceedWithInvocation(TransactionInterceptor.java:99) 59 at org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:281) 60 at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:96) 61 at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179) 62 at org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:92) 63 at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179) 64 at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:208) 65 at com.sun.proxy.$Proxy35.getItemById(Unknown Source) 66 at com.alibaba.dubbo.common.bytecode.Wrapper0.invokeMethod(Wrapper0.java) 67 at com.alibaba.dubbo.rpc.proxy.javassist.JavassistProxyFactory$1.doInvoke(JavassistProxyFactory.java:46) 68 at com.alibaba.dubbo.rpc.proxy.AbstractProxyInvoker.invoke(AbstractProxyInvoker.java:72) 69 at com.alibaba.dubbo.rpc.protocol.InvokerWrapper.invoke(InvokerWrapper.java:53) 70 at com.alibaba.dubbo.rpc.filter.ExceptionFilter.invoke(ExceptionFilter.java:64) 71 at com.alibaba.dubbo.rpc.protocol.ProtocolFilterWrapper$1.invoke(ProtocolFilterWrapper.java:91) 72 at com.alibaba.dubbo.rpc.filter.TimeoutFilter.invoke(TimeoutFilter.java:42) 73 at com.alibaba.dubbo.rpc.protocol.ProtocolFilterWrapper$1.invoke(ProtocolFilterWrapper.java:91) 74 at com.alibaba.dubbo.monitor.support.MonitorFilter.invoke(MonitorFilter.java:75) 75 at com.alibaba.dubbo.rpc.protocol.ProtocolFilterWrapper$1.invoke(ProtocolFilterWrapper.java:91) 76 at com.alibaba.dubbo.rpc.protocol.dubbo.filter.TraceFilter.invoke(TraceFilter.java:78) 77 at com.alibaba.dubbo.rpc.protocol.ProtocolFilterWrapper$1.invoke(ProtocolFilterWrapper.java:91) 78 at com.alibaba.dubbo.rpc.filter.ContextFilter.invoke(ContextFilter.java:60) 79 at com.alibaba.dubbo.rpc.protocol.ProtocolFilterWrapper$1.invoke(ProtocolFilterWrapper.java:91) 80 at com.alibaba.dubbo.rpc.filter.GenericFilter.invoke(GenericFilter.java:112) 81 at com.alibaba.dubbo.rpc.protocol.ProtocolFilterWrapper$1.invoke(ProtocolFilterWrapper.java:91) 82 at com.alibaba.dubbo.rpc.filter.ClassLoaderFilter.invoke(ClassLoaderFilter.java:38) 83 at com.alibaba.dubbo.rpc.protocol.ProtocolFilterWrapper$1.invoke(ProtocolFilterWrapper.java:91) 84 at com.alibaba.dubbo.rpc.filter.EchoFilter.invoke(EchoFilter.java:38) 85 at com.alibaba.dubbo.rpc.protocol.ProtocolFilterWrapper$1.invoke(ProtocolFilterWrapper.java:91) 86 at com.alibaba.dubbo.rpc.protocol.dubbo.DubboProtocol$1.reply(DubboProtocol.java:108) 87 at com.alibaba.dubbo.remoting.exchange.support.header.HeaderExchangeHandler.handleRequest(HeaderExchangeHandler.java:84) 88 at com.alibaba.dubbo.remoting.exchange.support.header.HeaderExchangeHandler.received(HeaderExchangeHandler.java:170) 89 at com.alibaba.dubbo.remoting.transport.DecodeHandler.received(DecodeHandler.java:52) 90 at com.alibaba.dubbo.remoting.transport.dispatcher.ChannelEventRunnable.run(ChannelEventRunnable.java:82) 91 at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) 92 at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) 93 at java.lang.Thread.run(Thread.java:745) 94 ] with root cause 95 java.lang.RuntimeException: org.apache.ibatis.binding.BindingException: Invalid bound statement (not found): com.taotao.mapper.TbItemMapper.selectByPrimaryKey 96 org.apache.ibatis.binding.BindingException: Invalid bound statement (not found): com.taotao.mapper.TbItemMapper.selectByPrimaryKey 97 at org.apache.ibatis.binding.MapperMethod$SqlCommand.<init>(MapperMethod.java:189) 98 at org.apache.ibatis.binding.MapperMethod.<init>(MapperMethod.java:43) 99 at org.apache.ibatis.binding.MapperProxy.cachedMapperMethod(MapperProxy.java:58) 100 at org.apache.ibatis.binding.MapperProxy.invoke(MapperProxy.java:51) 101 at com.sun.proxy.$Proxy32.selectByPrimaryKey(Unknown Source) 102 at com.taotao.service.impl.ItemServiceImpl.getItemById(ItemServiceImpl.java:23) 103 at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) 104 at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) 105 at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) 106 at java.lang.reflect.Method.invoke(Method.java:606) 107 at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:302) 108 at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:190) 109 at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:157) 110 at org.springframework.transaction.interceptor.TransactionInterceptor$1.proceedWithInvocation(TransactionInterceptor.java:99) 111 at org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:281) 112 at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:96) 113 at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179) 114 at org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:92) 115 at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179) 116 at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:208) 117 at com.sun.proxy.$Proxy35.getItemById(Unknown Source) 118 at com.alibaba.dubbo.common.bytecode.Wrapper0.invokeMethod(Wrapper0.java) 119 at com.alibaba.dubbo.rpc.proxy.javassist.JavassistProxyFactory$1.doInvoke(JavassistProxyFactory.java:46) 120 at com.alibaba.dubbo.rpc.proxy.AbstractProxyInvoker.invoke(AbstractProxyInvoker.java:72) 121 at com.alibaba.dubbo.rpc.protocol.InvokerWrapper.invoke(InvokerWrapper.java:53) 122 at com.alibaba.dubbo.rpc.filter.ExceptionFilter.invoke(ExceptionFilter.java:64) 123 at com.alibaba.dubbo.rpc.protocol.ProtocolFilterWrapper$1.invoke(ProtocolFilterWrapper.java:91) 124 at com.alibaba.dubbo.rpc.filter.TimeoutFilter.invoke(TimeoutFilter.java:42) 125 at com.alibaba.dubbo.rpc.protocol.ProtocolFilterWrapper$1.invoke(ProtocolFilterWrapper.java:91) 126 at com.alibaba.dubbo.monitor.support.MonitorFilter.invoke(MonitorFilter.java:75) 127 at com.alibaba.dubbo.rpc.protocol.ProtocolFilterWrapper$1.invoke(ProtocolFilterWrapper.java:91) 128 at com.alibaba.dubbo.rpc.protocol.dubbo.filter.TraceFilter.invoke(TraceFilter.java:78) 129 at com.alibaba.dubbo.rpc.protocol.ProtocolFilterWrapper$1.invoke(ProtocolFilterWrapper.java:91) 130 at com.alibaba.dubbo.rpc.filter.ContextFilter.invoke(ContextFilter.java:60) 131 at com.alibaba.dubbo.rpc.protocol.ProtocolFilterWrapper$1.invoke(ProtocolFilterWrapper.java:91) 132 at com.alibaba.dubbo.rpc.filter.GenericFilter.invoke(GenericFilter.java:112) 133 at com.alibaba.dubbo.rpc.protocol.ProtocolFilterWrapper$1.invoke(ProtocolFilterWrapper.java:91) 134 at com.alibaba.dubbo.rpc.filter.ClassLoaderFilter.invoke(ClassLoaderFilter.java:38) 135 at com.alibaba.dubbo.rpc.protocol.ProtocolFilterWrapper$1.invoke(ProtocolFilterWrapper.java:91) 136 at com.alibaba.dubbo.rpc.filter.EchoFilter.invoke(EchoFilter.java:38) 137 at com.alibaba.dubbo.rpc.protocol.ProtocolFilterWrapper$1.invoke(ProtocolFilterWrapper.java:91) 138 at com.alibaba.dubbo.rpc.protocol.dubbo.DubboProtocol$1.reply(DubboProtocol.java:108) 139 at com.alibaba.dubbo.remoting.exchange.support.header.HeaderExchangeHandler.handleRequest(HeaderExchangeHandler.java:84) 140 at com.alibaba.dubbo.remoting.exchange.support.header.HeaderExchangeHandler.received(HeaderExchangeHandler.java:170) 141 at com.alibaba.dubbo.remoting.transport.DecodeHandler.received(DecodeHandler.java:52) 142 at com.alibaba.dubbo.remoting.transport.dispatcher.ChannelEventRunnable.run(ChannelEventRunnable.java:82) 143 at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) 144 at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) 145 at java.lang.Thread.run(Thread.java:745) 146 147 at com.alibaba.dubbo.rpc.filter.ExceptionFilter.invoke(ExceptionFilter.java:108) 148 at com.alibaba.dubbo.rpc.protocol.ProtocolFilterWrapper$1.invoke(ProtocolFilterWrapper.java:91) 149 at com.alibaba.dubbo.rpc.filter.TimeoutFilter.invoke(TimeoutFilter.java:42) 150 at com.alibaba.dubbo.rpc.protocol.ProtocolFilterWrapper$1.invoke(ProtocolFilterWrapper.java:91) 151 at com.alibaba.dubbo.monitor.support.MonitorFilter.invoke(MonitorFilter.java:75) 152 at com.alibaba.dubbo.rpc.protocol.ProtocolFilterWrapper$1.invoke(ProtocolFilterWrapper.java:91) 153 at com.alibaba.dubbo.rpc.protocol.dubbo.filter.TraceFilter.invoke(TraceFilter.java:78) 154 at com.alibaba.dubbo.rpc.protocol.ProtocolFilterWrapper$1.invoke(ProtocolFilterWrapper.java:91) 155 at com.alibaba.dubbo.rpc.filter.ContextFilter.invoke(ContextFilter.java:60) 156 at com.alibaba.dubbo.rpc.protocol.ProtocolFilterWrapper$1.invoke(ProtocolFilterWrapper.java:91) 157 at com.alibaba.dubbo.rpc.filter.GenericFilter.invoke(GenericFilter.java:112) 158 at com.alibaba.dubbo.rpc.protocol.ProtocolFilterWrapper$1.invoke(ProtocolFilterWrapper.java:91) 159 at com.alibaba.dubbo.rpc.filter.ClassLoaderFilter.invoke(ClassLoaderFilter.java:38) 160 at com.alibaba.dubbo.rpc.protocol.ProtocolFilterWrapper$1.invoke(ProtocolFilterWrapper.java:91) 161 at com.alibaba.dubbo.rpc.filter.EchoFilter.invoke(EchoFilter.java:38) 162 at com.alibaba.dubbo.rpc.protocol.ProtocolFilterWrapper$1.invoke(ProtocolFilterWrapper.java:91) 163 at com.alibaba.dubbo.rpc.protocol.dubbo.DubboProtocol$1.reply(DubboProtocol.java:108) 164 at com.alibaba.dubbo.remoting.exchange.support.header.HeaderExchangeHandler.handleRequest(HeaderExchangeHandler.java:84) 165 at com.alibaba.dubbo.remoting.exchange.support.header.HeaderExchangeHandler.received(HeaderExchangeHandler.java:170) 166 at com.alibaba.dubbo.remoting.transport.DecodeHandler.received(DecodeHandler.java:52) 167 at com.alibaba.dubbo.remoting.transport.dispatcher.ChannelEventRunnable.run(ChannelEventRunnable.java:82) 168 at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) 169 at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) 170 at java.lang.Thread.run(Thread.java:745)
为解决问题的时候,只有接口,没有对应的配置SQL文件。
在pom配置文件里面添加如下配置即可。默认是将src/main/resources目录下面的文件放到 argetclasses目标目录下面,现在修改默认配置,将src/main/java目录下面的文件放到 argetclasses目标目录下面。
1 <!-- 如果不添加此节点mybatis的mapper.xml文件都会被漏掉的。 --> 2 <build> 3 <resources> 4 <resource> 5 <directory>src/main/java</directory> 6 <includes> 7 <include>**/*.xml</include> 8 </includes> 9 </resource> 10 <!-- <resource> 如果需要复制resources下面的文件,需要添加此配置即可 11 <directory>src/main/resources</directory> 12 <includes> 13 <include>**/*.xml</include> 14 </includes> 15 </resource> --> 16 </resources> 17 </build>
然后重启dubbo的发布服务。dubbo的应用服务可以不用重启,表现层只需要调用服务即可。然后又报了下面这个错误。聚合工程下面的模块修改了,也不需要安装,因为你启动的是聚合工程,所以直接启动聚合工程即可。
1 [INFO] Scanning for projects... 2 [INFO] 3 [INFO] -------------------< com.taotao:taotao-manager-web >-------------------- 4 [INFO] Building taotao-manager-web 0.0.1-SNAPSHOT 5 [INFO] --------------------------------[ war ]--------------------------------- 6 [INFO] 7 [INFO] --- maven-clean-plugin:2.5:clean (default-clean) @ taotao-manager-web --- 8 [INFO] Deleting D:programeclipseeclipseworkspace_taotao aotao-manager-web arget 9 [INFO] 10 [INFO] >>> tomcat7-maven-plugin:2.2:run (default-cli) > process-classes @ taotao-manager-web >>> 11 [INFO] 12 [INFO] --- maven-resources-plugin:2.7:resources (default-resources) @ taotao-manager-web --- 13 [INFO] Using 'UTF-8' encoding to copy filtered resources. 14 [INFO] Copying 1 resource 15 [INFO] 16 [INFO] --- maven-compiler-plugin:3.2:compile (default-compile) @ taotao-manager-web --- 17 [INFO] Changes detected - recompiling the module! 18 [INFO] Compiling 1 source file to D:programeclipseeclipseworkspace_taotao aotao-manager-web argetclasses 19 [INFO] 20 [INFO] <<< tomcat7-maven-plugin:2.2:run (default-cli) < process-classes @ taotao-manager-web <<< 21 [INFO] 22 [INFO] 23 [INFO] --- tomcat7-maven-plugin:2.2:run (default-cli) @ taotao-manager-web --- 24 [INFO] Running war on http://localhost:8081/ 25 [INFO] Creating Tomcat server configuration at D:programeclipseeclipseworkspace_taotao aotao-manager-web arget omcat 26 [INFO] create webapp with contextPath: 27 八月 03, 2019 10:35:40 下午 org.apache.coyote.AbstractProtocol init 28 信息: Initializing ProtocolHandler ["http-bio-8081"] 29 八月 03, 2019 10:35:40 下午 org.apache.catalina.core.StandardService startInternal 30 信息: Starting service Tomcat 31 八月 03, 2019 10:35:40 下午 org.apache.catalina.core.StandardEngine startInternal 32 信息: Starting Servlet Engine: Apache Tomcat/7.0.47 33 八月 03, 2019 10:35:43 下午 org.apache.catalina.core.ApplicationContext log 34 信息: No Spring WebApplicationInitializer types detected on classpath 35 log4j:WARN No appenders could be found for logger (org.springframework.web.context.support.StandardServletEnvironment). 36 log4j:WARN Please initialize the log4j system properly. 37 log4j:WARN See http://logging.apache.org/log4j/1.2/faq.html#noconfig for more info. 38 八月 03, 2019 10:35:43 下午 org.apache.catalina.core.ApplicationContext log 39 信息: Initializing Spring FrameworkServlet 'taotao-manager-web' 40 八月 03, 2019 10:35:45 下午 org.apache.coyote.AbstractProtocol start 41 信息: Starting ProtocolHandler ["http-bio-8081"] 42 八月 03, 2019 10:36:10 下午 org.apache.catalina.core.StandardWrapperValve invoke 43 严重: Servlet.service() for servlet [taotao-manager-web] in context with path [] threw exception [Request processing failed; nested exception is com.alibaba.dubbo.rpc.RpcException: Failed to invoke the method getItemById in the service com.taotao.service.ItemService. Tried 3 times of the providers [192.168.110.1:20880] (1/1) from the registry 192.168.110.140:2181 on the consumer 192.168.110.1 using the dubbo version 2.5.3. Last error is: Failed to invoke remote method: getItemById, provider: dubbo://192.168.110.1:20880/com.taotao.service.ItemService?anyhost=true&application=taotao-manager-web&check=false&dubbo=2.5.3&interface=com.taotao.service.ItemService&methods=getItemById&pid=10872&revision=0.0.1-SNAPSHOT&side=consumer&timeout=300000×tamp=1564842944801, cause: Failed to send response: Response [id=2, version=2.0.0, status=20, event=false, error=null, result=RpcResult [result=com.taotao.pojo.TbItem@2e3ba04a, exception=null]], cause: java.lang.IllegalStateException: Serialized class com.taotao.pojo.TbItem must implement java.io.Serializable 44 java.lang.IllegalStateException: Serialized class com.taotao.pojo.TbItem must implement java.io.Serializable 45 at com.alibaba.com.caucho.hessian.io.SerializerFactory.getDefaultSerializer(SerializerFactory.java:261) 46 at com.alibaba.com.caucho.hessian.io.SerializerFactory.getSerializer(SerializerFactory.java:233) 47 at com.alibaba.com.caucho.hessian.io.Hessian2Output.writeObject(Hessian2Output.java:406) 48 at com.alibaba.dubbo.common.serialize.support.hessian.Hessian2ObjectOutput.writeObject(Hessian2ObjectOutput.java:92) 49 at com.alibaba.dubbo.rpc.protocol.dubbo.DubboCodec.encodeResponseData(DubboCodec.java:200) 50 at com.alibaba.dubbo.remoting.exchange.codec.ExchangeCodec.encodeResponse(ExchangeCodec.java:276) 51 at com.alibaba.dubbo.remoting.exchange.codec.ExchangeCodec.encode(ExchangeCodec.java:77) 52 at com.alibaba.dubbo.rpc.protocol.dubbo.DubboCountCodec.encode(DubboCountCodec.java:39) 53 at com.alibaba.dubbo.remoting.transport.netty.NettyCodecAdapter$InternalEncoder.encode(NettyCodecAdapter.java:81) 54 at org.jboss.netty.handler.codec.oneone.OneToOneEncoder.doEncode(OneToOneEncoder.java:66) 55 at org.jboss.netty.handler.codec.oneone.OneToOneEncoder.handleDownstream(OneToOneEncoder.java:59) 56 at org.jboss.netty.channel.DefaultChannelPipeline.sendDownstream(DefaultChannelPipeline.java:591) 57 at org.jboss.netty.channel.DefaultChannelPipeline$DefaultChannelHandlerContext.sendDownstream(DefaultChannelPipeline.java:784) 58 at org.jboss.netty.channel.SimpleChannelHandler.writeRequested(SimpleChannelHandler.java:292) 59 at com.alibaba.dubbo.remoting.transport.netty.NettyHandler.writeRequested(NettyHandler.java:99) 60 at org.jboss.netty.channel.SimpleChannelHandler.handleDownstream(SimpleChannelHandler.java:254) 61 at org.jboss.netty.channel.DefaultChannelPipeline.sendDownstream(DefaultChannelPipeline.java:591) 62 at org.jboss.netty.channel.DefaultChannelPipeline.sendDownstream(DefaultChannelPipeline.java:582) 63 at org.jboss.netty.channel.Channels.write(Channels.java:704) 64 at org.jboss.netty.channel.Channels.write(Channels.java:671) 65 at org.jboss.netty.channel.AbstractChannel.write(AbstractChannel.java:248) 66 at com.alibaba.dubbo.remoting.transport.netty.NettyChannel.send(NettyChannel.java:98) 67 at com.alibaba.dubbo.remoting.transport.AbstractPeer.send(AbstractPeer.java:51) 68 at com.alibaba.dubbo.remoting.exchange.support.header.HeaderExchangeHandler.received(HeaderExchangeHandler.java:171) 69 at com.alibaba.dubbo.remoting.transport.DecodeHandler.received(DecodeHandler.java:52) 70 at com.alibaba.dubbo.remoting.transport.dispatcher.ChannelEventRunnable.run(ChannelEventRunnable.java:82) 71 at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) 72 at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) 73 at java.lang.Thread.run(Thread.java:745) 74 ] with root cause 75 com.alibaba.dubbo.remoting.RemotingException: Failed to send response: Response [id=2, version=2.0.0, status=20, event=false, error=null, result=RpcResult [result=com.taotao.pojo.TbItem@2e3ba04a, exception=null]], cause: java.lang.IllegalStateException: Serialized class com.taotao.pojo.TbItem must implement java.io.Serializable 76 java.lang.IllegalStateException: Serialized class com.taotao.pojo.TbItem must implement java.io.Serializable 77 at com.alibaba.com.caucho.hessian.io.SerializerFactory.getDefaultSerializer(SerializerFactory.java:261) 78 at com.alibaba.com.caucho.hessian.io.SerializerFactory.getSerializer(SerializerFactory.java:233) 79 at com.alibaba.com.caucho.hessian.io.Hessian2Output.writeObject(Hessian2Output.java:406) 80 at com.alibaba.dubbo.common.serialize.support.hessian.Hessian2ObjectOutput.writeObject(Hessian2ObjectOutput.java:92) 81 at com.alibaba.dubbo.rpc.protocol.dubbo.DubboCodec.encodeResponseData(DubboCodec.java:200) 82 at com.alibaba.dubbo.remoting.exchange.codec.ExchangeCodec.encodeResponse(ExchangeCodec.java:276) 83 at com.alibaba.dubbo.remoting.exchange.codec.ExchangeCodec.encode(ExchangeCodec.java:77) 84 at com.alibaba.dubbo.rpc.protocol.dubbo.DubboCountCodec.encode(DubboCountCodec.java:39) 85 at com.alibaba.dubbo.remoting.transport.netty.NettyCodecAdapter$InternalEncoder.encode(NettyCodecAdapter.java:81) 86 at org.jboss.netty.handler.codec.oneone.OneToOneEncoder.doEncode(OneToOneEncoder.java:66) 87 at org.jboss.netty.handler.codec.oneone.OneToOneEncoder.handleDownstream(OneToOneEncoder.java:59) 88 at org.jboss.netty.channel.DefaultChannelPipeline.sendDownstream(DefaultChannelPipeline.java:591) 89 at org.jboss.netty.channel.DefaultChannelPipeline$DefaultChannelHandlerContext.sendDownstream(DefaultChannelPipeline.java:784) 90 at org.jboss.netty.channel.SimpleChannelHandler.writeRequested(SimpleChannelHandler.java:292) 91 at com.alibaba.dubbo.remoting.transport.netty.NettyHandler.writeRequested(NettyHandler.java:99) 92 at org.jboss.netty.channel.SimpleChannelHandler.handleDownstream(SimpleChannelHandler.java:254) 93 at org.jboss.netty.channel.DefaultChannelPipeline.sendDownstream(DefaultChannelPipeline.java:591) 94 at org.jboss.netty.channel.DefaultChannelPipeline.sendDownstream(DefaultChannelPipeline.java:582) 95 at org.jboss.netty.channel.Channels.write(Channels.java:704) 96 at org.jboss.netty.channel.Channels.write(Channels.java:671) 97 at org.jboss.netty.channel.AbstractChannel.write(AbstractChannel.java:248) 98 at com.alibaba.dubbo.remoting.transport.netty.NettyChannel.send(NettyChannel.java:98) 99 at com.alibaba.dubbo.remoting.transport.AbstractPeer.send(AbstractPeer.java:51) 100 at com.alibaba.dubbo.remoting.exchange.support.header.HeaderExchangeHandler.received(HeaderExchangeHandler.java:171) 101 at com.alibaba.dubbo.remoting.transport.DecodeHandler.received(DecodeHandler.java:52) 102 at com.alibaba.dubbo.remoting.transport.dispatcher.ChannelEventRunnable.run(ChannelEventRunnable.java:82) 103 at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) 104 at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) 105 at java.lang.Thread.run(Thread.java:745) 106 107 at com.alibaba.dubbo.remoting.exchange.support.DefaultFuture.returnFromResponse(DefaultFuture.java:190) 108 at com.alibaba.dubbo.remoting.exchange.support.DefaultFuture.get(DefaultFuture.java:110) 109 at com.alibaba.dubbo.remoting.exchange.support.DefaultFuture.get(DefaultFuture.java:84) 110 at com.alibaba.dubbo.rpc.protocol.dubbo.DubboInvoker.doInvoke(DubboInvoker.java:96) 111 at com.alibaba.dubbo.rpc.protocol.AbstractInvoker.invoke(AbstractInvoker.java:144) 112 at com.alibaba.dubbo.rpc.listener.ListenerInvokerWrapper.invoke(ListenerInvokerWrapper.java:74) 113 at com.alibaba.dubbo.rpc.protocol.dubbo.filter.FutureFilter.invoke(FutureFilter.java:53) 114 at com.alibaba.dubbo.rpc.protocol.ProtocolFilterWrapper$1.invoke(ProtocolFilterWrapper.java:91) 115 at com.alibaba.dubbo.monitor.support.MonitorFilter.invoke(MonitorFilter.java:75) 116 at com.alibaba.dubbo.rpc.protocol.ProtocolFilterWrapper$1.invoke(ProtocolFilterWrapper.java:91) 117 at com.alibaba.dubbo.rpc.filter.ConsumerContextFilter.invoke(ConsumerContextFilter.java:48) 118 at com.alibaba.dubbo.rpc.protocol.ProtocolFilterWrapper$1.invoke(ProtocolFilterWrapper.java:91) 119 at com.alibaba.dubbo.rpc.protocol.InvokerWrapper.invoke(InvokerWrapper.java:53) 120 at com.alibaba.dubbo.rpc.cluster.support.FailoverClusterInvoker.doInvoke(FailoverClusterInvoker.java:77) 121 at com.alibaba.dubbo.rpc.cluster.support.AbstractClusterInvoker.invoke(AbstractClusterInvoker.java:227) 122 at com.alibaba.dubbo.rpc.cluster.support.wrapper.MockClusterInvoker.invoke(MockClusterInvoker.java:72) 123 at com.alibaba.dubbo.rpc.proxy.InvokerInvocationHandler.invoke(InvokerInvocationHandler.java:52) 124 at com.alibaba.dubbo.common.bytecode.proxy0.getItemById(proxy0.java) 125 at com.taotao.controller.ItemController.getItemById(ItemController.java:28) 126 at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) 127 at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) 128 at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) 129 at java.lang.reflect.Method.invoke(Method.java:606) 130 at org.springframework.web.method.support.InvocableHandlerMethod.doInvoke(InvocableHandlerMethod.java:222) 131 at org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:137) 132 at org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:110) 133 at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandlerMethod(RequestMappingHandlerAdapter.java:814) 134 at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:737) 135 at org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:85) 136 at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:959) 137 at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:893) 138 at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:969) 139 at org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:860) 140 at javax.servlet.http.HttpServlet.service(HttpServlet.java:621) 141 at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:845) 142 at javax.servlet.http.HttpServlet.service(HttpServlet.java:728) 143 at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:305) 144 at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210) 145 at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:51) 146 at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243) 147 at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210) 148 at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:121) 149 at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107) 150 at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243) 151 at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210) 152 at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:222) 153 at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:123) 154 at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:502) 155 at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:171) 156 at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:100) 157 at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:953) 158 at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118) 159 at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:408) 160 at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1041) 161 at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:603) 162 at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:310) 163 at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) 164 at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) 165 at java.lang.Thread.run(Thread.java:745)
报这种序列号的错误,是实体类必须实现序列化接口,将查询出的数据必须进行序列化,才可以进行传输。将服务层的序列化的数据传递给表现层(客户端),然后表现层进行反序列化即可。里面的实体类,除了example的都实现序列化即可。
由于表现层在表现层可能会用到,所以将pojo安装一下。就可以了。
最后重启dubbo的提供服务,然后重启dubbo的引用服务。终于出现数据了。
10、dubbo的监控中心。dubbo-admin-2.5.4.war项目包运行起来就可以监控了。和安装zookeeper的机器放到一起就可以直接起到监控效果了。
安装你的tomcat。然后将dubbo的war包部署到tomcat里面即可。
[root@localhost package]# tar -zxvf apache-tomcat-7.0.47.tar.gz -C /home/hadoop/soft/
将dubbo的war包部署到tomcat的webapps里面即可。
[root@localhost soft]# cp dubbo-admin-2.5.4.war apache-tomcat-7.0.47/webapps/dubbo-admin.war
然后启动你的tomcat。
1 [root@localhost apache-tomcat-7.0.47]# bin/startup.sh 2 Using CATALINA_BASE: /home/hadoop/soft/apache-tomcat-7.0.47 3 Using CATALINA_HOME: /home/hadoop/soft/apache-tomcat-7.0.47 4 Using CATALINA_TMPDIR: /home/hadoop/soft/apache-tomcat-7.0.47/temp 5 Using JRE_HOME: /home/hadoop/soft/jdk1.7.0_55 6 Using CLASSPATH: /home/hadoop/soft/apache-tomcat-7.0.47/bin/bootstrap.jar:/home/hadoop/soft/apache-tomcat-7.0.47/bin/tomcat-juli.jar 7 [root@localhost apache-tomcat-7.0.47]# tail -f logs/catalina.out 8 INFO rule.DirectModuleMappingRule - Initialized screen.notemplate:DirectModuleMappingRule with cache disabled 9 INFO rule.FallbackModuleMappingRule - Initialized screen:FallbackModuleMappingRule with cache enabled 10 INFO rule.DirectTemplateMappingRule - Initialized screen.template:DirectTemplateMappingRule with cache disabled 11 INFO rule.FallbackTemplateMappingRule - Initialized layout.template:FallbackTemplateMappingRule with cache enabled 12 INFO rule.DirectModuleMappingRule - Initialized control.notemplate:DirectModuleMappingRule with cache disabled 13 INFO rule.FallbackModuleMappingRule - Initialized control:FallbackModuleMappingRule with cache enabled 14 INFO rule.DirectTemplateMappingRule - Initialized control.template:DirectTemplateMappingRule with cache disabled 15 INFO pull.PullService - Initialized pull service [key=PullService.pullService.1] with 16 pre-pulled tools, 9 pre-queued tools and 0 runtime tools 16 INFO context.WebxComponentsLoader - Initializing Spring sub WebApplicationContext: personal 17 INFO context.WebxComponentContext - Refreshing com.alibaba.citrus.webx.context.WebxComponentContext@1ae1c93: display name [WebApplicationContext for namespace 'personal']; startup date [Mon Aug 05 06:14:44 PDT 2019]; parent: com.alibaba.citrus.webx.context.WebxComponentsContext@a67e6c 18 INFO xml.XmlBeanDefinitionReader - Loading XML bean definitions from Resource[WEB-INF/webx-personal.xml, loaded by ResourceLoadingService] 19 INFO xml.XmlBeanDefinitionReader - Loading XML bean definitions from Resource[WEB-INF/common/webx-component-and-root.xml, loaded by ResourceLoadingService] 20 INFO xml.XmlBeanDefinitionReader - Loading XML bean definitions from Resource[WEB-INF/common/webx-component.xml, loaded by ResourceLoadingService] 21 INFO xml.XmlBeanDefinitionReader - Loading XML bean definitions from Resource[WEB-INF/common/pipeline.xml, loaded by ResourceLoadingService] 22 INFO context.WebxComponentContext - Bean factory for application context [com.alibaba.citrus.webx.context.WebxComponentContext@1ae1c93]: com.alibaba.citrus.springext.support.context.InheritableListableBeanFactory@1503e40 23 INFO context.WebxComponentContext - Bean '(inner bean)' is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying) 24 INFO context.WebxComponentContext - Bean '(inner bean)#1' is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying) 25 INFO config.WebxConfiguration - Application is running in Production Mode. 26 INFO context.WebxComponentContext - Bean 'webxConfiguration' is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying) 27 INFO context.WebxComponentContext - Bean '(inner bean)' is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying) 28 INFO context.InheritableListableBeanFactory - Pre-instantiating singletons in com.alibaba.citrus.springext.support.context.InheritableListableBeanFactory@1503e40: defining beans [org.springframework.context.annotation.internalCommonAnnotationProcessor,org.springframework.context.annotation.internalAutowiredAnnotationProcessor,org.springframework.context.annotation.internalRequiredAnnotationProcessor,com.alibaba.citrus.service.configuration.support.PropertyPlaceholderConfigurer#0,templateService,mappingRuleService,dataResolverService,productionModeSensiblePostProcessor,webxConfiguration,pullService,pipeline,module.screen.Passwds,module.screen.Infos,moduleLoaderService]; parent: com.alibaba.citrus.springext.support.context.InheritableListableBeanFactory@714919 29 INFO velocity.VelocityEngine - SpringResourceLoaderAdapter : initialization starting. 30 INFO velocity.VelocityEngine - SpringResourceLoaderAdapter : set path '/templates/personal/' 31 INFO velocity.VelocityEngine - SpringResourceLoaderAdapter : initialization complete. 32 INFO rule.ExtensionMappingRule - Initialized extension.input:ExtensionMappingRule with cache disabled 33 INFO rule.ExtensionMappingRule - Initialized extension.output:ExtensionMappingRule with cache disabled 34 INFO rule.DirectModuleMappingRule - Initialized action:DirectModuleMappingRule with cache disabled 35 INFO rule.DirectModuleMappingRule - Initialized screen.notemplate:DirectModuleMappingRule with cache disabled 36 INFO rule.FallbackModuleMappingRule - Initialized screen:FallbackModuleMappingRule with cache enabled 37 INFO rule.DirectTemplateMappingRule - Initialized screen.template:DirectTemplateMappingRule with cache disabled 38 INFO rule.FallbackTemplateMappingRule - Initialized layout.template:FallbackTemplateMappingRule with cache enabled 39 INFO rule.DirectModuleMappingRule - Initialized control.notemplate:DirectModuleMappingRule with cache disabled 40 INFO rule.FallbackModuleMappingRule - Initialized control:FallbackModuleMappingRule with cache enabled 41 INFO rule.DirectTemplateMappingRule - Initialized control.template:DirectTemplateMappingRule with cache disabled 42 INFO pull.PullService - Initialized pull service [key=PullService.pullService.2] with 16 pre-pulled tools, 9 pre-queued tools and 0 runtime tools 43 INFO context.WebxComponentsLoader - Initializing Spring sub WebApplicationContext: sysmanage 44 INFO context.WebxComponentContext - Refreshing com.alibaba.citrus.webx.context.WebxComponentContext@1beed3d: display name [WebApplicationContext for namespace 'sysmanage']; startup date [Mon Aug 05 06:14:45 PDT 2019]; parent: com.alibaba.citrus.webx.context.WebxComponentsContext@a67e6c 45 INFO xml.XmlBeanDefinitionReader - Loading XML bean definitions from Resource[WEB-INF/webx-sysmanage.xml, loaded by ResourceLoadingService] 46 INFO xml.XmlBeanDefinitionReader - Loading XML bean definitions from Resource[WEB-INF/common/webx-component-and-root.xml, loaded by ResourceLoadingService] 47 INFO xml.XmlBeanDefinitionReader - Loading XML bean definitions from Resource[WEB-INF/common/webx-component.xml, loaded by ResourceLoadingService] 48 INFO xml.XmlBeanDefinitionReader - Loading XML bean definitions from Resource[WEB-INF/common/pipeline.xml, loaded by ResourceLoadingService] 49 INFO context.WebxComponentContext - Bean factory for application context [com.alibaba.citrus.webx.context.WebxComponentContext@1beed3d]: com.alibaba.citrus.springext.support.context.InheritableListableBeanFactory@14f00e1 50 INFO context.WebxComponentContext - Bean '(inner bean)' is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying) 51 INFO context.WebxComponentContext - Bean '(inner bean)#1' is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying) 52 INFO config.WebxConfiguration - Application is running in Production Mode. 53 INFO context.WebxComponentContext - Bean 'webxConfiguration' is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying) 54 INFO context.WebxComponentContext - Bean '(inner bean)' is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying) 55 INFO context.InheritableListableBeanFactory - Pre-instantiating singletons in com.alibaba.citrus.springext.support.context.InheritableListableBeanFactory@14f00e1: defining beans [org.springframework.context.annotation.internalCommonAnnotationProcessor,org.springframework.context.annotation.internalAutowiredAnnotationProcessor,org.springframework.context.annotation.internalRequiredAnnotationProcessor,com.alibaba.citrus.service.configuration.support.PropertyPlaceholderConfigurer#0,templateService,mappingRuleService,dataResolverService,productionModeSensiblePostProcessor,webxConfiguration,pullService,pipeline,module.screen.Privileges,module.screen.Userown,module.screen.Configs,moduleLoaderService]; parent: com.alibaba.citrus.springext.support.context.InheritableListableBeanFactory@714919 56 INFO velocity.VelocityEngine - SpringResourceLoaderAdapter : initialization starting. 57 INFO velocity.VelocityEngine - SpringResourceLoaderAdapter : set path '/templates/sysmanage/' 58 INFO velocity.VelocityEngine - SpringResourceLoaderAdapter : initialization complete. 59 INFO rule.ExtensionMappingRule - Initialized extension.input:ExtensionMappingRule with cache disabled 60 INFO rule.ExtensionMappingRule - Initialized extension.output:ExtensionMappingRule with cache disabled 61 INFO rule.DirectModuleMappingRule - Initialized action:DirectModuleMappingRule with cache disabled 62 INFO rule.DirectModuleMappingRule - Initialized screen.notemplate:DirectModuleMappingRule with cache disabled 63 INFO rule.FallbackModuleMappingRule - Initialized screen:FallbackModuleMappingRule with cache enabled 64 INFO rule.DirectTemplateMappingRule - Initialized screen.template:DirectTemplateMappingRule with cache disabled 65 INFO rule.FallbackTemplateMappingRule - Initialized layout.template:FallbackTemplateMappingRule with cache enabled 66 INFO rule.DirectModuleMappingRule - Initialized control.notemplate:DirectModuleMappingRule with cache disabled 67 INFO rule.FallbackModuleMappingRule - Initialized control:FallbackModuleMappingRule with cache enabled 68 INFO rule.DirectTemplateMappingRule - Initialized control.template:DirectTemplateMappingRule with cache disabled 69 INFO pull.PullService - Initialized pull service [key=PullService.pullService.3] with 16 pre-pulled tools, 9 pre-queued tools and 0 runtime tools 70 INFO context.WebxComponentsLoader - Initializing Spring sub WebApplicationContext: sysinfo 71 INFO context.WebxComponentContext - Refreshing com.alibaba.citrus.webx.context.WebxComponentContext@1d63340: display name [WebApplicationContext for namespace 'sysinfo']; startup date [Mon Aug 05 06:14:46 PDT 2019]; parent: com.alibaba.citrus.webx.context.WebxComponentsContext@a67e6c 72 INFO xml.XmlBeanDefinitionReader - Loading XML bean definitions from Resource[WEB-INF/webx-sysinfo.xml, loaded by ResourceLoadingService] 73 INFO xml.XmlBeanDefinitionReader - Loading XML bean definitions from Resource[WEB-INF/common/webx-component-and-root.xml, loaded by ResourceLoadingService] 74 INFO xml.XmlBeanDefinitionReader - Loading XML bean definitions from Resource[WEB-INF/common/webx-component.xml, loaded by ResourceLoadingService] 75 INFO xml.XmlBeanDefinitionReader - Loading XML bean definitions from Resource[WEB-INF/common/pipeline.xml, loaded by ResourceLoadingService] 76 INFO context.WebxComponentContext - Bean factory for application context [com.alibaba.citrus.webx.context.WebxComponentContext@1d63340]: com.alibaba.citrus.springext.support.context.InheritableListableBeanFactory@d2ea9c 77 INFO context.WebxComponentContext - Bean '(inner bean)' is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying) 78 INFO context.WebxComponentContext - Bean '(inner bean)#1' is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying) 79 INFO config.WebxConfiguration - Application is running in Production Mode. 80 INFO context.WebxComponentContext - Bean 'webxConfiguration' is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying) 81 INFO context.WebxComponentContext - Bean '(inner bean)' is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying) 82 INFO context.InheritableListableBeanFactory - Pre-instantiating singletons in com.alibaba.citrus.springext.support.context.InheritableListableBeanFactory@d2ea9c: defining beans [org.springframework.context.annotation.internalCommonAnnotationProcessor,org.springframework.context.annotation.internalAutowiredAnnotationProcessor,org.springframework.context.annotation.internalRequiredAnnotationProcessor,com.alibaba.citrus.service.configuration.support.PropertyPlaceholderConfigurer#0,templateService,mappingRuleService,dataResolverService,productionModeSensiblePostProcessor,webxConfiguration,pullService,pipeline,module.screen.Dumps,module.screen.Dump,module.screen.Versions,module.screen.Envs,module.screen.Statuses,module.screen.Logs,moduleLoaderService]; parent: com.alibaba.citrus.springext.support.context.InheritableListableBeanFactory@714919 83 INFO velocity.VelocityEngine - SpringResourceLoaderAdapter : initialization starting. 84 INFO velocity.VelocityEngine - SpringResourceLoaderAdapter : set path '/templates/sysinfo/' 85 INFO velocity.VelocityEngine - SpringResourceLoaderAdapter : initialization complete. 86 INFO rule.ExtensionMappingRule - Initialized extension.input:ExtensionMappingRule with cache disabled 87 INFO rule.ExtensionMappingRule - Initialized extension.output:ExtensionMappingRule with cache disabled 88 INFO rule.DirectModuleMappingRule - Initialized action:DirectModuleMappingRule with cache disabled 89 INFO rule.DirectModuleMappingRule - Initialized screen.notemplate:DirectModuleMappingRule with cache disabled 90 INFO rule.FallbackModuleMappingRule - Initialized screen:FallbackModuleMappingRule with cache enabled 91 INFO rule.DirectTemplateMappingRule - Initialized screen.template:DirectTemplateMappingRule with cache disabled 92 INFO rule.FallbackTemplateMappingRule - Initialized layout.template:FallbackTemplateMappingRule with cache enabled 93 INFO rule.DirectModuleMappingRule - Initialized control.notemplate:DirectModuleMappingRule with cache disabled 94 INFO rule.FallbackModuleMappingRule - Initialized control:FallbackModuleMappingRule with cache enabled 95 INFO rule.DirectTemplateMappingRule - Initialized control.template:DirectTemplateMappingRule with cache disabled 96 INFO pull.PullService - Initialized pull service [key=PullService.pullService.4] with 16 pre-pulled tools, 9 pre-queued tools and 0 runtime tools 97 INFO context.WebxComponentsLoader - Initializing Spring sub WebApplicationContext: governance 98 INFO context.WebxComponentContext - Refreshing com.alibaba.citrus.webx.context.WebxComponentContext@9c11b8: display name [WebApplicationContext for namespace 'governance']; startup date [Mon Aug 05 06:14:48 PDT 2019]; parent: com.alibaba.citrus.webx.context.WebxComponentsContext@a67e6c 99 INFO xml.XmlBeanDefinitionReader - Loading XML bean definitions from Resource[WEB-INF/webx-governance.xml, loaded by ResourceLoadingService] 100 INFO xml.XmlBeanDefinitionReader - Loading XML bean definitions from Resource[WEB-INF/common/webx-component-and-root.xml, loaded by ResourceLoadingService] 101 INFO xml.XmlBeanDefinitionReader - Loading XML bean definitions from Resource[WEB-INF/common/webx-component.xml, loaded by ResourceLoadingService] 102 INFO xml.XmlBeanDefinitionReader - Loading XML bean definitions from Resource[WEB-INF/common/pipeline.xml, loaded by ResourceLoadingService] 103 INFO context.WebxComponentContext - Bean factory for application context [com.alibaba.citrus.webx.context.WebxComponentContext@9c11b8]: com.alibaba.citrus.springext.support.context.InheritableListableBeanFactory@f87b16 104 INFO context.WebxComponentContext - Bean '(inner bean)' is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying) 105 INFO context.WebxComponentContext - Bean '(inner bean)#1' is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying) 106 INFO config.WebxConfiguration - Application is running in Production Mode. 107 INFO context.WebxComponentContext - Bean 'webxConfiguration' is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying) 108 INFO context.WebxComponentContext - Bean '(inner bean)' is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying) 109 INFO context.InheritableListableBeanFactory - Pre-instantiating singletons in com.alibaba.citrus.springext.support.context.InheritableListableBeanFactory@f87b16: defining beans [org.springframework.context.annotation.internalCommonAnnotationProcessor,org.springframework.context.annotation.internalAutowiredAnnotationProcessor,org.springframework.context.annotation.internalRequiredAnnotationProcessor,com.alibaba.citrus.service.configuration.support.PropertyPlaceholderConfigurer#0,pullService,templateService,mappingRuleService,dataResolverService,productionModeSensiblePostProcessor,webxConfiguration,pullService#0,pipeline,module.screen.Loadbalances,module.screen.NoServicePrivilege,module.screen.Applications,module.screen.Overrides,module.screen.Accesses,module.screen.Weights,module.screen.Services,module.screen.Routes,module.screen.Owners,module.screen.Addresses,module.screen.Providers,module.screen.Consumers,moduleLoaderService]; parent: com.alibaba.citrus.springext.support.context.InheritableListableBeanFactory@714919 110 INFO pull.PullService - Initialized pull service [key=PullService.pullService.5] with 1 pre-pulled tools, 2 pre-queued tools and 0 runtime tools 111 INFO velocity.VelocityEngine - SpringResourceLoaderAdapter : initialization starting. 112 INFO velocity.VelocityEngine - SpringResourceLoaderAdapter : set path '/templates/governance/' 113 INFO velocity.VelocityEngine - SpringResourceLoaderAdapter : initialization complete. 114 INFO rule.ExtensionMappingRule - Initialized extension.input:ExtensionMappingRule with cache disabled 115 INFO rule.ExtensionMappingRule - Initialized extension.output:ExtensionMappingRule with cache disabled 116 INFO rule.DirectModuleMappingRule - Initialized action:DirectModuleMappingRule with cache disabled 117 INFO rule.DirectModuleMappingRule - Initialized screen.notemplate:DirectModuleMappingRule with cache disabled 118 INFO rule.FallbackModuleMappingRule - Initialized screen:FallbackModuleMappingRule with cache enabled 119 INFO rule.DirectTemplateMappingRule - Initialized screen.template:DirectTemplateMappingRule with cache disabled 120 INFO rule.FallbackTemplateMappingRule - Initialized layout.template:FallbackTemplateMappingRule with cache enabled 121 INFO rule.DirectModuleMappingRule - Initialized control.notemplate:DirectModuleMappingRule with cache disabled 122 INFO rule.FallbackModuleMappingRule - Initialized control:FallbackModuleMappingRule with cache enabled 123 INFO rule.DirectTemplateMappingRule - Initialized control.template:DirectTemplateMappingRule with cache disabled 124 INFO pull.PullService - Initialized pull service [key=PullService.pullService#0.6] with 16 pre-pulled tools, 9 pre-queued tools and 0 runtime tools 125 INFO context.WebxComponentsLoader - WebxComponents: initialization completed 126 INFO context.ContextLoader - Root WebApplicationContext: initialization completed in 12891 ms 127 INFO servlet.SetLoggingContextFilter - Initializing filter: mdc 128 INFO servlet.SetLoggingContextFilter - SetLoggingContextFilter - mdc: initialization completed 129 INFO servlet.WebxFrameworkFilter - Initializing filter: webx 130 INFO servlet.WebxFrameworkFilter - WebxFrameworkFilter - webx: initialization completed 131 Aug 05, 2019 6:14:50 AM org.apache.catalina.startup.HostConfig deployDirectory 132 INFO: Deploying web application directory /home/hadoop/soft/apache-tomcat-7.0.47/webapps/manager 133 Aug 05, 2019 6:14:50 AM org.apache.catalina.startup.HostConfig deployDirectory 134 INFO: Deploying web application directory /home/hadoop/soft/apache-tomcat-7.0.47/webapps/ROOT 135 Aug 05, 2019 6:14:50 AM org.apache.catalina.startup.HostConfig deployDirectory 136 INFO: Deploying web application directory /home/hadoop/soft/apache-tomcat-7.0.47/webapps/examples 137 Aug 05, 2019 6:14:50 AM org.apache.catalina.startup.HostConfig deployDirectory 138 INFO: Deploying web application directory /home/hadoop/soft/apache-tomcat-7.0.47/webapps/host-manager 139 Aug 05, 2019 6:14:50 AM org.apache.catalina.startup.HostConfig deployDirectory 140 INFO: Deploying web application directory /home/hadoop/soft/apache-tomcat-7.0.47/webapps/docs 141 Aug 05, 2019 6:14:50 AM org.apache.coyote.AbstractProtocol start 142 INFO: Starting ProtocolHandler ["http-bio-8080"] 143 Aug 05, 2019 6:14:50 AM org.apache.coyote.AbstractProtocol start 144 INFO: Starting ProtocolHandler ["ajp-bio-8009"] 145 Aug 05, 2019 6:14:50 AM org.apache.catalina.startup.Catalina start 146 INFO: Server startup in 18150 ms
然后可以查看页面进行访问。账号和密码都是root。ip地址就是你的虚拟机部署dubbo包的地址。端口默认是8080。
登录进去就可以看到一些dubbo提供的服务了。
如果dubbo的war包和zookeeer不在一台机器上面,需要修改此配置文件。
待续......