IDE

[이클립스] 톰켓 서버 시작시 Caused by: java.lang.Error: Unresolved compilation problems: 빌드 오류가 발생하는 경우

오랜만에 다른 프로젝트 운영 건에 대한 기능 개선 추가를 하기 위해 톰켓 서버를 재시작하였다.

느닷없이 아래와 같은 오류가 발생하였다.

2022-02-14 14:29:31.083 [localhost-startStop-1] INFO  o.s.b.f.s.DefaultListableBeanFactory - Destroying singletons in
2022-02-14 14:29:31.089 [localhost-startStop-1] ERROR o.s.web.context.ContextLoader - Context initialization failed
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'commonDAO' defined in file [C:Workspace.metadata.pluginsorg.eclipse.wst.server.coretmp0wtpwebappstest_projectWEB-INFclassestestcoredaoCommonDAO.class]: Initialization of bean failed; nested exception is java.lang.Error: Unresolved compilation problems: 
	lientTemplate cannot be resolved to a type
	Syntax error, insert "}" to complete Block

	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:527)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:456)
	at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:293)
	at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:223)
	at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:290)
	at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:191)
	at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:638)
	at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:942)
	at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:482)
	at org.springframework.web.context.ContextLoader.configureAndRefreshWebApplicationContext(ContextLoader.java:410)
	at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:306)
	at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:112)
	at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:5110)
	at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5633)
	at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:145)
	at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1700)
	at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1690)
	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
	at java.lang.Thread.run(Thread.java:748)
Caused by: java.lang.Error: Unresolved compilation problems: 
	lientTemplate cannot be resolved to a type
	Syntax error, insert "}" to complete Block

	at test.core.dao.CommonDAO.setApplicationContext(CommonDAO.java:54)
	at org.springframework.context.support.ApplicationContextAwareProcessor.invokeAwareInterfaces(ApplicationContextAwareProcessor.java:117)
	at org.springframework.context.support.ApplicationContextAwareProcessor.postProcessBeforeInitialization(ApplicationContextAwareProcessor.java:92)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyBeanPostProcessorsBeforeInitialization(AbstractAutowireCapableBeanFactory.java:396)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1507)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:519)
	... 20 common frames omitted
2월 14, 2022 2:29:31 오후 org.apache.catalina.core.StandardContext listenerStart
심각: Exception sending context initialized event to listener instance of class org.springframework.web.context.ContextLoaderListener
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'commonDAO' defined in file [C:Workspace.metadata.pluginsorg.eclipse.wst.server.coretmp0wtpwebappstest_projectWEB-INFclassestestcoredaoCommonDAO.class]: Initialization of bean failed; nested exception is java.lang.Error: Unresolved compilation problems: 
	lientTemplate cannot be resolved to a type
	Syntax error, insert "}" to complete Block

	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:527)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:456)
	at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:293)
	at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:223)
	at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:290)
	at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:191)
	at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:638)
	at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:942)
	at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:482)
	at org.springframework.web.context.ContextLoader.configureAndRefreshWebApplicationContext(ContextLoader.java:410)
	at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:306)
	at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:112)
	at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:5110)
	at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5633)
	at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:145)
	at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1700)
	at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1690)
	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
	at java.lang.Thread.run(Thread.java:748)
Caused by: java.lang.Error: Unresolved compilation problems: 
	lientTemplate cannot be resolved to a type
	Syntax error, insert "}" to complete Block

	at test.core.dao.CommonDAO.setApplicationContext(CommonDAO.java:54)
	at org.springframework.context.support.ApplicationContextAwareProcessor.invokeAwareInterfaces(ApplicationContextAwareProcessor.java:117)
	at org.springframework.context.support.ApplicationContextAwareProcessor.postProcessBeforeInitialization(ApplicationContextAwareProcessor.java:92)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyBeanPostProcessorsBeforeInitialization(AbstractAutowireCapableBeanFactory.java:396)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1507)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:519)
	... 20 more

오류의 주 원인은 다음 내용이다.

Caused by: java.lang.Error: Unresolved compilation problems: 
	lientTemplate cannot be resolved to a type
	Syntax error, insert "}" to complete Block

아무것도 하지 않았는데 이런 오류가 발생하기에 commonDao.java 파일을 열어봐서 확인도 해보고

Git 소스와 동기화 하여 코드가 다른게 있는지 찾아보았으나 없었다.

이클립스 빌드 오류 해결방법

1. 이클립스 상단 메뉴 중에 Project > Clean 메뉴를 클릭


2. 프로젝트 선택 팝업창에서 클린할 프로젝트를 체크
3. Clean 버튼 클릭
4. 다시 아파치 톰켓 서버를 시작하면 오류는 사라진다.

엉뚱한 곳에 삽질하지 말자.

Leave a Reply

error: Content is protected !!