2016-08-21 10 views
3

概要私はIDEでそれを実行し、スプリングブーツのMavenプラグインを使用してアプリケーションを実行することはできませんが、IntelliJのアイデアに

をバネ - ブートアプリケーションを起動することができません。次の行は私のプログラムに関するいくつかの詳細を示しています。次のように

アプリケーションクラスは次のとおりです。

package com.blss.retailServices.dataExportRouter; 

import org.springframework.boot.SpringApplication; 
import org.springframework.boot.autoconfigure.EnableAutoConfiguration; 
import org.springframework.boot.autoconfigure.velocity.VelocityAutoConfiguration; 
import org.springframework.context.annotation.ComponentScan; 
import org.springframework.context.annotation.Configuration; 

@Configuration 
@ComponentScan 
@EnableAutoConfiguration(exclude = { VelocityAutoConfiguration.class }) 
public class DataExportRouterApplication { 
    public static void main(String[] args) throws Exception { 
     SpringApplication.run(DataExportRouterApplication.class, args); 
    } 
} 

次のように例外スタックトレースは次のとおりです。

org.springframework.context.ApplicationContextException: Unable to start embedded container; nested exception is org.springframework.context.ApplicationContextException: Unable to start EmbeddedWebApplicationContext due to missing EmbeddedServletContainerFactory bean. 
    at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.onRefresh(EmbeddedWebApplicationContext.java:133) ~[spring-boot-1.3.3.RELEASE.jar:1.3.3.RELEASE] 
    at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:532) ~[spring-context-4.2.5.RELEASE.jar:4.2.5.RELEASE] 
    at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.refresh(EmbeddedWebApplicationContext.java:118) ~[spring-boot-1.3.3.RELEASE.jar:1.3.3.RELEASE] 
    at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:766) [spring-boot-1.3.3.RELEASE.jar:1.3.3.RELEASE] 
    at org.springframework.boot.SpringApplication.createAndRefreshContext(SpringApplication.java:361) [spring-boot-1.3.3.RELEASE.jar:1.3.3.RELEASE] 
    at org.springframework.boot.SpringApplication.run(SpringApplication.java:307) [spring-boot-1.3.3.RELEASE.jar:1.3.3.RELEASE] 
    at org.springframework.boot.SpringApplication.run(SpringApplication.java:1191) [spring-boot-1.3.3.RELEASE.jar:1.3.3.RELEASE] 
    at org.springframework.boot.SpringApplication.run(SpringApplication.java:1180) [spring-boot-1.3.3.RELEASE.jar:1.3.3.RELEASE] 
    at com.blss.retailServices.dataExportRouter.DataExportRouterApplication.main(DataExportRouterApplication.java:14) [classes/:na] 
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.8.0_74] 
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:1.8.0_74] 
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.8.0_74] 
    at java.lang.reflect.Method.invoke(Method.java:498) ~[na:1.8.0_74] 
    at com.intellij.rt.execution.application.AppMain.main(AppMain.java:147) [idea_rt.jar:na] 
Caused by: org.springframework.context.ApplicationContextException: Unable to start EmbeddedWebApplicationContext due to missing EmbeddedServletContainerFactory bean. 
    at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.getEmbeddedServletContainerFactory(EmbeddedWebApplicationContext.java:185) ~[spring-boot-1.3.3.RELEASE.jar:1.3.3.RELEASE] 
    at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.createEmbeddedServletContainer(EmbeddedWebApplicationContext.java:158) ~[spring-boot-1.3.3.RELEASE.jar:1.3.3.RELEASE] 
    at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.onRefresh(EmbeddedWebApplicationContext.java:130) ~[spring-boot-1.3.3.RELEASE.jar:1.3.3.RELEASE] 
    ... 13 common frames omitted 

私は@SpringbootApplicationを使用したが、無駄に。誰も私がこの問題を解決するのに役立つことができれば

質問だから私はそれをお願い申し上げます。

+0

pom.xmlを表示できますか? – alexbt

答えて

7

私はwarパッケージングプロジェクトをMavenと一緒に持っており、あなたのサーブレットエンジン(tomcat)にフラグが立てられていると思います。

残念ながら、IntellIJ IDEAはadd provided dependencies in the runtime classpathではありません。そのため、IDEから実行するとプロジェクトが機能しません。

+2

ありがとうございます。それはまさに私の問題でした。私は "spring-boot-starter-tomcat"依存範囲をコンパイルするように変更し、正しく実行しました。 – saeedj

関連する問題