Caused by: java.lang.ClassNotFoundException: egovframework.com.cmm.EgovMessageSource
http://okky.kr/article/281867 참조하였음.
자신의 메이븐 디렉토리 (나같은 경우 ~/fnel159/.m2) 에서 egovframework\rte\egovframework.rte.fdl.cmmn을 삭제한다.
이후 프로젝트 우클릭 -> [Run as] -> [maven clean]
프로젝트 우클릭 -> [Run as] -> [maven build]
한 뒤 실행하니 오류가 사라졌다.
서버는 정상구동되고 context 파일도 제대로 로드된다.
context-mapper.xml 파일에
<bean id="sqlSession" class="org.mybatis.spring.SqlSessionFactoryBean">
<property name="dataSource" ref="dataSource"></property>
<property name="mapperLocations" value="classpath:/egovframework/sqlmap/mappers/**/*.xml" />
</bean>
<bean class="egovframework.rte.psl.dataaccess.mapper.MapperConfigurer">
<property name="basePackage" value="com.inhatc.pms.**.mapper" />
</bean>
와 같이 @Mapper와 @Resource를 사용하려고 위처럼 설정했다.
그런데 Mapper 인터페이스에 @Mapper("testMapper")와 같이 선언한 뒤
호출부에서 @Resource(name="testMapper")를 했는데.... 의존성 주입이 안된다.
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'testService': Injection of resource dependencies failed; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No bean named 'testMapper' is defined
Caused by: org.springframework.beans.factory.NoSuchBeanDefinitionException: No bean named 'testMapper' is defined
와 같은 에러가 나타났다. 그런데
<property name="basePackage" value="com.inhatc.pms.**.mapper" />에서 베이스패키지 경로가 잘못된거였다;
<property name="basePackage" value="com.inhatc.pms.web" /> 으로 바꿔서 해결.
가끔 엉뚱하게 멍청한 짓을 한다...
'Web > Spring Framework' 카테고리의 다른 글
스프링부트. @ControllerAdvice를 이용한 HTML과 JSON 요청에 대한 예외 처리 (1) | 2017.12.31 |
---|---|
mybatis에서 mssql 프로시저 호출 시 raise error을 catch하지 못하는 경우 (0) | 2017.05.05 |