库存服务测试报错

来源:6-39 用户应用子系统 - 优惠券库存服务逻辑校验

qq_西域轩辕_0

2023-04-14

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)));

期待老师的回答

写回答

1回答

张勤一

2024-01-16

这种就看下异常说的是什么
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
0

Java分布式后台开发 Spring Boot+Kafka+HBase

从零到一完整搭建企业级架构的通用卡包工程,让你迈到百度T4+ 。

886 学习 · 221 问题

查看课程