import org.apache.solr.client.solrj.SolrQuery;
public class Test {
public static void main(String[] args) {
SolrQuery solrQuery = new SolrQuery();
System.out.println(JSONObject.toJSONString(solrQuery, SerializerFeature.DisableCircularReferenceDetect, SerializerFeature.WriteNullBooleanAsFalse));
}
}
Exception in thread "main" java.lang.StackOverflowError
at org.apache.solr.common.params.ModifiableSolrParams.getParameterNames(ModifiableSolrParams.java:202)
at org.apache.solr.client.solrj.SolrQuery.getCopy(SolrQuery.java:1181)
at com.alibaba.fastjson.serializer.ASMSerializer_1_SolrQuery.writeDirectNonContext(Unknown Source)
at com.alibaba.fastjson.serializer.ASMSerializer_1_SolrQuery.writeDirectNonContext(Unknown Source)
1、fastjson 最新版本,1.2.51(测试了多个版本)
2、Solr 7.5.0(测试了多个版本)
测试发现使用Gson正常序列化
java版本:1.8,1.7都测试过
机器:linux,mac 都有出现
@wenshao
暂无答案!
目前还没有任何答案,快来回答吧!