기타

org.springframework.beans.factory.BeanCreationException

hojomu 2023. 4. 18. 10:56

eclipse로 spring 프로젝트의 서버를 실행시켰는데 해당 에러가 발생했다.

org.springframework.beans.factory.BeanCreationException: 
Error creating bean with name 'testMapper' defined in file 
[D:\hojomu\.metadata\.plugins\org.eclipse.wst.server.core\tmp0\wtpwebapps\TEAM_CONTROL_Reservation\WEB-INF\classes\control\project\mapper\TestMapper.class]: 
Invocation of init method failed; nested exception is java.lang.IllegalArgumentException: 
org.apache.ibatis.builder.BuilderException: Error creating document instance.  
Cause: org.xml.sax.SAXParseException; lineNumber: 2; columnNumber: 1; 예기치 않은 파일의 끝입니다.

 

** 해당 에러는 프로젝트 내부에 존재하는 xml파일 중 파일의 형식이 정상적이지 않을 때 발생한다.

 

프로젝트를 git에 처음 commit 할 때, 폴더나 패키지가 비어있으면 업로드 되지 않는 것을 방지하기 위해

빈 파일을 함께 보냈더니 다음과 같은 오류가 발생했다

 

.xml 파일은 꼭 알맞은 형식의 구조를 갖춰두자.