Actually. I made a mistake when calling a function at the DaO layer. I called myself.
A java. Lang. stackoverflowerror error occurs in the recently executed project. After a long time, I also asked experts and checked information. Finally, the problem is solved! Special record!
Stackoverflowerror is because the current thread's stack is fullWhich is caused by too many function call levels.
For example, dead recursion.
For example:
Public String homepage (){
This. findallnews ();
Return "shouye ";
}
PublicString findallnews (){
List newslist = hotnewsservice. findall ();
HotnewsdtoHotnews = (hotnewsdto) newslist. Get (0); // get the first news
Stringcontent = hotnews. getcontent ();
Stringsubcontent = content. substring (0, 80); // the content of this news clip is displayed on the homepage.
Super. setrequestattribute ("hotnews", hotnews );
Super. setrequestattriist ("newslist", newslist );
Super. setrequestattribute ("subcontent", subcontent );
Return homepage;
}
A method called like a red mark is equivalent to an infinite loop!
Solution:
I used to set the return value of the findallnews method to void.