我正在尝试制作一个spring应用程序的可执行jar。但是每当我尝试使用java -jar jar文件运行它时,我都会收到错误:
StartCoroutine(readPage("http://www.example.com"));
我正在使用
运行Unable to start embedded container; nested exception is org.springframework.context.ApplicationContextException: Unable to start EmbeddedWebApplicationContext due to missing EmbeddedServletContainerFactory bean.
当我使用Eclipse运行服务器时,运行正常。这是我的pom文件:
mvn clean compile assembly:single
我知道这已经在其他线程上得到了解答,但是没有一个对我有用,我尝试从eclipse创建一个可执行的jar文件,但是还有其他问题。
答案 0 :(得分:0)
我将首先从命令行运行命令,以验证应用程序是否可以从命令行运行。
mvn spring-boot:run
通常,我通过运行
来构建胖罐mvn clean install
然后从#WORKING_DIR#/ target 文件夹中获取.jar文件。 希望这能为你的调试提供一些启示。