뚜껑뚜
Magnolia
뚜껑뚜
전체 방문자
오늘
어제
  • 분류 전체보기 (31)
    • 웹 개발 (2)
      • Java (0)
      • Spring Boot (0)
      • JPA (0)
      • JavaScript (1)
      • jQuery (1)
      • Mustache (0)
      • MyBatis (0)
    • DB (0)
    • CS (1)
      • HTTP (0)
      • etc (1)
    • 오류 로그 (19)
    • ETC (8)
    • 백엔드 로드맵 (0)
    • 개인 프로젝트 (1)
      • XYAB (1)
    • Diary (0)

블로그 메뉴

  • 홈
  • 태그
  • 방명록
  • 글쓰기
  • 관리

공지사항

인기 글

태그

  • get
  • Thymeleaf
  • post
  • HTTP
  • 인텔리제이
  • 헤더
  • JPA
  • 어댑터
  • Servlet
  • 타임리프
  • View
  • MVC
  • 컨트롤러
  • 로그인
  • 서블릿
  • URI
  • jquery
  • 프로젝트
  • Security
  • 자바스크립트

최근 댓글

최근 글

티스토리

hELLO · Designed By 정상우.
뚜껑뚜

Magnolia

AnnotationConfigApplicationContext@4dbb42b7 has not been refreshed yet
오류 로그

AnnotationConfigApplicationContext@4dbb42b7 has not been refreshed yet

2022. 1. 1. 17:16

에러 발생 상황


public class ComponentFilterAppConfigTest {

    @Test
    void filterScan() {
        AnnotationConfigApplicationContext ac = new AnnotationConfigApplicationContext();
        BeanA beanA = ac.getBean("beanA", BeanA.class);
        assertThat(beanA).isNotNull();
    }

    @Configuration
    @ComponentScan(
            includeFilters = @Filter(type = FilterType.ANNOTATION, classes = MyIncludeComponent.class),
            excludeFilters = @Filter(type = FilterType.ANNOTATION, classes = MyExcludeComponent.class)
    )
    static class ComponentFilterAppConfig {
    }

}

위의 코드 강의 실습 중 테스트를 실행했더니 아래와 같은 오류가 발생했다.

 

문제 파악


자세히 보니 AnnotationConfigApplicationContext(); 괄호에 파라미터로 클래스를 지정 안 해줬다.

 

문제 해결


AnnotationConfigApplicationContext ac = new AnnotationConfigApplicationContext(ComponentFilterAppConfig.class);

클래스를 지정해줬더니 잘 실행된다.

'오류 로그' 카테고리의 다른 글

인텔리제이 properties 한글 깨짐  (0) 2022.01.21
인텔리제이에서 특정 파일명의 확장자를 다르게 인식할 때  (0) 2022.01.17
인텔리제이 콘솔창 한글 깨짐  (0) 2022.01.08
인텔리제이 org.thymeleaf.exceptions.TemplateInputException  (0) 2021.12.18
인텔리제이 org.opentest4j.AssertionFailedError  (0) 2021.12.16
    '오류 로그' 카테고리의 다른 글
    • 인텔리제이에서 특정 파일명의 확장자를 다르게 인식할 때
    • 인텔리제이 콘솔창 한글 깨짐
    • 인텔리제이 org.thymeleaf.exceptions.TemplateInputException
    • 인텔리제이 org.opentest4j.AssertionFailedError
    뚜껑뚜
    뚜껑뚜

    티스토리툴바