복붙노트

[SPRING] Spring에서 'Rejected bean name - URL 경로가 식별되지 않음'을 처리하는 방법?

SPRING

Spring에서 'Rejected bean name - URL 경로가 식별되지 않음'을 처리하는 방법?

나는 Spring Boot Application을 가지고 있으며 다음과 같은 메시지를 시작한다.

7701 [main] DEBUG o.s.w.s.h.BeanNameUrlHandlerMapping - Rejected bean name 'org.springframework.context.annotation.internalConfigurationAnnotationProcessor': no URL paths identified
7701 [main] DEBUG o.s.w.s.h.BeanNameUrlHandlerMapping - Rejected bean name 'org.springframework.context.annotation.internalAutowiredAnnotationProcessor': no URL paths identified
7701 [main] DEBUG o.s.w.s.h.BeanNameUrlHandlerMapping - Rejected bean name 'org.springframework.context.annotation.internalRequiredAnnotationProcessor': no URL paths identified
7701 [main] DEBUG o.s.w.s.h.BeanNameUrlHandlerMapping - Rejected bean name 'org.springframework.context.annotation.internalCommonAnnotationProcessor': no URL paths identified
7701 [main] DEBUG o.s.w.s.h.BeanNameUrlHandlerMapping - Rejected bean name 'org.springframework.context.annotation.internalPersistenceAnnotationProcessor': no URL paths identified
7701 [main] DEBUG o.s.w.s.h.BeanNameUrlHandlerMapping - Rejected bean name 'application': no URL paths identified
7701 [main] DEBUG o.s.w.s.h.BeanNameUrlHandlerMapping - Rejected bean name 'org.springframework.context.annotation.ConfigurationClassPostProcessor.importAwareProcessor': no URL paths identified
7701 [main] DEBUG o.s.w.s.h.BeanNameUrlHandlerMapping - Rejected bean name 'org.springframework.context.annotation.ConfigurationClassPostProcessor.enhancedConfigurationProcessor': no URL paths identified
7702 [main] DEBUG o.s.w.s.h.BeanNameUrlHandlerMapping - Rejected bean name 'bookingController': no URL paths identified

이것은 모든 @Autowired가 내 앱에서 사용한 모든 것에 대해 발생합니다.

내 응용 프로그램의 유일한 구성은 다음과 같습니다.

@SpringBootApplication
public class Application {
    public static void main(String[] args) {
        SpringApplication.run(Application.class, args);
    }
}

왜 내가 그 메시지를 받는지 아는 어떤 아이디어?

나는 그 메시지들 후에 google을 시도하고 다른 사람들은 기본 애노테이션 핸들러와 내가 정의하지 않은 커스텀 애노테이션 핸들러 사이에 충돌이있을 것이라고 말했다.

그건 내 gradle 종속성

dependencies {
    compile('org.springframework.boot:spring-boot-autoconfigure')
    compile('org.springframework.boot:spring-boot-starter-web')
    compile("org.springframework.boot:spring-boot-starter-data-rest")
    compile('org.springframework.boot:spring-boot-starter-data-jpa')
    compile('com.fasterxml.jackson.datatype:jackson-datatype-jsr310:2.6.1')
    compile('org.springframework.boot:spring-boot-starter-security')
    compile("mysql:mysql-connector-java:5.1.34")

    testCompile("junit:junit")
    testCompile("org.springframework.boot:spring-boot-starter-test")
    testCompile("com.jayway.jsonpath:json-path")
    testCompile("com.jayway.jsonpath:json-path-assert:0.9.1")
}

내 클래스 패스에는 이런 경우가있을 수있는 설정이 없습니다.

해결법

  1. ==============================

    1.코멘트에서 언급했듯이, 이것은 디버그 메시지이며 어떠한 조치도 취할 필요가 없습니다.

    코멘트에서 언급했듯이, 이것은 디버그 메시지이며 어떠한 조치도 취할 필요가 없습니다.

    관심있는 사람들을 위해 다음과 같은 세부 정보가 있습니다.

    시작시 HandlerMapping이 실행되어 요청과 핸들러 객체 간의 매핑을 결정합니다. AbstractDetectingUrlHandlerMapping 클래스에는 현재 ApplicationContext에서 발견 된 모든 핸들러를 등록하는 detectHandlers 메소드가 있습니다. 빈을 반복 할 때 URL 경로가 식별되지 않은 빈은 거부됩니다.

    다음은 해당 코드입니다.

    // Take any bean name that we can determine URLs for.
    for (String beanName : beanNames) {
        String[] urls = determineUrlsForHandler(beanName);
        if (!ObjectUtils.isEmpty(urls)) {
            // URL paths found: Let's consider it a handler.
            registerHandler(urls, beanName);
        }
        else {
            if (logger.isDebugEnabled()) {
                logger.debug("Rejected bean name '" + beanName + "': no URL paths identified");
            }
        }
    }
    
  2. from https://stackoverflow.com/questions/33581039/how-to-handle-rejected-bean-name-no-url-paths-identified-in-spring by cc-by-sa and MIT license