eGovFrame 표준프레임워크 포털

메뉴 건너띄기
상단메뉴 바로가기
본문 바로가기

이 누리집은 대한민국 공식 전자정부 누리집입니다.

본문 영역

적용 지원, FAQ, Q&A 게시판을 통해 기술 문제 해결을 지원합니다.

묻고 답하기

controller annotaition 설정
  • 작성자

    허*목

  • 작성일

    2012-04-25 10:31:33

  • 조회수

    1,975

  • 구분

    개발환경

  • 진행상태

    완료

질문

표준프레임워크을 기반을 개발을 진행하고 있습니다.

프로그램을 추가하고 톰캣을 스타트 하면 아래와 같은 에러가 납니다.

org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'mngmOrgController': Injection of resource dependencies failed; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No bean named 'mngmOrgService' is defined

Controller Autodetect가 안되어 발생하는 것으로 보이는데요.


dipatcher-servlet.xml에 아래와 같이 추가해도 마찬가지로 에러가 납니다.

<!--
- The controllers are autodetected POJOs labeled with the @Controller annotation.
-->
<context:component-scan base-package="egovframework">
<context:include-filter type="annotation" expression="org.springframework.stereotype.Controller"/>
<context:exclude-filter type="annotation" expression="org.springframework.stereotype.Service"/>
<context:exclude-filter type="annotation" expression="org.springframework.stereotype.Repository"/>
</context:component-scan>

<context:component-scan base-package="sycns.ea.mngm">
<context:include-filter type="annotation" expression="org.springframework.stereotype.Controller"/>
<context:exclude-filter type="annotation" expression="org.springframework.stereotype.Service"/>
<context:exclude-filter type="annotation" expression="org.springframework.stereotype.Repository"/>
</context:component-scan>

다른 설정이 있는지 또는 잘못된 부분이 어딘지 도움바랍니다.

또, 설정과 관련한 자료가 있다면 추가 바랍니다.

답변

안녕하세요.. 허홍목님..

<context:component-scan base-package="egovframework,sycns.ea.mngm">와 같이..

하나의 설정으로 통합하셔야 할 것 같습니다.

","에 공백이 없이 대상 패키지를 지정하시면 됩니다.

그럼.. 즐거운 하루되십시오.
감사합니다.

이 페이지의 구성

묻고 답하기