org.codehaus.jackson.map.JsonMappingException: Infinite recursion (StackOverflowError)

前端 未结 5 812
余生分开走
余生分开走 2021-01-21 10:14

I am trying out some very basic webservice. I get this exception everytime I try to return the Prtnr object.

Uncaught exception thrown in one of the service met         


        
5条回答
  •  情书的邮戳
    2021-01-21 10:46

    this is a general serializing issue. you have to break those dependencies using @Transient while writing to xml or json or object stream.

    and you have to wire them back while reading. wiring is done in such method

    class Way{
    list nodes;
    addNode(Node node){
    node.setWay(this);
    nodes.add(node);
    

    }

    }
    

提交回复
热议问题