触发环境:
使用fastjson2.0.60的SpringBoot项目、jdk1.8、sqlite3数据库、麒麟V10(arm)桌面版
问题现象:
1、win10上使用idea debug启动项目(java、sqlite3都在windows上),远程连接麒麟V10进行业务操作,一切正常;
2、把sqltie3和java打包部署到Ubuntu24虚拟机上、直接在Ubuntu服务器上进行业务操作,运行也一切正常;
3、相同的jar包和sqlite3数据库文件拷贝到麒麟V10上,直接在麒麟V10上进行业务操作,运行十多分钟后就会出现读取数据库中存储的json字符串反序列化成json对象时出错,出错日志大致如下:
2026-十二月-01 09:12:00.112 ERROR [task-scheduler-10] o.s.i.h.LoggingHandler - org.mybatis.spring.MyBatisSystemException: nested exception is org.apache.ibatis.executor.result.ResultMapException: Error attempting to get column 'params' from result set. Cause: com.alibaba.fastjson2.JSONException: offset 45, character :, line 1, column 45, fastjson-version 2.0.60 {"workMode":"定频","workFreq":"2400","tableNo":"1","netNo":"1","keyNo":"666","power":"50","netMode":"点对点","userRate":"19200"}
at org.mybatis.spring.MyBatisExceptionTranslator.translateExceptionIfPossible(MyBatisExceptionTranslator.java:96)
at org.mybatis.spring.SqlSessionTemplate$SqlSessionInterceptor.invoke(SqlSessionTemplate.java:441)
at com.sun.proxy.$Proxy79.selectList(Unknown Source)
at org.mybatis.spring.SqlSessionTemplate.selectList(SqlSessionTemplate.java:224)
at com.baomidou.mybatisplus.core.override.MybatisMapperMethod.executeForMany(MybatisMapperMethod.java:173)
at com.baomidou.mybatisplus.core.override.MybatisMapperMethod.execute(MybatisMapperMethod.java:78)
at com.baomidou.mybatisplus.core.override.MybatisMapperProxy$PlainMethodInvoker.invoke(MybatisMapperProxy.java:148)
at com.baomidou.mybatisplus.core.override.MybatisMapperProxy.invoke(MybatisMapperProxy.java:89)
at com.sun.proxy.$Proxy84.selectSubNetList(Unknown Source)
at cn.tj666.net.此处省略一行
at cn.tj666.net.此处省略一行
at org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:218)
at org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:687)
at cn.tj666.net.此处省略一行
at cn.tj666.topo.此处省略一行
at cn.tj666.topo.此处省略一行
at sun.reflect.GeneratedMethodAccessor128.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.springframework.scheduling.support.ScheduledMethodRunnable.run(ScheduledMethodRunnable.java:84)
at org.springframework.scheduling.support.DelegatingErrorHandlingRunnable.run(DelegatingErrorHandlingRunnable.java:54)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:308)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(ScheduledThreadPoolExecutor.java:180)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:294)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:750)
排查过程:
1、确认JVM虚拟机、win10和麒麟V10操作系统、sqlite3数据库文件、存储的json字符串编码均为UTF-8;
2、确定相同的jar包、数据文件(纯读取,无写入)、json字符串,在win10和Ubuntu上正常,麒麟V10上必现;
解决方案:
把fastjson2换成jackson,问题解决。
待确认:
不确定是不是fastjson2和aarch64的兼容问题,deepseek了一下,说是aarch64上JIT的行为差异导致的问题,结果如下图:

转载自 CSDN-专业IT技术社区
原文链接:https://blog.csdn.net/zcbdandan/article/details/171725835



