问题描述:
我是用spring-boot 向redis中写入的数据,然后用jfinal的redis插件取值,出现异常。
初步判断应该是序列化方式不同。
请问这样的情况该如何取值?
异常信息:
java.lang.RuntimeException: java.io.IOException: java.lang.NullPointerException at com.jfinal.plugin.redis.serializer.FstSerializer.valueFromBytes(FstSerializer.java:78) at com.jfinal.plugin.redis.Cache.valueFromBytes(Cache.java:1211) at com.jfinal.plugin.redis.Cache.get(Cache.java:91) at com.xinzhuzhang.qianghuopro.controller.inner.WXController.test(WXController.java:26) 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 com.jfinal.aop.Invocation.invoke(Invocation.java:73) at com.xinzhuzhang.qianghuopro.interceptor.GlobalActionExceptionInterceptor.intercept(GlobalActionExceptionInterceptor.java:20) at com.jfinal.aop.Invocation.invoke(Invocation.java:67) at com.jfinal.core.ActionHandler.handle(ActionHandler.java:74) at com.xinzhuzhang.qianghuopro.handler.APINOPageErrorHandler.handle(APINOPageErrorHandler.java:26) at com.xinzhuzhang.qianghuopro.handler.APIVersionHandler.handle(APIVersionHandler.java:48) at com.xinzhuzhang.qianghuopro.handler.FakeStaticHandler.handle(FakeStaticHandler.java:17) at com.jfinal.core.JFinalFilter.doFilter(JFinalFilter.java:72) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:240) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:207) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:212) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:106) at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:502) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:141) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:79) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:88) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:522) at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1095) at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:672) at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1502) at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.run(NioEndpoint.java:1458) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) at java.lang.Thread.run(Thread.java:748) Caused by: java.io.IOException: java.lang.NullPointerException at org.nustaq.serialization.FSTObjectInput.readObject(FSTObjectInput.java:243) at com.jfinal.plugin.redis.serializer.FstSerializer.valueFromBytes(FstSerializer.java:75) ... 32 more Caused by: java.lang.NullPointerException at org.nustaq.serialization.FSTObjectInput.readObjectWithHeader(FSTObjectInput.java:353) at org.nustaq.serialization.FSTObjectInput.readObjectInternal(FSTObjectInput.java:327) at org.nustaq.serialization.FSTObjectInput.readObject(FSTObjectInput.java:307) at org.nustaq.serialization.FSTObjectInput.readObject(FSTObjectInput.java:241) ... 33 more
项目:JFinal