IDEAツールは、春のブートエラーのmainメソッドを開始します。解決済み

免責事項:この記事はブロガーオリジナル記事です、続くBY-SAのCC 4.0を著作権契約、複製、元のソースのリンクと、この文を添付してください。
このリンク: https://blog.csdn.net/qq_18237141/article/details/102747505

最近では、数日前に春ブーツ、問題はないに基づいて、プロジェクトへの参加の枠組みの中で、それが最近、次のエラーが報告されています。

外部Tomcatが起動または問題なく展開します。適用方法は、主エラーで始まります。

エラーがApplicationContextのを開始します。自動設定のレポートを表示するには有効になって「デバッグ」を使用してアプリケーションを再実行します。
2019年10月25日17:49:17.091 ERROR 24280 --- [メイン] osboot.SpringApplication:アプリケーションの起動に失敗しました

org.springframework.context.ApplicationContextException:埋め込まれたコンテナを起動することができません。欠落が原因EmbeddedServletContainerFactory BeanにEmbeddedWebApplicationContextを開始できません:ネストされた例外はorg.springframework.context.ApplicationContextExceptionです。
    org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.onRefreshで(EmbeddedWebApplicationContext.java:137)〜[春-ブート1.5.7.RELEASE.jar:1.5.7.RELEASE]
    org.springframework.context.supportで。 :AbstractApplicationContext.refresh(AbstractApplicationContext.java:537)〜[4.3.9.RELEASEばねコンテキスト4.3.9.RELEASE.jar]
    org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.refreshで(EmbeddedWebApplicationContext.java:122 )〜[春-ブート1.5.7.RELEASE.jar:1.5.7.RELEASE]
    :org.springframework.boot.SpringApplication.refresh(SpringApplication.java:693)1.5.7.RELEASEばねブート1.5.7.RELEASE.jar]で
    org.springframework.boot.SpringApplication.refreshContextで(SpringApplication.java :360)[スプリングブート1.5.7.RELEASE.jar:1.5.7.RELEASE]
    org.springframework.boot.SpringApplication.run(SpringApplication.java:303における)バネブート1.5.7.RELEASE。ジャー:1.5.7.RELEASE]
    org.springframework.boot.SpringApplication.run(SpringApplication.java:1118)における[バネブート1.5.7.RELEASE.jar:1.5.7.RELEASE]
    org.springframework.bootで.SpringApplication.run(SpringApplication.java:1107)ばねブート1.5.7.RELEASE.jar:1.5.7.RELEASE]
    com.Application.mainで(Application.java:26)クラス/:NA]
org.springframework.context.ApplicationContextException:欠落が原因EmbeddedServletContainerFactory BeanにEmbeddedWebApplicationContextを開始することができませんによって引き起こされます。
    org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.getEmbeddedServletContainerFactoryで(EmbeddedWebApplicationContext.java:189)〜[春-ブート1.5.7.RELEASE.jar:1.5.7.RELEASE]
    org.springframework.boot.contextで。 :embedded.EmbeddedWebApplicationContext.createEmbeddedServletContainer(EmbeddedWebApplicationContext.java:162)〜[1.5.7.RELEASE春ブート-1.5.7.RELEASE.jar]
    org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.onRefreshで(EmbeddedWebApplicationContext.java :134)〜[春-ブート1.5.7.RELEASE.jar:1.5.7.RELEASE]
    省略... 8つの共通フレーム

ソリューション:

内蔵のスプリングブートTomcatのスターターを導入するかどうかを判断するために①POMファイル。

<依存性> 
    <のgroupId> org.springframework.boot </のgroupId> 
    <たartifactId>ばねブートスタータTomcatの</たartifactId> 
    <範囲> </スコープ>提供
</依存>

その場合は②、スタートアップアプリケーションの手順を作成するときに必要なオプションが選択されていることを確認してください?下記に示すように、

上記のエラーが引き続き発生する場合③、春のブートアプリケーションのコマンドは、メインプログラムを起動します

おすすめ

転載: blog.csdn.net/qq_18237141/article/details/102747505