错误是:
10:44:18,520 INFO [STDOUT] - Error creating form bean of class com.getcare.crud.web.StudentForm
java.lang.StackOverflowError
at com.getcare.remote.Structure.<init>(Structure.java:8)
at com.getcare.crud.remote.StudentStructure.<init>(StudentStructure.java:15)
at com.getcare.crud.remote.StudentContactInfoStructure.<init>(StudentContactInfoStructure.java:21)
at com.getcare.crud.remote.StudentStructure.<init>(StudentStructure.java:21)
at com.getcare.crud.remote.StudentContactInfoStructure.<init>(StudentContactInfoStructure.java:21)
at com.getcare.crud.remote.StudentStructure.<init>(StudentStructure.java:21)
有什么可能的错误?
最佳答案
从堆栈跟踪中,似乎每个StudentStructure
都有一个字段并初始化StudentContactInfoStructure
,后者又有一个字段并初始化StudentStructure
。这将导致无限递归。