2013-10-23 3 views
0

오류는 다음과 같습니다오류 만드는 형태 콩

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) 

가능한 오류 무엇입니까?

+0

무한 재귀가 있습니다. –

답변

1

스택 추적에서 각 StudentStructure에는 필드가 있고 필드를 초기화하고 StudentStructure을 초기화합니다. 이로 인해 무한 재귀가 발생합니다.

+0

고마워요! ;)이 StudentContactInfoStructure 연락처 = 새 StudentContactInfoStructure(); 내 StudentStructure. 또한 재귀를 일으키는 StudentContactInfoStructure에서 StudentStructure를 초기화합니다. : D 나는 그것들을 지웠고 나의 코드는 잘 동작했다. 감사! :) 큰 도움. ;) – Clem

1

코드 밖으로 포인트를 고정하기가 어렵습니다. 하지만 stacktrace에서 내 추측을 추가하면 StudentStructure 내부에 StudentContactInfoStructure의 생성자를 초기화하고 StudentContactInfoStructure 내부에 StudentStructure의 생성자를 초기화하려고합니다. 따라서 무한 루프 호출 및 throw stackoverflow 오류가 발생합니다

+0

고마워요. 그것을 확인하십시오. ;) – Clem

+0

고마워요! ;)이 StudentContactInfoStructure 연락처 = 새 StudentContactInfoStructure(); 내 StudentStructure. 또한 재귀를 일으키는 StudentContactInfoStructure에서 StudentStructure를 초기화합니다. : D 나는 그것들을 지웠고 나의 코드는 잘 동작했다. 감사! :) 큰 도움. ;) – Clem