SSM项目集成Lucene+IKAnalyzer在Junit单元测试中执行异常
2024-09-05 04:36:40
个人博客 地址:http://www.wenhaofan.com/article/20181108132519
问题描述
在项目运行以及main方法中能够正常运行,但是使用junit单元测试时却报如下错误
java.lang.AssertionError: TokenStream implementation classes or at least their incrementToken() implementation must be final
lucene.analysis.TokenStream.assertFinal(TokenStream.java:117)
TokenStream implementation classes or at least their incrementToken() implementation must be final
解决方案
debug至assertFinal() 发现这里断言了clazz的类是否为final 如果不为final则抛出异常,于是将其对应的类改为final类型即可以解决问题,具体原理因时间问题未深究,先记录下解决办法,等以后有空再来debug看看
最新文章
- json文本装换为JSONArray
- GJM : 数据结构 - 轻松看懂机器学习十大常用算法 [转载]
- bootstrapt model 的多罩层,禁用罩层
- js团购倒计时
- oracle 根据汉字返回拼音函数
- HDU 1712 ACboy needs your help 典型的分组背包
- centos 6.4 更新源地址
- dell PowerEdge R720 自动重启分析
- 【2017-03-30】JS-document对象
- ChartControl设置坐标轴范围
- Java_Runtime&;Process&;ProcessBuilder
- ubuntu 创建文件夹和删除文件
- “幕后英雄”之Backing Fields【Microsoft Entity Framework Core随笔】
- 【转】How to initialize a two-dimensional array in Python?
- 深入理解java虚拟机(一)-----java内存区域以及内存溢出异常
- redis跳跃表
- maya2012卸载/安装失败/如何彻底卸载清除干净maya2012注册表和文件的方法
- mac 报错Root chmod operation not permitted on file
- setitimer函数
- 【Kafka】Kafka数据可靠性深度解读
热门文章
- C#实现把String字符串转化为SQL语句中的In后接的参数
- go 算法与数据结构
- warning: LF will be replaced by CRLF in
- oracle分组后取最新的记录
- 【37】池化层讲解(Pooling layers)
- Postman测试上传MultipartFile文件
- 容错保护机制:Spring Cloud Hystrix
- form表单中给input 添加 数量可以增减的按钮
- 论文阅读笔记(二十二)【CVPR2017】:See the Forest for the Trees: Joint Spatial and Temporal Recurrent Neural Networks for Video-based Person Re-identification
- 电脑和手机上常用apk或Pc软件的重要目录或文件或文件夹路径