请稍等 ...
×

采纳答案成功!

向帮助你的同学说点啥吧!感谢那些助人为乐的人

库存服务测试报错

2023-04-14 11:15:35.372 INFO 8184 — [vicat.com:2181)] org.apache.zookeeper.ClientCnxn : Session establishment complete on server activate.navicat.com/127.0.0.1:2181, sessionid = 0x1877d3b038b0019, negotiated timeout = 120000

com.spring4all.spring.boot.starter.hbase.api.HbaseSystemException: Date and Patterns must not be null; nested exception is java.lang.IllegalArgumentException: Date and Patterns must not be null

at com.spring4all.spring.boot.starter.hbase.api.HbaseTemplate.execute(HbaseTemplate.java:60)
at com.spring4all.spring.boot.starter.hbase.api.HbaseTemplate.find(HbaseTemplate.java:91)
at com.czg.passbook.service.impl.IncentoryServiceImpl.getAvailablePassTemplate(IncentoryServiceImpl.java:96)
at com.czg.passbook.service.impl.IncentoryServiceImpl.getInventoryInfo(IncentoryServiceImpl.java:63)
at com.czg.passbook.service.InventoryServiceTest.testGetInventoryInfo(InventoryServiceTest.java:27)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50)
at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)

在执行这一步的时候报错:
List validTemplates = hbaseTemplate.find(
Constants.PassTemplate.TABLE_NAME, scan, new PassTemplateRowMapper());

如果下面的这个filter 用我注释掉的代码的话,不会报错,但是查不出来值,用老师在视屏里的这种写法的话直接宝上面的错

filterList.addFilter(
new SingleColumnValueFilter(
Bytes.toBytes(Constants.PassTemplate.FAMILY_C),
Bytes.toBytes(Constants.PassTemplate.LIMIT),
CompareFilter.CompareOp.GREATER,
//Bytes.toBytes(“0”)));
new LongComparator(0l)));

期待老师的回答

正在回答 回答被采纳积分+3

1回答

张勤一 2024-01-16 15:55:57

这种就看下异常说的是什么
com.spring4all.spring.boot.starter.hbase.api.HbaseSystemException: Date and Patterns must not be null; nested exception is java.lang.IllegalArgumentException: Date and Patterns must not be null
这就是这两个字段没有填写,不能查询

1 回复 有任何疑惑可以回复我~
问题已解决,确定采纳
还有疑问,暂不采纳
微信客服

购课补贴
联系客服咨询优惠详情

帮助反馈 APP下载

慕课网APP
您的移动学习伙伴

公众号

扫描二维码
关注慕课网微信公众号