2015-11-07 3 views
8

私は春のブートアプリケーションを持っていると私は起動時に以下のメッセージが出ます:Springで '拒否されたBeanの名前 - URLパスが指定されていません'を処理する方法は?

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") 
} 

です。

+0

私はこの時点で使用しています。 – tzortzik

+5

メッセージを無視することができます。メッセージを見ると、デバッグ情報だけが表示されます。 BeanNameUrlHandlerMappingはBeanの名前を調べ、その名前がURLに変換できるかどうかをチェックします。それらのメッセージはあなたの情報のために純粋であり、あなたはそれらについて何もできないので、それらを無視することができます。デバッグロギングを無効にすると、デバッグログが表示されなくなります。だからあなたの依存関係とは何の関係もなく、それが今までどおりに正常に動作しています。 –

+0

実際に私のアプリケーションのための同じ問題(デバッグモードのロギング)があります:https://github.com/vdenotaris/spring-boot-security-saml-sample – vdenotaris

答えて

7

コメントの中で述べたように、これはデバッグメッセージであり、何もする必要はありません。スタートアップHandlerMapping

が要求とハンドラオブジェクト間のマッピングを決定するために実行されています。興味のある方のため

は、ここにいくつかの詳細です。 AbstractDetectingUrlHandlerMappingクラスには、現在のApplicationContextで見つかったすべてのハンドラを登録する detectHandlersメソッドがあります。 Beanを反復すると、URLパスが識別されないBeanは拒否されます。ここで

は、対応するcode次のとおりです。私は私の依存関係を追加

// 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"); 
     } 
    } 
} 
+0

あなたの答えに感謝します。同じデバッグメッセージが関係しているのを見ました。なぜなら、要求のマッピングを間違えていたからです。 リクエストマッピング(コントローラ上にある)とURLマッピング(BeanNameUrlHandlerMappingが探しているもの、コントローラに見つからないもの)の違いを理解できないため、私はまだ失われています。違い?私は1つを見つけなかったので。 –

+0

これについて新しい質問をするのが良いと思います。 –

+0

thx、done [here](https://stackoverflow.com/questions/44158550/what-is-the-difference-between-a-spring-request-mapping-and-url-mapping) –

関連する問題