Mybatis uses step-by-step lazy loading to cause abnormal JSON conversion. The interface 500 reports an error

Mybatis USES lazy step loading to cause json conversion exception

  1. anomaly description
    No serializer found for class org. Apache. Ibatis. Executor. Loader. The javassist. JavassistProxyFactory...

  2. solve abnormal * * *

    in distributed query each related bean class add annotation @ JsonIgnoreProperties (value = {} "handler")

  3. reason

    lazy loading is you have to use data will give you query 0, but 1 directly query object 2 into json string will lead to 3 results have not been query out of json4, This is what causes the interface 500 exception. Note : object does not load SQL query, only when output this object is use this data 0 will be 1 query 2 from the database and assign data to dependent object


  4. 4


Read More: