dubbo入门学习
官方网址:http://dubbo.apache.org/zh-cn/index.html
学习可以参考官网中文文档:http://dubbo.apache.org/zh-cn/docs/user/quick-start.html
SOA,英文名称(Service Oriented Ambiguity),中文名称:面向服务架构(有一个专门提供服务单元,其他所有单元都调用这个服务)。SOA专门访问数据库服务(项目),开发时可以实现,数据访问控制和代码复用。
实现SOA架构时,常用服务:
a、Dubbo 做为服务。
b、WebService 做为服务。
c、Dubbox 做为服务。
d、服务方就是web项目,调用web项目的控制器。
使用HttpClient可以调用其他项目的控制器。
RPC,英文名称(Remote Procedure Call Protocol),中文名称:远程过程调用协议,RPC解析:客户端(A)通过互联网调用远程服务器,不知道远程服务器具体实现,只知道远程服务器提供了什么功能。RPC最大优点,数据安全性。
1、Apache Dubbo是一款高性能、轻量级的开源Java RPC框架,它提供了三大核心能力:面向接口的远程方法调用,智能容错和负载均衡,以及服务自动注册和发现。Dubbo一个分布式、高性能、透明化的RPC服务框架。作用是,提供服务自动注册、自动发现等高效服务治理方案
如果项目表现层、服务层是不同的项目,可以使用dubbo实现两个系统之间的通信。服务层和表现层相互通信,使用dubbo中间件,让表现层调用服务层。工程之间的相互通信可以使用dubbo,,可以统一管理服务,系统之间的调用。
如何实现远程通信。
、Webservice,效率不高,基于soap协议,项目中不推荐使用。
、使用restful形式的服务,http+json,很多项目中应用。如果服务太多,服务之间的调用关系混乱,需要治疗服务。
、dubbo,使用rpc协议进行远程调用,直接使用socket通信,传输效率高,并且可以统计出系统之间的调用关系,调用次数。缺点,由于是java开发,只能是两个java项目进行调度。
2、dubbo架构。术语来自官网。可以直接查看官网。
虚线都是异步访问,实线都是同步访问。
蓝色虚线:在启动时完成的功能。
红色虚线(实线)都是程序运行过程中执行的功能。
所有的角色都是可以在单独的服务器上.所以必须遵守特定的协议。
节点角色说明
节点 | 角色说明 |
---|---|
Provider |
暴露服务的服务提供方,提供者,服务发布方 |
Consumer |
调用远程服务的服务消费方,消费者, 调用服务方 |
Registry |
服务注册与发现的注册中心,注册中心.当Container启动时把所有可以提供的服务列表上Registry中进行注册,作用:告诉Consumer提供了什么服务和服务方在哪里 |
Monitor |
统计服务的调用次数和调用时间的监控中心,监听器 |
Container |
服务运行容器,Dubbo容器.依赖于Spring容器 |
调用关系说明
- 服务容器负责启动,加载,运行服务提供者。
- 服务提供者在启动时,向注册中心注册自己提供的服务。
- 服务消费者在启动时,向注册中心订阅自己所需的服务。
- 注册中心返回服务提供者地址列表给消费者,如果有变更,注册中心将基于长连接推送变更数据给消费者。
- 服务消费者,从提供者地址列表中,基于软负载均衡算法,选一台提供者进行调用,如果调用失败,再选另一台调用。
- 服务消费者和提供者,在内存中累计调用次数和调用时间,定时每分钟发送一次统计数据到监控中心。
Dubbo 架构具有以下几个特点,分别是连通性、健壮性、伸缩性、以及向未来架构的升级性。
. Dubbo运行原理:
2.0 启动容器,相当于在启动Dubbo的Provider
2.1 启动后会去注册中心进行注册.注册所有可以提供的服务列表
2.2 在Consumer启动后会去Registry中获取服务列表和Provider的地址.进行订阅.
2.3 当Provider有修改后,注册中心会把消息推送给Consummer
2.3. 使用了观察者设计模式(又叫发布/订阅设计模式)
2.4 根据获取到的Provider地址,真实调用Provider中功能.
2.4. 在Consumer方使用了代理设计模式.创建一个Provider方类的一个代理对象.通过代理对象获取Provider中真实功能,起到保护Provider真实功能的作用.
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
export JAVA_HOME=/home/hadoop/soft/jdk1..0_55
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。进行验证是否可以正常启动。
[root@localhost bin]# ./zkServer.sh start
JMX enabled by default
Using config: /home/hadoop/soft/zookeeper-3.4./bin/../conf/zoo.cfg
Starting zookeeper ... STARTED
[root@localhost bin]# ./zkServer.sh status
JMX enabled by default
Using config: /home/hadoop/soft/zookeeper-3.4./bin/../conf/zoo.cfg
Mode: standalone
[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服务。定义一个接口。
package com.taotao.service; import com.taotao.pojo.TbItem; /**
*
* @ClassName: ItemService.java
* @author: biehl
* @since: 2019年8月2日 下午3:32:36
* @Copyright: ©2019 biehl 版权所有
* @version: 0.0.1
* @Description:商品接口类
*
*/
public interface ItemService { /**
* 根据itemId查询出商品信息
*
* @param itemId
* @return
*/
public TbItem getItemById(long itemId); }
定义实现接口的实现类。
package com.taotao.service.impl; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.util.StringUtils; import com.taotao.mapper.TbItemMapper;
import com.taotao.pojo.TbItem;
import com.taotao.service.ItemService; /**
*
* @ClassName: ItemServiceImpl.java
* @author: biehl
* @since: 2019年8月2日 下午3:51:24
* @Copyright: ©2019 biehl 版权所有
* @version: 0.0.1
* @Description: 商品实现类
*/
@Service
public class ItemServiceImpl implements ItemService { @Autowired
private TbItemMapper tbItemMapper; @Override
public TbItem getItemById(long itemId) {
TbItem tbItem = new TbItem();
if (!StringUtils.isEmpty(itemId)) {
tbItem = tbItemMapper.selectByPrimaryKey(itemId);
}
// 返回信息以后就可以发布服务
return tbItem;
} }
配置提供dubbo的服务。
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:context="http://www.springframework.org/schema/context"
xmlns:p="http://www.springframework.org/schema/p"
xmlns:aop="http://www.springframework.org/schema/aop"
xmlns:tx="http://www.springframework.org/schema/tx"
xmlns:dubbo="http://code.alibabatech.com/schema/dubbo"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-4.2.xsd
http://www.springframework.org/schema/context
http://www.springframework.org/schema/context/spring-context-4.2.xsd
http://www.springframework.org/schema/aop
http://www.springframework.org/schema/aop/spring-aop-4.2.xsd
http://www.springframework.org/schema/tx
http://www.springframework.org/schema/tx/spring-tx-4.2.xsd
http://code.alibabatech.com/schema/dubbo
http://code.alibabatech.com/schema/dubbo/dubbo.xsd
http://www.springframework.org/schema/util
http://www.springframework.org/schema/util/spring-util-4.2.xsd"> <!-- 、配置包扫描器,扫描所有带@Service注解的类,將創建的對象放到Spring容器中 -->
<!-- 也可以将子包扫描进去 -->
<!-- 将扫描com.taotao.service、com.taotao.service.impl -->
<context:component-scan
base-package="com.taotao.service"></context:component-scan> <!-- 配置spring的事务,单独提取出来 --> <!-- 发布dubbo服务 -->
<!-- 提供方应用信息,用于计算依赖关系 -->
<dubbo:application name="taotao-manager" />
<!-- 注册中心的地址 -->
<dubbo:registry protocol="zookeeper" address="192.168.110.140:2181" />
<!-- 用dubbo协议在20880端口暴露服务 -->
<dubbo:protocol name="dubbo" port="" />
<!-- 声明需要暴露的服务接口 -->
<!-- ref="itemServiceImpl"就是扫描service的时候,注入到容器的bean -->
<dubbo:service interface="com.taotao.service.ItemService" ref="itemServiceImpl" timeout="" />
<!-- <dubbo:service interface="com.taotao.service.ItemCatService" ref="itemCatServiceImpl" timeout="" /> --> </beans>
如图所示:
8、在表现层引用dubbo的服务。提供方和引用方都需要引入dubbo的jar包哦。
<!-- dubbo相关 -->
<dependency>
<groupId>com.alibaba</groupId>
<artifactId>dubbo</artifactId>
<!-- 排除spring的2..6版本,netty3..5版本,避免冲突 -->
<exclusions>
<exclusion>
<groupId>org.springframework</groupId>
<artifactId>spring</artifactId>
</exclusion>
<exclusion>
<groupId>org.jboss.netty</groupId>
<artifactId>netty</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.apache.zookeeper</groupId>
<artifactId>zookeeper</artifactId>
</dependency>
<dependency>
<groupId>com.github.sgroschupf</groupId>
<artifactId>zkclient</artifactId>
</dependency>
配置一下引用方的配置。
<?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:p="http://www.springframework.org/schema/p"
xmlns:context="http://www.springframework.org/schema/context"
xmlns:dubbo="http://code.alibabatech.com/schema/dubbo"
xmlns:mvc="http://www.springframework.org/schema/mvc"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-4.2.xsd
http://www.springframework.org/schema/mvc
http://www.springframework.org/schema/mvc/spring-mvc-4.2.xsd
http://code.alibabatech.com/schema/dubbo
http://code.alibabatech.com/schema/dubbo/dubbo.xsd
http://www.springframework.org/schema/context
http://www.springframework.org/schema/context/spring-context-4.2.xsd"> <!-- 、加载属性文件 -->
<!-- <context:property-placeholder location="classpath:resource/resource.properties"/> --> <!-- 、配置注解驱动 -->
<mvc:annotation-driven /> <!-- 、视图解析器 -->
<bean class="org.springframework.web.servlet.view.InternalResourceViewResolver">
<property name="prefix" value="/WEB-INF/jsp/" />
<property name="suffix" value=".jsp" />
</bean> <!-- 、配置包扫描器,扫描@Controller注解的类 -->
<context:component-scan base-package="com.taotao.controller"/> <!-- 、配置资源映射 -->
<mvc:resources location="/css/" mapping="/css/**"/>
<mvc:resources location="/js/" mapping="/js/**"/> <!-- 、多媒体解析器 -->
<!-- 配置文件上传解析器 -->
<bean id="multipartResolver" class="org.springframework.web.multipart.commons.CommonsMultipartResolver">
<!-- 设定默认编码 -->
<property name="defaultEncoding" value="UTF-8"></property>
<!-- 设定文件上传的最大值5MB,** -->
<property name="maxUploadSize" value=""></property>
</bean> <!-- 引用服务,也要在spring容器中,直接在这里引用即可 -->
<!-- 引用dubbo服务 -->
<!-- 名称不一样的哦 -->
<dubbo:application name="taotao-manager-web"/>
<dubbo:registry protocol="zookeeper" address="192.168.110.140:2181"/>
<dubbo:reference interface="com.taotao.service.ItemService" id="itemService" />
<!-- <dubbo:reference interface="com.taotao.service.ItemCatService" id="itemCatService" />
<dubbo:reference interface="com.taotao.content.service.ContentCategoryService" id="contentCategoryService" />
<dubbo:reference interface="com.taotao.content.service.ContentService" id="contentService" />
<dubbo:reference interface="com.taotao.search.service.SearchItemService" id="searchItemService" /> --> </beans>
package com.taotao.controller; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody; import com.taotao.pojo.TbItem;
import com.taotao.service.ItemService; /**
*
* @ClassName: ItemController.java
* @author: biehl
* @since: 2019年8月2日 下午5:10:31
* @Copyright: ©2019 biehl 版权所有
* @version: 0.0.1
* @Description:商品信息的控制层逻辑
*/
@Controller
public class ItemController { // itemService就是dubbo配置的id="itemService"
@Autowired
private ItemService itemService; @RequestMapping(value = "/item/{itemId}")
@ResponseBody
public TbItem getItemById(@PathVariable(value = "itemId") Long itemId) {
TbItem tbItem = new TbItem();
tbItem = itemService.getItemById(itemId);
return tbItem;
} }
9、dubbo服务调用测试。记得关闭dubbo服务器的防火墙,不然急死你。
访问http://localhost:8081/item/536563,报错了,然后呢,解决问题呗。是因为mapper映射文件没有发布的问题。在工程的pom配置文件里面添加如下配置内容。
[INFO] Scanning for projects...
[INFO]
[INFO] -------------------< com.taotao:taotao-manager-web >--------------------
[INFO] Building taotao-manager-web 0.0.-SNAPSHOT
[INFO] --------------------------------[ war ]---------------------------------
[INFO]
[INFO] --- maven-clean-plugin:2.5:clean (default-clean) @ taotao-manager-web ---
[INFO] Deleting D:\program\eclipse\eclipse\workspace_taotao\taotao-manager-web\target
[INFO]
[INFO] >>> tomcat7-maven-plugin:2.2:run (default-cli) > process-classes @ taotao-manager-web >>>
[INFO]
[INFO] --- maven-resources-plugin:2.7:resources (default-resources) @ taotao-manager-web ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying resource
[INFO]
[INFO] --- maven-compiler-plugin:3.2:compile (default-compile) @ taotao-manager-web ---
[INFO] Changes detected - recompiling the module!
[INFO] Compiling source file to D:\program\eclipse\eclipse\workspace_taotao\taotao-manager-web\target\classes
[INFO]
[INFO] <<< tomcat7-maven-plugin:2.2:run (default-cli) < process-classes @ taotao-manager-web <<<
[INFO]
[INFO]
[INFO] --- tomcat7-maven-plugin:2.2:run (default-cli) @ taotao-manager-web ---
[INFO] Running war on http://localhost:8081/
[INFO] Creating Tomcat server configuration at D:\program\eclipse\eclipse\workspace_taotao\taotao-manager-web\target\tomcat
[INFO] create webapp with contextPath:
八月 , :: 下午 org.apache.coyote.AbstractProtocol init
信息: Initializing ProtocolHandler ["http-bio-8081"]
八月 , :: 下午 org.apache.catalina.core.StandardService startInternal
信息: Starting service Tomcat
八月 , :: 下午 org.apache.catalina.core.StandardEngine startInternal
信息: Starting Servlet Engine: Apache Tomcat/7.0.
八月 , :: 下午 org.apache.catalina.core.ApplicationContext log
信息: No Spring WebApplicationInitializer types detected on classpath
log4j:WARN No appenders could be found for logger (org.springframework.web.context.support.StandardServletEnvironment).
log4j:WARN Please initialize the log4j system properly.
log4j:WARN See http://logging.apache.org/log4j/1.2/faq.html#noconfig for more info.
八月 , :: 下午 org.apache.catalina.core.ApplicationContext log
信息: Initializing Spring FrameworkServlet 'taotao-manager-web'
八月 , :: 下午 org.apache.coyote.AbstractProtocol start
信息: Starting ProtocolHandler ["http-bio-8081"]
八月 , :: 下午 org.apache.catalina.core.StandardWrapperValve invoke
严重: 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
org.apache.ibatis.binding.BindingException: Invalid bound statement (not found): com.taotao.mapper.TbItemMapper.selectByPrimaryKey
at org.apache.ibatis.binding.MapperMethod$SqlCommand.<init>(MapperMethod.java:)
at org.apache.ibatis.binding.MapperMethod.<init>(MapperMethod.java:)
at org.apache.ibatis.binding.MapperProxy.cachedMapperMethod(MapperProxy.java:)
at org.apache.ibatis.binding.MapperProxy.invoke(MapperProxy.java:)
at com.sun.proxy.$Proxy32.selectByPrimaryKey(Unknown Source)
at com.taotao.service.impl.ItemServiceImpl.getItemById(ItemServiceImpl.java:)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:)
at java.lang.reflect.Method.invoke(Method.java:)
at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:)
at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:)
at org.springframework.transaction.interceptor.TransactionInterceptor$.proceedWithInvocation(TransactionInterceptor.java:)
at org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:)
at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:)
at org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:)
at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:)
at com.sun.proxy.$Proxy35.getItemById(Unknown Source)
at com.alibaba.dubbo.common.bytecode.Wrapper0.invokeMethod(Wrapper0.java)
at com.alibaba.dubbo.rpc.proxy.javassist.JavassistProxyFactory$.doInvoke(JavassistProxyFactory.java:)
at com.alibaba.dubbo.rpc.proxy.AbstractProxyInvoker.invoke(AbstractProxyInvoker.java:)
at com.alibaba.dubbo.rpc.protocol.InvokerWrapper.invoke(InvokerWrapper.java:)
at com.alibaba.dubbo.rpc.filter.ExceptionFilter.invoke(ExceptionFilter.java:)
at com.alibaba.dubbo.rpc.protocol.ProtocolFilterWrapper$.invoke(ProtocolFilterWrapper.java:)
at com.alibaba.dubbo.rpc.filter.TimeoutFilter.invoke(TimeoutFilter.java:)
at com.alibaba.dubbo.rpc.protocol.ProtocolFilterWrapper$.invoke(ProtocolFilterWrapper.java:)
at com.alibaba.dubbo.monitor.support.MonitorFilter.invoke(MonitorFilter.java:)
at com.alibaba.dubbo.rpc.protocol.ProtocolFilterWrapper$.invoke(ProtocolFilterWrapper.java:)
at com.alibaba.dubbo.rpc.protocol.dubbo.filter.TraceFilter.invoke(TraceFilter.java:)
at com.alibaba.dubbo.rpc.protocol.ProtocolFilterWrapper$.invoke(ProtocolFilterWrapper.java:)
at com.alibaba.dubbo.rpc.filter.ContextFilter.invoke(ContextFilter.java:)
at com.alibaba.dubbo.rpc.protocol.ProtocolFilterWrapper$.invoke(ProtocolFilterWrapper.java:)
at com.alibaba.dubbo.rpc.filter.GenericFilter.invoke(GenericFilter.java:)
at com.alibaba.dubbo.rpc.protocol.ProtocolFilterWrapper$.invoke(ProtocolFilterWrapper.java:)
at com.alibaba.dubbo.rpc.filter.ClassLoaderFilter.invoke(ClassLoaderFilter.java:)
at com.alibaba.dubbo.rpc.protocol.ProtocolFilterWrapper$.invoke(ProtocolFilterWrapper.java:)
at com.alibaba.dubbo.rpc.filter.EchoFilter.invoke(EchoFilter.java:)
at com.alibaba.dubbo.rpc.protocol.ProtocolFilterWrapper$.invoke(ProtocolFilterWrapper.java:)
at com.alibaba.dubbo.rpc.protocol.dubbo.DubboProtocol$.reply(DubboProtocol.java:)
at com.alibaba.dubbo.remoting.exchange.support.header.HeaderExchangeHandler.handleRequest(HeaderExchangeHandler.java:)
at com.alibaba.dubbo.remoting.exchange.support.header.HeaderExchangeHandler.received(HeaderExchangeHandler.java:)
at com.alibaba.dubbo.remoting.transport.DecodeHandler.received(DecodeHandler.java:)
at com.alibaba.dubbo.remoting.transport.dispatcher.ChannelEventRunnable.run(ChannelEventRunnable.java:)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:)
at java.lang.Thread.run(Thread.java:)
] with root cause
java.lang.RuntimeException: org.apache.ibatis.binding.BindingException: Invalid bound statement (not found): com.taotao.mapper.TbItemMapper.selectByPrimaryKey
org.apache.ibatis.binding.BindingException: Invalid bound statement (not found): com.taotao.mapper.TbItemMapper.selectByPrimaryKey
at org.apache.ibatis.binding.MapperMethod$SqlCommand.<init>(MapperMethod.java:)
at org.apache.ibatis.binding.MapperMethod.<init>(MapperMethod.java:)
at org.apache.ibatis.binding.MapperProxy.cachedMapperMethod(MapperProxy.java:)
at org.apache.ibatis.binding.MapperProxy.invoke(MapperProxy.java:)
at com.sun.proxy.$Proxy32.selectByPrimaryKey(Unknown Source)
at com.taotao.service.impl.ItemServiceImpl.getItemById(ItemServiceImpl.java:)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:)
at java.lang.reflect.Method.invoke(Method.java:)
at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:)
at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:)
at org.springframework.transaction.interceptor.TransactionInterceptor$.proceedWithInvocation(TransactionInterceptor.java:)
at org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:)
at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:)
at org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:)
at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:)
at com.sun.proxy.$Proxy35.getItemById(Unknown Source)
at com.alibaba.dubbo.common.bytecode.Wrapper0.invokeMethod(Wrapper0.java)
at com.alibaba.dubbo.rpc.proxy.javassist.JavassistProxyFactory$.doInvoke(JavassistProxyFactory.java:)
at com.alibaba.dubbo.rpc.proxy.AbstractProxyInvoker.invoke(AbstractProxyInvoker.java:)
at com.alibaba.dubbo.rpc.protocol.InvokerWrapper.invoke(InvokerWrapper.java:)
at com.alibaba.dubbo.rpc.filter.ExceptionFilter.invoke(ExceptionFilter.java:)
at com.alibaba.dubbo.rpc.protocol.ProtocolFilterWrapper$.invoke(ProtocolFilterWrapper.java:)
at com.alibaba.dubbo.rpc.filter.TimeoutFilter.invoke(TimeoutFilter.java:)
at com.alibaba.dubbo.rpc.protocol.ProtocolFilterWrapper$.invoke(ProtocolFilterWrapper.java:)
at com.alibaba.dubbo.monitor.support.MonitorFilter.invoke(MonitorFilter.java:)
at com.alibaba.dubbo.rpc.protocol.ProtocolFilterWrapper$.invoke(ProtocolFilterWrapper.java:)
at com.alibaba.dubbo.rpc.protocol.dubbo.filter.TraceFilter.invoke(TraceFilter.java:)
at com.alibaba.dubbo.rpc.protocol.ProtocolFilterWrapper$.invoke(ProtocolFilterWrapper.java:)
at com.alibaba.dubbo.rpc.filter.ContextFilter.invoke(ContextFilter.java:)
at com.alibaba.dubbo.rpc.protocol.ProtocolFilterWrapper$.invoke(ProtocolFilterWrapper.java:)
at com.alibaba.dubbo.rpc.filter.GenericFilter.invoke(GenericFilter.java:)
at com.alibaba.dubbo.rpc.protocol.ProtocolFilterWrapper$.invoke(ProtocolFilterWrapper.java:)
at com.alibaba.dubbo.rpc.filter.ClassLoaderFilter.invoke(ClassLoaderFilter.java:)
at com.alibaba.dubbo.rpc.protocol.ProtocolFilterWrapper$.invoke(ProtocolFilterWrapper.java:)
at com.alibaba.dubbo.rpc.filter.EchoFilter.invoke(EchoFilter.java:)
at com.alibaba.dubbo.rpc.protocol.ProtocolFilterWrapper$.invoke(ProtocolFilterWrapper.java:)
at com.alibaba.dubbo.rpc.protocol.dubbo.DubboProtocol$.reply(DubboProtocol.java:)
at com.alibaba.dubbo.remoting.exchange.support.header.HeaderExchangeHandler.handleRequest(HeaderExchangeHandler.java:)
at com.alibaba.dubbo.remoting.exchange.support.header.HeaderExchangeHandler.received(HeaderExchangeHandler.java:)
at com.alibaba.dubbo.remoting.transport.DecodeHandler.received(DecodeHandler.java:)
at com.alibaba.dubbo.remoting.transport.dispatcher.ChannelEventRunnable.run(ChannelEventRunnable.java:)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:)
at java.lang.Thread.run(Thread.java:) at com.alibaba.dubbo.rpc.filter.ExceptionFilter.invoke(ExceptionFilter.java:)
at com.alibaba.dubbo.rpc.protocol.ProtocolFilterWrapper$.invoke(ProtocolFilterWrapper.java:)
at com.alibaba.dubbo.rpc.filter.TimeoutFilter.invoke(TimeoutFilter.java:)
at com.alibaba.dubbo.rpc.protocol.ProtocolFilterWrapper$.invoke(ProtocolFilterWrapper.java:)
at com.alibaba.dubbo.monitor.support.MonitorFilter.invoke(MonitorFilter.java:)
at com.alibaba.dubbo.rpc.protocol.ProtocolFilterWrapper$.invoke(ProtocolFilterWrapper.java:)
at com.alibaba.dubbo.rpc.protocol.dubbo.filter.TraceFilter.invoke(TraceFilter.java:)
at com.alibaba.dubbo.rpc.protocol.ProtocolFilterWrapper$.invoke(ProtocolFilterWrapper.java:)
at com.alibaba.dubbo.rpc.filter.ContextFilter.invoke(ContextFilter.java:)
at com.alibaba.dubbo.rpc.protocol.ProtocolFilterWrapper$.invoke(ProtocolFilterWrapper.java:)
at com.alibaba.dubbo.rpc.filter.GenericFilter.invoke(GenericFilter.java:)
at com.alibaba.dubbo.rpc.protocol.ProtocolFilterWrapper$.invoke(ProtocolFilterWrapper.java:)
at com.alibaba.dubbo.rpc.filter.ClassLoaderFilter.invoke(ClassLoaderFilter.java:)
at com.alibaba.dubbo.rpc.protocol.ProtocolFilterWrapper$.invoke(ProtocolFilterWrapper.java:)
at com.alibaba.dubbo.rpc.filter.EchoFilter.invoke(EchoFilter.java:)
at com.alibaba.dubbo.rpc.protocol.ProtocolFilterWrapper$.invoke(ProtocolFilterWrapper.java:)
at com.alibaba.dubbo.rpc.protocol.dubbo.DubboProtocol$.reply(DubboProtocol.java:)
at com.alibaba.dubbo.remoting.exchange.support.header.HeaderExchangeHandler.handleRequest(HeaderExchangeHandler.java:)
at com.alibaba.dubbo.remoting.exchange.support.header.HeaderExchangeHandler.received(HeaderExchangeHandler.java:)
at com.alibaba.dubbo.remoting.transport.DecodeHandler.received(DecodeHandler.java:)
at com.alibaba.dubbo.remoting.transport.dispatcher.ChannelEventRunnable.run(ChannelEventRunnable.java:)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:)
at java.lang.Thread.run(Thread.java:)
为解决问题的时候,只有接口,没有对应的配置SQL文件。
在pom配置文件里面添加如下配置即可。默认是将src/main/resources目录下面的文件放到\target\classes\目标目录下面,现在修改默认配置,将src/main/java目录下面的文件放到\target\classes\目标目录下面。
<!-- 如果不添加此节点mybatis的mapper.xml文件都会被漏掉的。 -->
<build>
<resources>
<resource>
<directory>src/main/java</directory>
<includes>
<include>**/*.xml</include>
</includes>
</resource>
<!-- <resource> 如果需要复制resources下面的文件,需要添加此配置即可
<directory>src/main/resources</directory>
<includes>
<include>**/*.xml</include>
</includes>
</resource> -->
</resources>
</build>
然后重启dubbo的发布服务。dubbo的应用服务可以不用重启,表现层只需要调用服务即可。然后又报了下面这个错误。聚合工程下面的模块修改了,也不需要安装,因为你启动的是聚合工程,所以直接启动聚合工程即可。
[INFO] Scanning for projects...
[INFO]
[INFO] -------------------< com.taotao:taotao-manager-web >--------------------
[INFO] Building taotao-manager-web 0.0.-SNAPSHOT
[INFO] --------------------------------[ war ]---------------------------------
[INFO]
[INFO] --- maven-clean-plugin:2.5:clean (default-clean) @ taotao-manager-web ---
[INFO] Deleting D:\program\eclipse\eclipse\workspace_taotao\taotao-manager-web\target
[INFO]
[INFO] >>> tomcat7-maven-plugin:2.2:run (default-cli) > process-classes @ taotao-manager-web >>>
[INFO]
[INFO] --- maven-resources-plugin:2.7:resources (default-resources) @ taotao-manager-web ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying resource
[INFO]
[INFO] --- maven-compiler-plugin:3.2:compile (default-compile) @ taotao-manager-web ---
[INFO] Changes detected - recompiling the module!
[INFO] Compiling source file to D:\program\eclipse\eclipse\workspace_taotao\taotao-manager-web\target\classes
[INFO]
[INFO] <<< tomcat7-maven-plugin:2.2:run (default-cli) < process-classes @ taotao-manager-web <<<
[INFO]
[INFO]
[INFO] --- tomcat7-maven-plugin:2.2:run (default-cli) @ taotao-manager-web ---
[INFO] Running war on http://localhost:8081/
[INFO] Creating Tomcat server configuration at D:\program\eclipse\eclipse\workspace_taotao\taotao-manager-web\target\tomcat
[INFO] create webapp with contextPath:
八月 , :: 下午 org.apache.coyote.AbstractProtocol init
信息: Initializing ProtocolHandler ["http-bio-8081"]
八月 , :: 下午 org.apache.catalina.core.StandardService startInternal
信息: Starting service Tomcat
八月 , :: 下午 org.apache.catalina.core.StandardEngine startInternal
信息: Starting Servlet Engine: Apache Tomcat/7.0.
八月 , :: 下午 org.apache.catalina.core.ApplicationContext log
信息: No Spring WebApplicationInitializer types detected on classpath
log4j:WARN No appenders could be found for logger (org.springframework.web.context.support.StandardServletEnvironment).
log4j:WARN Please initialize the log4j system properly.
log4j:WARN See http://logging.apache.org/log4j/1.2/faq.html#noconfig for more info.
八月 , :: 下午 org.apache.catalina.core.ApplicationContext log
信息: Initializing Spring FrameworkServlet 'taotao-manager-web'
八月 , :: 下午 org.apache.coyote.AbstractProtocol start
信息: Starting ProtocolHandler ["http-bio-8081"]
八月 , :: 下午 org.apache.catalina.core.StandardWrapperValve invoke
严重: 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 times of the providers [192.168.110.1:] (/) from the registry 192.168.110.140: on the consumer 192.168.110.1 using the dubbo version 2.5.. 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
java.lang.IllegalStateException: Serialized class com.taotao.pojo.TbItem must implement java.io.Serializable
at com.alibaba.com.caucho.hessian.io.SerializerFactory.getDefaultSerializer(SerializerFactory.java:)
at com.alibaba.com.caucho.hessian.io.SerializerFactory.getSerializer(SerializerFactory.java:)
at com.alibaba.com.caucho.hessian.io.Hessian2Output.writeObject(Hessian2Output.java:)
at com.alibaba.dubbo.common.serialize.support.hessian.Hessian2ObjectOutput.writeObject(Hessian2ObjectOutput.java:)
at com.alibaba.dubbo.rpc.protocol.dubbo.DubboCodec.encodeResponseData(DubboCodec.java:)
at com.alibaba.dubbo.remoting.exchange.codec.ExchangeCodec.encodeResponse(ExchangeCodec.java:)
at com.alibaba.dubbo.remoting.exchange.codec.ExchangeCodec.encode(ExchangeCodec.java:)
at com.alibaba.dubbo.rpc.protocol.dubbo.DubboCountCodec.encode(DubboCountCodec.java:)
at com.alibaba.dubbo.remoting.transport.netty.NettyCodecAdapter$InternalEncoder.encode(NettyCodecAdapter.java:)
at org.jboss.netty.handler.codec.oneone.OneToOneEncoder.doEncode(OneToOneEncoder.java:)
at org.jboss.netty.handler.codec.oneone.OneToOneEncoder.handleDownstream(OneToOneEncoder.java:)
at org.jboss.netty.channel.DefaultChannelPipeline.sendDownstream(DefaultChannelPipeline.java:)
at org.jboss.netty.channel.DefaultChannelPipeline$DefaultChannelHandlerContext.sendDownstream(DefaultChannelPipeline.java:)
at org.jboss.netty.channel.SimpleChannelHandler.writeRequested(SimpleChannelHandler.java:)
at com.alibaba.dubbo.remoting.transport.netty.NettyHandler.writeRequested(NettyHandler.java:)
at org.jboss.netty.channel.SimpleChannelHandler.handleDownstream(SimpleChannelHandler.java:)
at org.jboss.netty.channel.DefaultChannelPipeline.sendDownstream(DefaultChannelPipeline.java:)
at org.jboss.netty.channel.DefaultChannelPipeline.sendDownstream(DefaultChannelPipeline.java:)
at org.jboss.netty.channel.Channels.write(Channels.java:)
at org.jboss.netty.channel.Channels.write(Channels.java:)
at org.jboss.netty.channel.AbstractChannel.write(AbstractChannel.java:)
at com.alibaba.dubbo.remoting.transport.netty.NettyChannel.send(NettyChannel.java:)
at com.alibaba.dubbo.remoting.transport.AbstractPeer.send(AbstractPeer.java:)
at com.alibaba.dubbo.remoting.exchange.support.header.HeaderExchangeHandler.received(HeaderExchangeHandler.java:)
at com.alibaba.dubbo.remoting.transport.DecodeHandler.received(DecodeHandler.java:)
at com.alibaba.dubbo.remoting.transport.dispatcher.ChannelEventRunnable.run(ChannelEventRunnable.java:)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:)
at java.lang.Thread.run(Thread.java:)
] with root cause
com.alibaba.dubbo.remoting.RemotingException: Failed to send response: Response [id=, version=2.0., status=, 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
java.lang.IllegalStateException: Serialized class com.taotao.pojo.TbItem must implement java.io.Serializable
at com.alibaba.com.caucho.hessian.io.SerializerFactory.getDefaultSerializer(SerializerFactory.java:)
at com.alibaba.com.caucho.hessian.io.SerializerFactory.getSerializer(SerializerFactory.java:)
at com.alibaba.com.caucho.hessian.io.Hessian2Output.writeObject(Hessian2Output.java:)
at com.alibaba.dubbo.common.serialize.support.hessian.Hessian2ObjectOutput.writeObject(Hessian2ObjectOutput.java:)
at com.alibaba.dubbo.rpc.protocol.dubbo.DubboCodec.encodeResponseData(DubboCodec.java:)
at com.alibaba.dubbo.remoting.exchange.codec.ExchangeCodec.encodeResponse(ExchangeCodec.java:)
at com.alibaba.dubbo.remoting.exchange.codec.ExchangeCodec.encode(ExchangeCodec.java:)
at com.alibaba.dubbo.rpc.protocol.dubbo.DubboCountCodec.encode(DubboCountCodec.java:)
at com.alibaba.dubbo.remoting.transport.netty.NettyCodecAdapter$InternalEncoder.encode(NettyCodecAdapter.java:)
at org.jboss.netty.handler.codec.oneone.OneToOneEncoder.doEncode(OneToOneEncoder.java:)
at org.jboss.netty.handler.codec.oneone.OneToOneEncoder.handleDownstream(OneToOneEncoder.java:)
at org.jboss.netty.channel.DefaultChannelPipeline.sendDownstream(DefaultChannelPipeline.java:)
at org.jboss.netty.channel.DefaultChannelPipeline$DefaultChannelHandlerContext.sendDownstream(DefaultChannelPipeline.java:)
at org.jboss.netty.channel.SimpleChannelHandler.writeRequested(SimpleChannelHandler.java:)
at com.alibaba.dubbo.remoting.transport.netty.NettyHandler.writeRequested(NettyHandler.java:)
at org.jboss.netty.channel.SimpleChannelHandler.handleDownstream(SimpleChannelHandler.java:)
at org.jboss.netty.channel.DefaultChannelPipeline.sendDownstream(DefaultChannelPipeline.java:)
at org.jboss.netty.channel.DefaultChannelPipeline.sendDownstream(DefaultChannelPipeline.java:)
at org.jboss.netty.channel.Channels.write(Channels.java:)
at org.jboss.netty.channel.Channels.write(Channels.java:)
at org.jboss.netty.channel.AbstractChannel.write(AbstractChannel.java:)
at com.alibaba.dubbo.remoting.transport.netty.NettyChannel.send(NettyChannel.java:)
at com.alibaba.dubbo.remoting.transport.AbstractPeer.send(AbstractPeer.java:)
at com.alibaba.dubbo.remoting.exchange.support.header.HeaderExchangeHandler.received(HeaderExchangeHandler.java:)
at com.alibaba.dubbo.remoting.transport.DecodeHandler.received(DecodeHandler.java:)
at com.alibaba.dubbo.remoting.transport.dispatcher.ChannelEventRunnable.run(ChannelEventRunnable.java:)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:)
at java.lang.Thread.run(Thread.java:) at com.alibaba.dubbo.remoting.exchange.support.DefaultFuture.returnFromResponse(DefaultFuture.java:)
at com.alibaba.dubbo.remoting.exchange.support.DefaultFuture.get(DefaultFuture.java:)
at com.alibaba.dubbo.remoting.exchange.support.DefaultFuture.get(DefaultFuture.java:)
at com.alibaba.dubbo.rpc.protocol.dubbo.DubboInvoker.doInvoke(DubboInvoker.java:)
at com.alibaba.dubbo.rpc.protocol.AbstractInvoker.invoke(AbstractInvoker.java:)
at com.alibaba.dubbo.rpc.listener.ListenerInvokerWrapper.invoke(ListenerInvokerWrapper.java:)
at com.alibaba.dubbo.rpc.protocol.dubbo.filter.FutureFilter.invoke(FutureFilter.java:)
at com.alibaba.dubbo.rpc.protocol.ProtocolFilterWrapper$.invoke(ProtocolFilterWrapper.java:)
at com.alibaba.dubbo.monitor.support.MonitorFilter.invoke(MonitorFilter.java:)
at com.alibaba.dubbo.rpc.protocol.ProtocolFilterWrapper$.invoke(ProtocolFilterWrapper.java:)
at com.alibaba.dubbo.rpc.filter.ConsumerContextFilter.invoke(ConsumerContextFilter.java:)
at com.alibaba.dubbo.rpc.protocol.ProtocolFilterWrapper$.invoke(ProtocolFilterWrapper.java:)
at com.alibaba.dubbo.rpc.protocol.InvokerWrapper.invoke(InvokerWrapper.java:)
at com.alibaba.dubbo.rpc.cluster.support.FailoverClusterInvoker.doInvoke(FailoverClusterInvoker.java:)
at com.alibaba.dubbo.rpc.cluster.support.AbstractClusterInvoker.invoke(AbstractClusterInvoker.java:)
at com.alibaba.dubbo.rpc.cluster.support.wrapper.MockClusterInvoker.invoke(MockClusterInvoker.java:)
at com.alibaba.dubbo.rpc.proxy.InvokerInvocationHandler.invoke(InvokerInvocationHandler.java:)
at com.alibaba.dubbo.common.bytecode.proxy0.getItemById(proxy0.java)
at com.taotao.controller.ItemController.getItemById(ItemController.java:)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:)
at java.lang.reflect.Method.invoke(Method.java:)
at org.springframework.web.method.support.InvocableHandlerMethod.doInvoke(InvocableHandlerMethod.java:)
at org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:)
at org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:)
at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandlerMethod(RequestMappingHandlerAdapter.java:)
at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:)
at org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:)
at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:)
at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:)
at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:)
at org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:)
at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:)
at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:)
at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:)
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:)
at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:)
at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:)
at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:)
at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:)
at java.lang.Thread.run(Thread.java:)
报这种序列号的错误,是实体类必须实现序列化接口,将查询出的数据必须进行序列化,才可以进行传输。将服务层的序列化的数据传递给表现层(客户端),然后表现层进行反序列化即可。里面的实体类,除了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。
[root@localhost apache-tomcat-7.0.]# bin/startup.sh
Using CATALINA_BASE: /home/hadoop/soft/apache-tomcat-7.0.
Using CATALINA_HOME: /home/hadoop/soft/apache-tomcat-7.0.
Using CATALINA_TMPDIR: /home/hadoop/soft/apache-tomcat-7.0./temp
Using JRE_HOME: /home/hadoop/soft/jdk1..0_55
Using CLASSPATH: /home/hadoop/soft/apache-tomcat-7.0./bin/bootstrap.jar:/home/hadoop/soft/apache-tomcat-7.0./bin/tomcat-juli.jar
[root@localhost apache-tomcat-7.0.]# tail -f logs/catalina.out
INFO rule.DirectModuleMappingRule - Initialized screen.notemplate:DirectModuleMappingRule with cache disabled
INFO rule.FallbackModuleMappingRule - Initialized screen:FallbackModuleMappingRule with cache enabled
INFO rule.DirectTemplateMappingRule - Initialized screen.template:DirectTemplateMappingRule with cache disabled
INFO rule.FallbackTemplateMappingRule - Initialized layout.template:FallbackTemplateMappingRule with cache enabled
INFO rule.DirectModuleMappingRule - Initialized control.notemplate:DirectModuleMappingRule with cache disabled
INFO rule.FallbackModuleMappingRule - Initialized control:FallbackModuleMappingRule with cache enabled
INFO rule.DirectTemplateMappingRule - Initialized control.template:DirectTemplateMappingRule with cache disabled
INFO pull.PullService - Initialized pull service [key=PullService.pullService.] with pre-pulled tools, pre-queued tools and runtime tools
INFO context.WebxComponentsLoader - Initializing Spring sub WebApplicationContext: personal
INFO context.WebxComponentContext - Refreshing com.alibaba.citrus.webx.context.WebxComponentContext@1ae1c93: display name [WebApplicationContext for namespace 'personal']; startup date [Mon Aug :: PDT ]; parent: com.alibaba.citrus.webx.context.WebxComponentsContext@a67e6c
INFO xml.XmlBeanDefinitionReader - Loading XML bean definitions from Resource[WEB-INF/webx-personal.xml, loaded by ResourceLoadingService]
INFO xml.XmlBeanDefinitionReader - Loading XML bean definitions from Resource[WEB-INF/common/webx-component-and-root.xml, loaded by ResourceLoadingService]
INFO xml.XmlBeanDefinitionReader - Loading XML bean definitions from Resource[WEB-INF/common/webx-component.xml, loaded by ResourceLoadingService]
INFO xml.XmlBeanDefinitionReader - Loading XML bean definitions from Resource[WEB-INF/common/pipeline.xml, loaded by ResourceLoadingService]
INFO context.WebxComponentContext - Bean factory for application context [com.alibaba.citrus.webx.context.WebxComponentContext@1ae1c93]: com.alibaba.citrus.springext.support.context.InheritableListableBeanFactory@1503e40
INFO context.WebxComponentContext - Bean '(inner bean)' is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
INFO context.WebxComponentContext - Bean '(inner bean)#1' is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
INFO config.WebxConfiguration - Application is running in Production Mode.
INFO context.WebxComponentContext - Bean 'webxConfiguration' is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
INFO context.WebxComponentContext - Bean '(inner bean)' is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
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#,templateService,mappingRuleService,dataResolverService,productionModeSensiblePostProcessor,webxConfiguration,pullService,pipeline,module.screen.Passwds,module.screen.Infos,moduleLoaderService]; parent: com.alibaba.citrus.springext.support.context.InheritableListableBeanFactory@
INFO velocity.VelocityEngine - SpringResourceLoaderAdapter : initialization starting.
INFO velocity.VelocityEngine - SpringResourceLoaderAdapter : set path '/templates/personal/'
INFO velocity.VelocityEngine - SpringResourceLoaderAdapter : initialization complete.
INFO rule.ExtensionMappingRule - Initialized extension.input:ExtensionMappingRule with cache disabled
INFO rule.ExtensionMappingRule - Initialized extension.output:ExtensionMappingRule with cache disabled
INFO rule.DirectModuleMappingRule - Initialized action:DirectModuleMappingRule with cache disabled
INFO rule.DirectModuleMappingRule - Initialized screen.notemplate:DirectModuleMappingRule with cache disabled
INFO rule.FallbackModuleMappingRule - Initialized screen:FallbackModuleMappingRule with cache enabled
INFO rule.DirectTemplateMappingRule - Initialized screen.template:DirectTemplateMappingRule with cache disabled
INFO rule.FallbackTemplateMappingRule - Initialized layout.template:FallbackTemplateMappingRule with cache enabled
INFO rule.DirectModuleMappingRule - Initialized control.notemplate:DirectModuleMappingRule with cache disabled
INFO rule.FallbackModuleMappingRule - Initialized control:FallbackModuleMappingRule with cache enabled
INFO rule.DirectTemplateMappingRule - Initialized control.template:DirectTemplateMappingRule with cache disabled
INFO pull.PullService - Initialized pull service [key=PullService.pullService.] with pre-pulled tools, pre-queued tools and runtime tools
INFO context.WebxComponentsLoader - Initializing Spring sub WebApplicationContext: sysmanage
INFO context.WebxComponentContext - Refreshing com.alibaba.citrus.webx.context.WebxComponentContext@1beed3d: display name [WebApplicationContext for namespace 'sysmanage']; startup date [Mon Aug :: PDT ]; parent: com.alibaba.citrus.webx.context.WebxComponentsContext@a67e6c
INFO xml.XmlBeanDefinitionReader - Loading XML bean definitions from Resource[WEB-INF/webx-sysmanage.xml, loaded by ResourceLoadingService]
INFO xml.XmlBeanDefinitionReader - Loading XML bean definitions from Resource[WEB-INF/common/webx-component-and-root.xml, loaded by ResourceLoadingService]
INFO xml.XmlBeanDefinitionReader - Loading XML bean definitions from Resource[WEB-INF/common/webx-component.xml, loaded by ResourceLoadingService]
INFO xml.XmlBeanDefinitionReader - Loading XML bean definitions from Resource[WEB-INF/common/pipeline.xml, loaded by ResourceLoadingService]
INFO context.WebxComponentContext - Bean factory for application context [com.alibaba.citrus.webx.context.WebxComponentContext@1beed3d]: com.alibaba.citrus.springext.support.context.InheritableListableBeanFactory@14f00e1
INFO context.WebxComponentContext - Bean '(inner bean)' is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
INFO context.WebxComponentContext - Bean '(inner bean)#1' is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
INFO config.WebxConfiguration - Application is running in Production Mode.
INFO context.WebxComponentContext - Bean 'webxConfiguration' is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
INFO context.WebxComponentContext - Bean '(inner bean)' is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
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#,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@
INFO velocity.VelocityEngine - SpringResourceLoaderAdapter : initialization starting.
INFO velocity.VelocityEngine - SpringResourceLoaderAdapter : set path '/templates/sysmanage/'
INFO velocity.VelocityEngine - SpringResourceLoaderAdapter : initialization complete.
INFO rule.ExtensionMappingRule - Initialized extension.input:ExtensionMappingRule with cache disabled
INFO rule.ExtensionMappingRule - Initialized extension.output:ExtensionMappingRule with cache disabled
INFO rule.DirectModuleMappingRule - Initialized action:DirectModuleMappingRule with cache disabled
INFO rule.DirectModuleMappingRule - Initialized screen.notemplate:DirectModuleMappingRule with cache disabled
INFO rule.FallbackModuleMappingRule - Initialized screen:FallbackModuleMappingRule with cache enabled
INFO rule.DirectTemplateMappingRule - Initialized screen.template:DirectTemplateMappingRule with cache disabled
INFO rule.FallbackTemplateMappingRule - Initialized layout.template:FallbackTemplateMappingRule with cache enabled
INFO rule.DirectModuleMappingRule - Initialized control.notemplate:DirectModuleMappingRule with cache disabled
INFO rule.FallbackModuleMappingRule - Initialized control:FallbackModuleMappingRule with cache enabled
INFO rule.DirectTemplateMappingRule - Initialized control.template:DirectTemplateMappingRule with cache disabled
INFO pull.PullService - Initialized pull service [key=PullService.pullService.] with pre-pulled tools, pre-queued tools and runtime tools
INFO context.WebxComponentsLoader - Initializing Spring sub WebApplicationContext: sysinfo
INFO context.WebxComponentContext - Refreshing com.alibaba.citrus.webx.context.WebxComponentContext@1d63340: display name [WebApplicationContext for namespace 'sysinfo']; startup date [Mon Aug :: PDT ]; parent: com.alibaba.citrus.webx.context.WebxComponentsContext@a67e6c
INFO xml.XmlBeanDefinitionReader - Loading XML bean definitions from Resource[WEB-INF/webx-sysinfo.xml, loaded by ResourceLoadingService]
INFO xml.XmlBeanDefinitionReader - Loading XML bean definitions from Resource[WEB-INF/common/webx-component-and-root.xml, loaded by ResourceLoadingService]
INFO xml.XmlBeanDefinitionReader - Loading XML bean definitions from Resource[WEB-INF/common/webx-component.xml, loaded by ResourceLoadingService]
INFO xml.XmlBeanDefinitionReader - Loading XML bean definitions from Resource[WEB-INF/common/pipeline.xml, loaded by ResourceLoadingService]
INFO context.WebxComponentContext - Bean factory for application context [com.alibaba.citrus.webx.context.WebxComponentContext@1d63340]: com.alibaba.citrus.springext.support.context.InheritableListableBeanFactory@d2ea9c
INFO context.WebxComponentContext - Bean '(inner bean)' is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
INFO context.WebxComponentContext - Bean '(inner bean)#1' is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
INFO config.WebxConfiguration - Application is running in Production Mode.
INFO context.WebxComponentContext - Bean 'webxConfiguration' is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
INFO context.WebxComponentContext - Bean '(inner bean)' is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
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#,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@
INFO velocity.VelocityEngine - SpringResourceLoaderAdapter : initialization starting.
INFO velocity.VelocityEngine - SpringResourceLoaderAdapter : set path '/templates/sysinfo/'
INFO velocity.VelocityEngine - SpringResourceLoaderAdapter : initialization complete.
INFO rule.ExtensionMappingRule - Initialized extension.input:ExtensionMappingRule with cache disabled
INFO rule.ExtensionMappingRule - Initialized extension.output:ExtensionMappingRule with cache disabled
INFO rule.DirectModuleMappingRule - Initialized action:DirectModuleMappingRule with cache disabled
INFO rule.DirectModuleMappingRule - Initialized screen.notemplate:DirectModuleMappingRule with cache disabled
INFO rule.FallbackModuleMappingRule - Initialized screen:FallbackModuleMappingRule with cache enabled
INFO rule.DirectTemplateMappingRule - Initialized screen.template:DirectTemplateMappingRule with cache disabled
INFO rule.FallbackTemplateMappingRule - Initialized layout.template:FallbackTemplateMappingRule with cache enabled
INFO rule.DirectModuleMappingRule - Initialized control.notemplate:DirectModuleMappingRule with cache disabled
INFO rule.FallbackModuleMappingRule - Initialized control:FallbackModuleMappingRule with cache enabled
INFO rule.DirectTemplateMappingRule - Initialized control.template:DirectTemplateMappingRule with cache disabled
INFO pull.PullService - Initialized pull service [key=PullService.pullService.] with pre-pulled tools, pre-queued tools and runtime tools
INFO context.WebxComponentsLoader - Initializing Spring sub WebApplicationContext: governance
INFO context.WebxComponentContext - Refreshing com.alibaba.citrus.webx.context.WebxComponentContext@9c11b8: display name [WebApplicationContext for namespace 'governance']; startup date [Mon Aug :: PDT ]; parent: com.alibaba.citrus.webx.context.WebxComponentsContext@a67e6c
INFO xml.XmlBeanDefinitionReader - Loading XML bean definitions from Resource[WEB-INF/webx-governance.xml, loaded by ResourceLoadingService]
INFO xml.XmlBeanDefinitionReader - Loading XML bean definitions from Resource[WEB-INF/common/webx-component-and-root.xml, loaded by ResourceLoadingService]
INFO xml.XmlBeanDefinitionReader - Loading XML bean definitions from Resource[WEB-INF/common/webx-component.xml, loaded by ResourceLoadingService]
INFO xml.XmlBeanDefinitionReader - Loading XML bean definitions from Resource[WEB-INF/common/pipeline.xml, loaded by ResourceLoadingService]
INFO context.WebxComponentContext - Bean factory for application context [com.alibaba.citrus.webx.context.WebxComponentContext@9c11b8]: com.alibaba.citrus.springext.support.context.InheritableListableBeanFactory@f87b16
INFO context.WebxComponentContext - Bean '(inner bean)' is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
INFO context.WebxComponentContext - Bean '(inner bean)#1' is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
INFO config.WebxConfiguration - Application is running in Production Mode.
INFO context.WebxComponentContext - Bean 'webxConfiguration' is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
INFO context.WebxComponentContext - Bean '(inner bean)' is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
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#,pullService,templateService,mappingRuleService,dataResolverService,productionModeSensiblePostProcessor,webxConfiguration,pullService#,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@
INFO pull.PullService - Initialized pull service [key=PullService.pullService.] with pre-pulled tools, pre-queued tools and runtime tools
INFO velocity.VelocityEngine - SpringResourceLoaderAdapter : initialization starting.
INFO velocity.VelocityEngine - SpringResourceLoaderAdapter : set path '/templates/governance/'
INFO velocity.VelocityEngine - SpringResourceLoaderAdapter : initialization complete.
INFO rule.ExtensionMappingRule - Initialized extension.input:ExtensionMappingRule with cache disabled
INFO rule.ExtensionMappingRule - Initialized extension.output:ExtensionMappingRule with cache disabled
INFO rule.DirectModuleMappingRule - Initialized action:DirectModuleMappingRule with cache disabled
INFO rule.DirectModuleMappingRule - Initialized screen.notemplate:DirectModuleMappingRule with cache disabled
INFO rule.FallbackModuleMappingRule - Initialized screen:FallbackModuleMappingRule with cache enabled
INFO rule.DirectTemplateMappingRule - Initialized screen.template:DirectTemplateMappingRule with cache disabled
INFO rule.FallbackTemplateMappingRule - Initialized layout.template:FallbackTemplateMappingRule with cache enabled
INFO rule.DirectModuleMappingRule - Initialized control.notemplate:DirectModuleMappingRule with cache disabled
INFO rule.FallbackModuleMappingRule - Initialized control:FallbackModuleMappingRule with cache enabled
INFO rule.DirectTemplateMappingRule - Initialized control.template:DirectTemplateMappingRule with cache disabled
INFO pull.PullService - Initialized pull service [key=PullService.pullService#0.6] with pre-pulled tools, pre-queued tools and runtime tools
INFO context.WebxComponentsLoader - WebxComponents: initialization completed
INFO context.ContextLoader - Root WebApplicationContext: initialization completed in ms
INFO servlet.SetLoggingContextFilter - Initializing filter: mdc
INFO servlet.SetLoggingContextFilter - SetLoggingContextFilter - mdc: initialization completed
INFO servlet.WebxFrameworkFilter - Initializing filter: webx
INFO servlet.WebxFrameworkFilter - WebxFrameworkFilter - webx: initialization completed
Aug , :: AM org.apache.catalina.startup.HostConfig deployDirectory
INFO: Deploying web application directory /home/hadoop/soft/apache-tomcat-7.0./webapps/manager
Aug , :: AM org.apache.catalina.startup.HostConfig deployDirectory
INFO: Deploying web application directory /home/hadoop/soft/apache-tomcat-7.0./webapps/ROOT
Aug , :: AM org.apache.catalina.startup.HostConfig deployDirectory
INFO: Deploying web application directory /home/hadoop/soft/apache-tomcat-7.0./webapps/examples
Aug , :: AM org.apache.catalina.startup.HostConfig deployDirectory
INFO: Deploying web application directory /home/hadoop/soft/apache-tomcat-7.0./webapps/host-manager
Aug , :: AM org.apache.catalina.startup.HostConfig deployDirectory
INFO: Deploying web application directory /home/hadoop/soft/apache-tomcat-7.0./webapps/docs
Aug , :: AM org.apache.coyote.AbstractProtocol start
INFO: Starting ProtocolHandler ["http-bio-8080"]
Aug , :: AM org.apache.coyote.AbstractProtocol start
INFO: Starting ProtocolHandler ["ajp-bio-8009"]
Aug , :: AM org.apache.catalina.startup.Catalina start
INFO: Server startup in ms
然后可以查看页面进行访问。账号和密码都是root。ip地址就是你的虚拟机部署dubbo包的地址。端口默认是8080。
登录进去就可以看到一些dubbo提供的服务了。
如果dubbo的war包和zookeeer不在一台机器上面,需要修改此配置文件。
待续......
dubbo入门学习的更多相关文章
- dubbo入门学习笔记之入门demo(基于普通maven项目)
注:本笔记接dubbo入门学习笔记之环境准备继续记录; (四)开发服务提供者和消费者并让他们在启动时分别向注册中心注册和订阅服务 需求:订单服务中初始化订单功能需要调用用户服务的获取用户信息的接口(订 ...
- dubbo入门学习笔记之环境准备
粗略的学完springcloud后由于公司的项目有用到一点dubbo,刚好手头上又有dubbo的学习资料,于是趁机相对系统的学了下duboo框架,今天开始记录下我的所学所悟;说来惭愧,今年之前,作为一 ...
- dubbo入门学习 一SOA
SOA是什么?SOA全英文是Service-Oriented Architecture,中文意思是中文面向服务编程,是一种思想,一种方法论,一种分布式的服务架构(具体可以百度). 用途:SOA解决多服 ...
- dubbo入门学习(二)-----dubbo hello world
一.dubbo hello world入门示例 1.提出需求 某个电商系统,订单服务需要调用用户服务获取某个用户的所有地址: 我们现在需要创建两个服务模块进行测试: 模块 功能 订单服务web模块 创 ...
- Dubbo 入门学习笔记
项目结构 模块介绍: DubboAPI ----API接口 DubboConsumer ----消费者 DubboProvider ----生产者 DubboAPI Service 提供的接口 ...
- dubbo入门学习 六 admin管理界面
1. 本质就是一个web项目 2. 获取注册中心内Provider注册的信息.用页面呈现出来. 3. 实现步骤 3.1 把dubbo-admin-2.5.3.war上传到服务器tomcat中. 3.2 ...
- dubbo入门学习 五 provider端的编写
1. 新建Maven Project, 里面只有接口(dubbo-service) 1.1 为什么这么做? RPC框架,不希望Consumer知道具体实现.如果实现类和接口在同一个项目中,Consum ...
- dubbo入门学习 四 注册中心 zookeeper入门
一.Dubbo支持的注册中心 1. Zookeeper 1.1 优点:支持网络集群 1.2 缺点:稳定性受限于Zookeeper 2. Redis 2.1 优点:性能高. 2.2 缺点:对服务器环境要 ...
- dubbo入门学习 三 dubbo简介
http://dubbo.apache.org/zh-cn/docs/user/references/protocol/dubbo.html Dubbo简介 1. Dubbo:一个分布式.高性能.透明 ...
随机推荐
- Android应用图标尺寸以及drawable(ldpi、mdpi、hdpi、xhdpi、xxhdpi)
应用图标: L DPI ( Low Density Screen,120 DPI ),其图标大小为 36 x 36 px M DPI ( Medium Density Screen, 160 DPI ...
- Java生鲜电商平台-电商会员体系系统的架构设计与源码解析
Java生鲜电商平台-电商会员体系系统的架构设计与源码解析 说明:Java生鲜电商平台中会员体系作为电商平台的基础设施,重要性不容忽视.我去年整理过生鲜电商中的会员系统,但是比较粗,现在做一个最好的整 ...
- maven新建项目的几种方式和启动
方式一: 第1步:转到 New 菜单 Other.. -> Maven -> Maven Project ,然后单击 Next .如下图所示 - 第2步:在New Maven Projec ...
- JDK内置工具命令
javap Java反编译工具,主要用于根据Java字节码文件反汇编为Java源代码文件用法:javap 用法 描述 javap -help —help -? 输出此用法消息 javap -versi ...
- 数据库 OR 运维 ____bayaim
最近一直在思考,想想未来的道路和自己努力的方向.马云曾说过现在的年轻人缺少“慢下来”,只有人慢下来才能更好思考,想好方法和目标才更靠近才成功.如果,一直不停的努力,在错误的道路越走越远,势必会浪费时间 ...
- Web服务器—IIS
https://blog.csdn.net/qq_33323054/article/details/81628627 https://jingyan.baidu.com/article/67508eb ...
- liteos CPU占用率(十六)
1. 概述 1.1 基本概念 CPU(中央处理器, Central Processing Unit)占用率可以分为系统CPU占用率和任务CPU占用率两种. 系统CPU占用率(CPU Percent)是 ...
- 如何在VIM中保存编辑的只读文件
我们经常碰到这样的情景:在VIM中编辑了一个系统配置文件,当需要保存时才发现当前的用户对该文件没有写入的权限, 这时候怎么办呢? 当需要保存时,输入以下的命令: :w !sudo tee %
- awk常用命令
1.统计TCP的连接数量,其中LISTEN多少个,ESTABLISHED多少个. [root@heiniao ~]# netstat -ant Active Internet connections ...
- C++ 模板特化、偏特化测试程序
#include <iostream> // 偏特化的模板不会自己添加构造函数 ctor 和 析构函数 dtor #if 1 // P1 template <typename T1, ...