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. [小北De编程手记] : Lesson 05 - Selenium For C# 之 API 下

    上一篇,我们介绍了一些Selenium WebDriver相关的API,下面我们就接着上一篇继续介绍Selenium常用的API,这一篇的内容主要涉及到以下话题: Selenium API:复杂事件处 ...

  2. ArcGIS DataStore手册——入门篇

    第一章:ArcGIS DataStore入门 1.ArcGIS DataStore简介 ArcGIS DataStore是ArcGIS10.3推出来的一个全新的组件,它是一个关系型数据库管理系统,用于 ...

  3. vue2.0中的watch和计算属性computed

    watch和computed均可以监控程序员想要监控的对象,当这些对象发生改变之后,可以触发回调函数做一些逻辑处理 watch监控自身属性变化 <!DOCTYPE html> <ht ...

  4. 目前比较全的CSS重设(reset)方法总结(转)

    原文地址 在当今网页设计/开发实践中,使用CSS来为语义化的(X)HTML标记添加样式风格是重要的关键.在设计师们的梦想中都存在着这样的一个完美世界:所有的浏览器都能够理解和适用多有CSS规则,并且呈 ...

  5. Log4Net使用教程

    简介 为方便跟踪程序运行情况,我们可以记录系统运行异常日志,winform和web都可以通过继承异常或者try来实现. 官方网站:http://logging.apache.org/log4net/ ...

  6. centos中从源程序升级python方法

    http://www.cnblogs.com/sky20081816/p/3441920.html 1 .wget http://python.org/ftp/python/2.7.3/Python- ...

  7. ORACLE 角色授权

    直接例子: 1.CREATE USER 用户名 identified by 密码 default tablespace 表空间名;GRANT CONNECT TO 用户名; GRANT RESOURC ...

  8. Python学习---协程 1226

    协程[是一个单线程],又称微线程,纤程.英文名Coroutine. 一句话说明什么是协程:协程是一种用户态的轻量级线程[程序员自己去切换线程] 协程条件: 必须在只有一个单线程里实现并发 修改共享数据 ...

  9. js漂浮广告实现代码(合集经典)

    <html> <head> <title>漂浮广告</title> <body> <div id="codefans_net ...

  10. yii2.0查询关联数据以及widgets小部件

    怎样去查询关联数据呢,接下来整理一个简单的代码: