0
jarファイルとしてパッケージ化されたときに起動に失敗したが、私はそれがSpringBootアプリケーションは、私はちょうど正常に動作SpringBootアプリケーションを持っている
ロギング次のエラーメッセージjava -jar target/Amsel-1.0-SNAPSHOT-jar-with-dependencies.jar
でfailes瓶としてそれをパッケージ化しようとすると、
. ____ _ __ _ _
/\\/___'_ __ _ _(_)_ __ __ _ \ \ \ \
(()\___ | '_ | '_| | '_ \/ _` | \ \ \ \
\\/ ___)| |_)| | | | | || (_| | ))))
' |____| .__|_| |_|_| |_\__, |////
=========|_|==============|___/=/_/_/_/
:: Spring Boot ::
2016-08-04 09:13:49.743 INFO 10008 --- [ main] de.myapp.Run : Starting Run on d6889988 with PID 10008 (started by User in X:\Myapp)
2016-08-04 09:13:49.747 INFO 10008 --- [ main] de.myapp.Run : No active profile set, falling back to default profiles: default
2016-08-04 09:13:49.865 INFO 10008 --- [ main] ationConfigEmbeddedWebApplicationContext : Refreshing org.springframework.boot[email protected]11f66796: startup date [Thu Aug 04 09:13:49 CEST 2016]; root of context hierarchy
2016-08-04 09:13:50.479 WARN 10008 --- [ main] ationConfigEmbeddedWebApplicationContext : Exception encountered during context initialization - cancelling refresh attempt: 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.
2016-08-04 09:13:50.488 ERROR 10008 --- [ main] o.s.boot.SpringApplication : Application startup failed
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) ~[Amsel-1.0-SNAPSHOT-jar-with-dependencies.jar:na]
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:532) ~[Amsel-1.0-SNAPSHOT-jar-with-dependencies.jar:na]
at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.refresh(EmbeddedWebApplicationContext.java:118) ~[Amsel-1.0-SNAPSHOT-jar-with-dependencies.jar:na]
at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:766) [Amsel-1.0-SNAPSHOT-jar-with-dependencies.jar:na]
at org.springframework.boot.SpringApplication.createAndRefreshContext(SpringApplication.java:361) [Amsel-1.0-SNAPSHOT-jar-with-dependencies.jar:na]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:307) [Amsel-1.0-SNAPSHOT-jar-with-dependencies.jar:na]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1191) [Amsel-1.0-SNAPSHOT-jar-with-dependencies.jar:na]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1180) [Amsel-1.0-SNAPSHOT-jar-with-dependencies.jar:na]
at de.arbeitsagentur.amsel.Run.main(Run.java:53) [Amsel-1.0-SNAPSHOT-jar-with-dependencies.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) ~[Amsel-1.0-SNAPSHOT-jar-with-dependencies.jar:na]
at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.createEmbeddedServletContainer(EmbeddedWebApplicationContext.java:158) ~[Amsel-1.0-SNAPSHOT-jar-with-dependencies.jar:na]
at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.onRefresh(EmbeddedWebApplicationContext.java:130) ~[Amsel-1.0-SNAPSHOT-jar-with-dependencies.jar:na]
... 8 common frames omitted
2016-08-04 09:13:50.490 INFO 10008 --- [ main] .b.l.ClasspathLoggingApplicationListener : Application failed to start with classpath: [file:/X:/Myapp/target/Amsel-1.0-SNAPSHOT-jar-with-dependencies.jar]
と私Run.class
は、エントリポイントは、以下の
@SpringBootApplication
@ComponentScan("de.myapp")
public class Run {
public static void main(String[] args) throws Exception{
SpringApplication.run(Run.class, args);
}
}
であり、これはあります問題は、何ができるかjarファイルを生成するために使用されるpom.xm
リットル
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>de.myapp.amsel</groupId>
<artifactId>Amsel</artifactId>
<version>1.0-SNAPSHOT</version>
<packaging>jar</packaging>
<name>Amsel</name>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>1.3.2.RELEASE</version>
</parent>
<build>
<plugins>
<plugin>
<artifactId>maven-assembly-plugin</artifactId>
<configuration>
<descriptorRefs>
<descriptorRef>jar-with-dependencies</descriptorRef>
</descriptorRefs>
<archive>
<manifest>
<mainClass>de.myapp.Run</mainClass>
</manifest>
</archive>
</configuration>
</plugin>
</plugins>
</build>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-tomcat</artifactId>
</dependency>
</project>
任意のアイデア?私は答えを自分で見つけ