1、RuntimeException错误

 java.lang.RuntimeException: org.apache.ibatis.binding.BindingException: Invalid bound statement (not found): cn.thyonline.taotao.search.mapper.SearchItemMapper.SearchItemList

 org.apache.ibatis.binding.BindingException: Invalid bound statement (not found): cn.thyonline.taotao.search.mapper.SearchItemMapper.SearchItemList

          at org.apache.ibatis.binding.MapperMethod$SqlCommand.<init>(MapperMethod.java:189)

          at org.apache.ibatis.binding.MapperMethod.<init>(MapperMethod.java:43)

          at org.apache.ibatis.binding.MapperProxy.cachedMapperMethod(MapperProxy.java:58)

          at org.apache.ibatis.binding.MapperProxy.invoke(MapperProxy.java:51)

          at com.sun.proxy.$Proxy34.SearchItemList(Unknown Source)

          at cn.thyonline.taotao.search.service.impl.SearchItemServiceImpl.importAllItems(SearchItemServiceImpl.java:24)

          at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

          at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)

          at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

          at java.base/java.lang.reflect.Method.invoke(Method.java:564)

          at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:302)

          at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:190)

          at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:157)

          at org.springframework.transaction.interceptor.TransactionInterceptor$1.proceedWithInvocation(TransactionInterceptor.java:99)

          at org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:281)

          at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:96)

          at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)

          at org.springframework.transaction.interceptor.TransactionInterceptor$1.proceedWithInvocation(TransactionInterceptor.java:99)

          at org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:281)

          at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:96)

          at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)

          at org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:92)

          at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)

          at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:208)

          at com.sun.proxy.$Proxy35.importAllItems(Unknown Source)

          at com.alibaba.dubbo.common.bytecode.Wrapper0.invokeMethod(Wrapper0.java)

          at com.alibaba.dubbo.rpc.proxy.javassist.JavassistProxyFactory$1.doInvoke(JavassistProxyFactory.java:46)

          at com.alibaba.dubbo.rpc.proxy.AbstractProxyInvoker.invoke(AbstractProxyInvoker.java:72)

          at com.alibaba.dubbo.rpc.protocol.InvokerWrapper.invoke(InvokerWrapper.java:53)

          at com.alibaba.dubbo.rpc.filter.ExceptionFilter.invoke(ExceptionFilter.java:64)

          at com.alibaba.dubbo.rpc.protocol.ProtocolFilterWrapper$1.invoke(ProtocolFilterWrapper.java:91)

          at com.alibaba.dubbo.monitor.support.MonitorFilter.invoke(MonitorFilter.java:75)

          at com.alibaba.dubbo.rpc.protocol.ProtocolFilterWrapper$1.invoke(ProtocolFilterWrapper.java:91)

          at com.alibaba.dubbo.rpc.filter.TimeoutFilter.invoke(TimeoutFilter.java:42)

          at com.alibaba.dubbo.rpc.protocol.ProtocolFilterWrapper$1.invoke(ProtocolFilterWrapper.java:91)

          at com.alibaba.dubbo.rpc.protocol.dubbo.filter.TraceFilter.invoke(TraceFilter.java:78)

          at com.alibaba.dubbo.rpc.protocol.ProtocolFilterWrapper$1.invoke(ProtocolFilterWrapper.java:91)

          at com.alibaba.dubbo.rpc.filter.ContextFilter.invoke(ContextFilter.java:60)

          at com.alibaba.dubbo.rpc.protocol.ProtocolFilterWrapper$1.invoke(ProtocolFilterWrapper.java:91)

          at com.alibaba.dubbo.rpc.filter.GenericFilter.invoke(GenericFilter.java:112)

          at com.alibaba.dubbo.rpc.protocol.ProtocolFilterWrapper$1.invoke(ProtocolFilterWrapper.java:91)

          at com.alibaba.dubbo.rpc.filter.ClassLoaderFilter.invoke(ClassLoaderFilter.java:38)

          at com.alibaba.dubbo.rpc.protocol.ProtocolFilterWrapper$1.invoke(ProtocolFilterWrapper.java:91)

          at com.alibaba.dubbo.rpc.filter.EchoFilter.invoke(EchoFilter.java:38)

          at com.alibaba.dubbo.rpc.protocol.ProtocolFilterWrapper$1.invoke(ProtocolFilterWrapper.java:91)

          at com.alibaba.dubbo.rpc.protocol.dubbo.DubboProtocol$1.reply(DubboProtocol.java:108)

          at com.alibaba.dubbo.remoting.exchange.support.header.HeaderExchangeHandler.handleRequest(HeaderExchangeHandler.java:84)

          at com.alibaba.dubbo.remoting.exchange.support.header.HeaderExchangeHandler.received(HeaderExchangeHandler.java:170)

          at com.alibaba.dubbo.remoting.transport.DecodeHandler.received(DecodeHandler.java:52)

          at com.alibaba.dubbo.remoting.transport.dispatcher.ChannelEventRunnable.run(ChannelEventRunnable.java:82)

          at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1135)

          at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)

          at java.base/java.lang.Thread.run(Thread.java:844)

但是查看target文件发现查看报错信息可以看见是mapper绑定无效

Mapper文件已经放置在一个文件夹,再检查两个文件发现是select语句的ID没有对应上

2、请求超时错误

 com.alibaba.dubbo.rpc.RpcException: Failed to invoke the method importAllItems in the service cn.thyonline.taotao.search.service.SearchItemService. Tried 3 times of the providers [192.168.199.139:20882] (1/1) from the registry 192.168.25.128:2181 on the consumer 192.168.199.139 using the dubbo version 2.5.3. Last error is: Invoke remote method timeout. method: importAllItems, provider: dubbo://192.168.199.139:20882/cn.thyonline.taotao.search.service.SearchItemService?anyhost=true&application=taotao-manager-web&check=false&dubbo=2.5.3&interface=cn.thyonline.taotao.search.service.SearchItemService&methods=importAllItems&pid=3208&revision=0.0.1-SNAPSHOT&side=consumer&timestamp=1528390391677, cause: Waiting server-side response timeout. start time: 2018-06-08 00:53:16.967, end time: 2018-06-08 00:53:17.968, client elapsed: 0 ms, server elapsed: 1001 ms, timeout: 1000 ms, request: Request [id=2, version=2.0.0, twoway=true, event=false, broken=false, data=RpcInvocation [methodName=importAllItems, parameterTypes=[], arguments=[], attachments={path=cn.thyonline.taotao.search.service.SearchItemService, interface=cn.thyonline.taotao.search.service.SearchItemService, version=0.0.0}]], channel: /192.168.199.139:11038 -> /192.168.199.139:20882

Web层请求超时

但是检查search层在查询数据库前后打印

 System.out.println("开始查询商品!");

 List<SearchItem> items = mapper.searchItemList();

 //2、创建solrServer对象,将商品信息通过SolrInputDocument存入

 System.out.println("查询到的商品数量:"+items.size());

并且打印出来了数据说明mapper映射文件也没有问题。重新开始测试,发现后台两条数据都打印了出来,证明请求从controller层传递到了service层,dubbo连接没有问题。

那证明一件事情就是这次连接因为要连接solr导致耗时很长,使得超出了dubbo的默认连接时间从而失败,修改dubbo在service层和controller层的配置:

 <!-- 名字不能够重复,和随便,用于计算依赖关系,服务调用的情况 -->

     <dubbo:application name="taotao-search" />

     <!-- 使用zookeeper注册协议  -->

     <dubbo:registry protocol="zookeeper" address="192.168.25.128:2181" />

     <!-- 使用dubbo协议,暴露服务的端口 -->

     <dubbo:protocol name="dubbo" port="20882" />

     <!-- 发布服务 -->

     <dubbo:service interface="cn.thyonline.taotao.search.service.SearchItemService" ref="searchItemServiceImpl"  timeout="300000"/>

查看solr数据修改连接超时为5分钟,再次测试,连接成功

Solr数据导入成功

分布式网上商城项目-solr搜索功能错误的更多相关文章

  1. 分布式网上商城项目-dubbo搭建与初次使用错误

    1.Spring-service启动失败 严重: Exception sending context initialized event to listener instance of class o ...

  2. 分布式网上商城项目- BeanDefinitionStoreException

    BeanDefinitionStoreException: 严重: StandardWrapper.Throwable org.springframework.beans.factory.BeanDe ...

  3. 【SSH网上商城项目实战27】域名空间的申请和项目的部署及发布

     转自:https://blog.csdn.net/wwww_com/article/details/54405355 前面陆陆续续的完成了网上商城的一些基本功能,虽然还有很多地方有待完善,但是不影响 ...

  4. 【SSH网上商城项目实战21】从Demo中看易宝支付的流程

         转自: https://blog.csdn.net/eson_15/article/details/51447492 这一节我们先写一个简单点的Demo来测试易宝支付的流程,熟悉这个流程后, ...

  5. 新巴巴运动网上商城 项目 快速搭建 教程 The new babar sports online mall project quickly builds a tutorial

    新巴巴运动网上商城 项目 快速搭建 教程 The new babar sports online mall project quickly builds a tutorial 作者:韩梦飞沙 Auth ...

  6. 【SSH网上商城项目实战16】Hibernate的二级缓存处理首页的热门显示

    转自:https://blog.csdn.net/eson_15/article/details/51405911 网上商城首页都有热门商品,那么这些商品的点击率是很高的,当用户点击某个热门商品后需要 ...

  7. 商城06——solr索引库搭建&solr搜索功能实现&图片显示问题解决

    1.   课程计划 1.搜索工程的搭建 2.linux下solr服务的搭建 3.Solrj使用测试 4.把数据库中的数据导入索引库 5.搜索功能的实现 2.   搜索工程搭建 要实现搜索功能,需要搭建 ...

  8. 【SSH网上商城项目实战30】项目总结

      转自:https://blog.csdn.net/eson_15/article/details/51479994 0. 写在前面 项目基本完成了,加上这个总结,与这个项目相关的博客也写了30篇了 ...

  9. 【SSH网上商城项目实战30】项目总结(附源码下载地址)

    项目基本完成了,加上这个总结,与这个项目相关的博客也写了30篇了,积少成多,写博客的过程是固化思路的一个过程,对自己很有用,同时也能帮助别人.顺便说个题外话,在学习的过程中肯定会遇到很多异常出现,我们 ...

随机推荐

  1. 关于Function原型对象和Object原型对象的一些疑惑

    网上有一道美团外卖的面试题是这样的: Function.prototype.a = 'a'; Object.prototype.b = 'b'; function Person(){}; var p ...

  2. <Android 应用 之路> 百度地图API使用(1)

    简介 详情请看百度地图官方网站 http://lbsyun.baidu.com/index.php?title=androidsdk/guide/introduction 使用方式 申请密钥,针对移动 ...

  3. [小北De编程手记] : Lesson 04 - Selenium For C# 之 API 上

    这一部分,我准备向大家介绍Selenium WebDriver的常用API,学习这部分内容需要大家最好有一些简单的HTML相关知识,本文主要涉及到以下内容: Selenium API:元素检查 Sel ...

  4. 浅谈JavaScript之function用括号包起来

    (function a(){}) (命名函数表达式)会返回这个函数(不会执行),但是在括号外面无法调用该函数,需要一个变量接收这个函数,var fun = (function a(){}),一般这个用 ...

  5. mysql创建用户授权

    服务器上好多库,为了不让某用户误操作别人的数据库,给他单独建个用户并授权. insert into mysql.user(Host,User,Password, ssl_cipher, x509_is ...

  6. Fiddler给网站“优化”

    最近访问某知名网站的速度非常慢,有时候需要2分钟还没完全打开,页面展示了一半就卡住,然后等半天才继续显示下面部分.这种情况已经有几个月了,不知道是他们服务器原因还是我所在网络的问题,但是基本上在其他网 ...

  7. Windows下 Mysql启动报1067解决方法

    前几天刚入职安装了一下Mysql  刚开始能打开  今天去公司发现启动不了服务 报1067错误, 在网上查看了一些方法,好多种版本..以下是本人的解决方法 1.打开运行-事件查看器--Windows日 ...

  8. c# 依赖注入之---反射(转)

    详细请看http://www.cnblogs.com/leoo2sk/archive/2009/06/17/1504693.html 定义一个接口,和两个类(实现该接口) IButton: using ...

  9. ubuntu配置(娱乐工作)

    因为目前没有使用ubuntu作为工作的电脑(mac还是好用),所以暂时记录一下别人分享的ubuntu常用软件: 输入法:搜狗输入法 虚拟机:virtualbox 浏览器:chromium ide:id ...

  10. 使用POI解析Excel时,出现org.xml.sax.SAXParseException: duplicate attribute 'o:relid'的解决办法

    1.使用org.apache.poi解析excle,.xlsx类型文件InputStream is = new FileInputStream(strFileName);XSSFWorkbook wb ...