Lỗi khi deploy Spring Boot lên Heroku

Chào anh/chị, có anh chị nào từng deploy lên heroku thì giải đáp giúp em với, em deploy lên mà nó cứ báo lỗi:

2021-03-23T00:53:54.069770+00:00 app[web.1]: at org.apache.catalina.core.StandardEngine.startInternal(StandardEngine.java:262)
2021-03-23T00:53:54.069770+00:00 app[web.1]: at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
2021-03-23T00:53:54.069771+00:00 app[web.1]: at org.apache.catalina.core.StandardService.startInternal(StandardService.java:434)
2021-03-23T00:53:54.069771+00:00 app[web.1]: at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
2021-03-23T00:53:54.069772+00:00 app[web.1]: at org.apache.catalina.core.StandardServer.startInternal(StandardServer.java:930)
2021-03-23T00:53:54.069772+00:00 app[web.1]: at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
2021-03-23T00:53:54.069773+00:00 app[web.1]: at org.apache.catalina.startup.Tomcat.start(Tomcat.java:486)
2021-03-23T00:53:54.069773+00:00 app[web.1]: at webapp.runner.launch.Main.main(Main.java:289)
2021-03-23T00:53:54.069773+00:00 app[web.1]: Caused by: org.apache.catalina.LifecycleException: A child container failed during start
2021-03-23T00:53:54.069774+00:00 app[web.1]: at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:928)
2021-03-23T00:53:54.069774+00:00 app[web.1]: at org.apache.catalina.core.StandardHost.startInternal(StandardHost.java:843)
2021-03-23T00:53:54.069774+00:00 app[web.1]: at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
2021-03-23T00:53:54.069775+00:00 app[web.1]: at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1384)
2021-03-23T00:53:54.069775+00:00 app[web.1]: at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1374)
2021-03-23T00:53:54.069775+00:00 app[web.1]: at java.util.concurrent.FutureTask.run(FutureTask.java:266)
2021-03-23T00:53:54.069776+00:00 app[web.1]: at org.apache.tomcat.util.threads.InlineExecutorService.execute(InlineExecutorService.java:75)
2021-03-23T00:53:54.069787+00:00 app[web.1]: at java.util.concurrent.AbstractExecutorService.submit(AbstractExecutorService.java:134)
2021-03-23T00:53:54.069787+00:00 app[web.1]: at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:909)
2021-03-23T00:53:54.069788+00:00 app[web.1]: ... 8 more
2021-03-23T00:53:54.069788+00:00 app[web.1]: Caused by: java.util.concurrent.ExecutionException: org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Tomcat].StandardHost[localhost].StandardContext[]]
2021-03-23T00:53:54.069789+00:00 app[web.1]: at java.util.concurrent.FutureTask.report(FutureTask.java:122)
2021-03-23T00:53:54.069789+00:00 app[web.1]: at java.util.concurrent.FutureTask.get(FutureTask.java:192)
2021-03-23T00:53:54.069789+00:00 app[web.1]: at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:916)
2021-03-23T00:53:54.069790+00:00 app[web.1]: ... 16 more
2021-03-23T00:53:54.069790+00:00 app[web.1]: Caused by: org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Tomcat].StandardHost[localhost].StandardContext[]]
2021-03-23T00:53:54.069790+00:00 app[web.1]: at org.apache.catalina.util.LifecycleBase.handleSubClassException(LifecycleBase.java:440)
2021-03-23T00:53:54.069791+00:00 app[web.1]: at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:198)
2021-03-23T00:53:54.069791+00:00 app[web.1]: at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1384)
2021-03-23T00:53:54.069791+00:00 app[web.1]: at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1374)
2021-03-23T00:53:54.069792+00:00 app[web.1]: at java.util.concurrent.FutureTask.run(FutureTask.java:266)
2021-03-23T00:53:54.069792+00:00 app[web.1]: at org.apache.tomcat.util.threads.InlineExecutorService.execute(InlineExecutorService.java:75)
2021-03-23T00:53:54.069792+00:00 app[web.1]: at java.util.concurrent.AbstractExecutorService.submit(AbstractExecutorService.java:134)
2021-03-23T00:53:54.069792+00:00 app[web.1]: at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:909)
2021-03-23T00:53:54.069793+00:00 app[web.1]: ... 16 more
2021-03-23T00:53:54.069793+00:00 app[web.1]: Caused by: java.lang.IllegalArgumentException: More than one fragment with the name [org_apache_jasper] was found. This is not legal with relative ordering. See section 8.2.2 2c of the Servlet specification for details. Consider using absolute ordering.
2021-03-23T00:53:54.069794+00:00 app[web.1]: at org.apache.tomcat.util.descriptor.web.WebXml.orderWebFragments(WebXml.java:2260)
2021-03-23T00:53:54.069794+00:00 app[web.1]: at org.apache.tomcat.util.descriptor.web.WebXml.orderWebFragments(WebXml.java:2218)
2021-03-23T00:53:54.069794+00:00 app[web.1]: at org.apache.catalina.startup.ContextConfig.webConfig(ContextConfig.java:1293)
2021-03-23T00:53:54.069794+00:00 app[web.1]: at org.apache.catalina.startup.ContextConfig.configureStart(ContextConfig.java:985)
2021-03-23T00:53:54.069795+00:00 app[web.1]: at org.apache.catalina.startup.ContextConfig.lifecycleEvent(ContextConfig.java:303)
2021-03-23T00:53:54.069795+00:00 app[web.1]: at org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:123)
2021-03-23T00:53:54.069795+00:00 app[web.1]: at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5082)
2021-03-23T00:53:54.069796+00:00 app[web.1]: at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
2021-03-23T00:53:54.069796+00:00 app[web.1]: ... 22 more
2021-03-23T00:53:54.069796+00:00 app[web.1]:
2021-03-23T00:53:54.070339+00:00 app[web.1]: Exception in thread "main" org.apache.catalina.LifecycleException: A child container failed during start
2021-03-23T00:53:54.070425+00:00 app[web.1]: at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:928)
2021-03-23T00:53:54.070495+00:00 app[web.1]: at org.apache.catalina.core.StandardEngine.startInternal(StandardEngine.java:262)
2021-03-23T00:53:54.070554+00:00 app[web.1]: at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
2021-03-23T00:53:54.070612+00:00 app[web.1]: at org.apache.catalina.core.StandardService.startInternal(StandardService.java:434)
2021-03-23T00:53:54.070671+00:00 app[web.1]: at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
2021-03-23T00:53:54.070730+00:00 app[web.1]: at org.apache.catalina.core.StandardServer.startInternal(StandardServer.java:930)
2021-03-23T00:53:54.070777+00:00 app[web.1]: at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
2021-03-23T00:53:54.070843+00:00 app[web.1]: at org.apache.catalina.startup.Tomcat.start(Tomcat.java:486)
2021-03-23T00:53:54.070903+00:00 app[web.1]: at webapp.runner.launch.Main.main(Main.java:289)
2021-03-23T00:53:54.070970+00:00 app[web.1]: Caused by: java.util.concurrent.ExecutionException: org.apache.catalina.LifecycleException: A child container failed during start
2021-03-23T00:53:54.071043+00:00 app[web.1]: at java.util.concurrent.FutureTask.report(FutureTask.java:122)
2021-03-23T00:53:54.071127+00:00 app[web.1]: at java.util.concurrent.FutureTask.get(FutureTask.java:192)
2021-03-23T00:53:54.071180+00:00 app[web.1]: at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:916)
2021-03-23T00:53:54.071237+00:00 app[web.1]: ... 8 more
2021-03-23T00:53:54.071318+00:00 app[web.1]: Caused by: org.apache.catalina.LifecycleException: A child container failed during start
2021-03-23T00:53:54.071376+00:00 app[web.1]: at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:928)
2021-03-23T00:53:54.071436+00:00 app[web.1]: at org.apache.catalina.core.StandardHost.startInternal(StandardHost.java:843)
2021-03-23T00:53:54.071493+00:00 app[web.1]: at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
2021-03-23T00:53:54.071551+00:00 app[web.1]: at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1384)
2021-03-23T00:53:54.071609+00:00 app[web.1]: at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1374)
2021-03-23T00:53:54.071666+00:00 app[web.1]: at java.util.concurrent.FutureTask.run(FutureTask.java:266)
2021-03-23T00:53:54.071723+00:00 app[web.1]: at org.apache.tomcat.util.threads.InlineExecutorService.execute(InlineExecutorService.java:75)
2021-03-23T00:53:54.071791+00:00 app[web.1]: at java.util.concurrent.AbstractExecutorService.submit(AbstractExecutorService.java:134)
2021-03-23T00:53:54.071848+00:00 app[web.1]: at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:909)
2021-03-23T00:53:54.071905+00:00 app[web.1]: ... 8 more
2021-03-23T00:53:54.071986+00:00 app[web.1]: Caused by: java.util.concurrent.ExecutionException: org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Tomcat].StandardHost[localhost].StandardContext[]]
2021-03-23T00:53:54.072044+00:00 app[web.1]: at java.util.concurrent.FutureTask.report(FutureTask.java:122)
2021-03-23T00:53:54.072100+00:00 app[web.1]: at java.util.concurrent.FutureTask.get(FutureTask.java:192)
2021-03-23T00:53:54.072164+00:00 app[web.1]: at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:916)
2021-03-23T00:53:54.072217+00:00 app[web.1]: ... 16 more
2021-03-23T00:53:54.072285+00:00 app[web.1]: Caused by: org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Tomcat].StandardHost[localhost].StandardContext[]]
2021-03-23T00:53:54.072343+00:00 app[web.1]: at org.apache.catalina.util.LifecycleBase.handleSubClassException(LifecycleBase.java:440)
2021-03-23T00:53:54.072401+00:00 app[web.1]: at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:198)
2021-03-23T00:53:54.072468+00:00 app[web.1]: at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1384)
2021-03-23T00:53:54.072532+00:00 app[web.1]: at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1374)
2021-03-23T00:53:54.072593+00:00 app[web.1]: at java.util.concurrent.FutureTask.run(FutureTask.java:266)
2021-03-23T00:53:54.072651+00:00 app[web.1]: at org.apache.tomcat.util.threads.InlineExecutorService.execute(InlineExecutorService.java:75)
2021-03-23T00:53:54.072709+00:00 app[web.1]: at java.util.concurrent.AbstractExecutorService.submit(AbstractExecutorService.java:134)
2021-03-23T00:53:54.072773+00:00 app[web.1]: at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:909)
2021-03-23T00:53:54.072825+00:00 app[web.1]: ... 16 more
2021-03-23T00:53:54.072897+00:00 app[web.1]: Caused by: java.lang.IllegalArgumentException: More than one fragment with the name [org_apache_jasper] was found. This is not legal with relative ordering. See section 8.2.2 2c of the Servlet specification for details. Consider using absolute ordering.
2021-03-23T00:53:54.072966+00:00 app[web.1]: at org.apache.tomcat.util.descriptor.web.WebXml.orderWebFragments(WebXml.java:2260)
2021-03-23T00:53:54.073023+00:00 app[web.1]: at org.apache.tomcat.util.descriptor.web.WebXml.orderWebFragments(WebXml.java:2218)
2021-03-23T00:53:54.073079+00:00 app[web.1]: at org.apache.catalina.startup.ContextConfig.webConfig(ContextConfig.java:1293)
2021-03-23T00:53:54.073142+00:00 app[web.1]: at org.apache.catalina.startup.ContextConfig.configureStart(ContextConfig.java:985)
2021-03-23T00:53:54.073192+00:00 app[web.1]: at org.apache.catalina.startup.ContextConfig.lifecycleEvent(ContextConfig.java:303)
2021-03-23T00:53:54.073247+00:00 app[web.1]: at org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:123)
2021-03-23T00:53:54.073306+00:00 app[web.1]: at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5082)
2021-03-23T00:53:54.073361+00:00 app[web.1]: at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
2021-03-23T00:53:54.073416+00:00 app[web.1]: ... 22 more
2021-03-23T00:53:54.433668+00:00 heroku[web.1]: Process exited with status 1
2021-03-23T00:53:54.496860+00:00 heroku[web.1]: State changed from starting to crashed
2021-03-23T00:54:27.500980+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=hellocacban.herokuapp.com request_id=ee51945b-5420-405d-b2e1-29279ba02208 fwd="171.246.114.201" dyno= connect= service= status=503 bytes= protocol=https
2021-03-23T00:54:27.892626+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/favicon.ico" host=hellocacban.herokuapp.com request_id=18e8f3f5-39ec-46d5-a6e2-899a4f2c51bc fwd="171.246.114.201" dyno= connect= service= status=503 bytes= protocol=https

Search google nhưng làm theo thì cũng không giải quyết được. Code của em như dưới:
pom.xml

<?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 https://maven.apache.org/xsd/maven-4.0.0.xsd">
	<modelVersion>4.0.0</modelVersion>
	<parent>
		<groupId>org.springframework.boot</groupId>
		<artifactId>spring-boot-starter-parent</artifactId>
		<version>2.4.4</version>
		<relativePath /> <!-- lookup parent from repository -->
	</parent>
	<groupId>com.hello</groupId>
	<artifactId>HelloWorld</artifactId>
	<version>1.0</version>
	<packaging>war</packaging>
	<name>HelloWorld</name>
	<description>HelloWorld</description>
	<properties>
		<java.version>1.8</java.version>
	</properties>
	<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>
			<scope>provided</scope>
		</dependency>
		<dependency>
			<groupId>org.springframework.boot</groupId>
			<artifactId>spring-boot-starter-test</artifactId>
			<scope>test</scope>
		</dependency>
		<dependency>
			<groupId>com.heroku</groupId>
			<artifactId>webapp-runner</artifactId>
			<version>9.0.41.0</version>
		</dependency>
	</dependencies>

	<build>
		<plugins>
			<plugin>
				<groupId>org.springframework.boot</groupId>
				<artifactId>spring-boot-maven-plugin</artifactId>
			</plugin>
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-dependency-plugin</artifactId>
				<executions>
					<execution>
						<phase>package</phase>
						<goals>
							<goal>copy</goal>
						</goals>
						<configuration>
							<artifactItems>
								<artifactItem>
									<groupId>com.heroku</groupId>
									<artifactId>webapp-runner</artifactId>
									<version>9.0.41.0</version>
									<destFileName>webapp-runner.jar</destFileName>
								</artifactItem>
							</artifactItems>
						</configuration>
					</execution>
				</executions>
			</plugin>
		</plugins>
		<finalName>helloworld</finalName>
	</build>

</project>

Procfile

web: java $JAVA_OPTS -jar target/dependency/webapp-runner.jar --port $PORT target/helloworld.war

Controller (chỉ in ra Hello World)

package com.hello.controller;

import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class HelloController {
	@RequestMapping("/")
	public String hello() {
		return "Hello World";
	}
}

Project


Chạy trên local

Cám ơn anh/chị.

Cậu thử post tớ kết quả của câu lệnh này xem:

heroku logs -n 2000 -a <youapp>
1 Like
2021-03-22T10:00:17.767862+00:00 heroku[web.1]: State changed from crashed to starting
2021-03-22T10:00:22.748501+00:00 heroku[web.1]: Starting process with command `java $JAVA_OPTS -jar target/dependency/webapp-runner.jar --port 39243 target/helloworld.war`
2021-03-22T10:00:25.940987+00:00 app[web.1]: Setting JAVA_TOOL_OPTIONS defaults based on dyno size. Custom settings will override them.
2021-03-22T10:00:25.949139+00:00 app[web.1]: Picked up JAVA_TOOL_OPTIONS: -Xmx300m -Xss512k -XX:CICompilerCount=2 -Dfile.encoding=UTF-8
2021-03-22T10:00:26.732717+00:00 app[web.1]: The specified path "target/helloworld.war" does not exist.
2021-03-22T10:00:26.739238+00:00 app[web.1]: Usage: <main class> [options]
2021-03-22T10:00:26.739241+00:00 app[web.1]: Options:
2021-03-22T10:00:26.739242+00:00 app[web.1]: --basic-auth-pw                     Password to be used with basic auth.
2021-03-22T10:00:26.739243+00:00 app[web.1]: Defaults to BASIC_AUTH_PW env variable.
2021-03-22T10:00:26.739243+00:00 app[web.1]: --basic-auth-user                   Username to be used with basic auth.
2021-03-22T10:00:26.739244+00:00 app[web.1]: Defaults to BASIC_AUTH_USER env variable.
2021-03-22T10:00:26.739244+00:00 app[web.1]: --bind-on-init                      Controls when the socket used by the
2021-03-22T10:00:26.739244+00:00 app[web.1]: connector is bound. By default it is bound
2021-03-22T10:00:26.739246+00:00 app[web.1]: when the connector is initiated and
2021-03-22T10:00:26.739246+00:00 app[web.1]: unbound when the connector is destroyed.,
2021-03-22T10:00:26.739247+00:00 app[web.1]: default value: true
2021-03-22T10:00:26.739247+00:00 app[web.1]: Default: true
2021-03-22T10:00:26.739247+00:00 app[web.1]: --compressable-mime-types           Comma delimited list of mime types
2021-03-22T10:00:26.739248+00:00 app[web.1]: that will be compressed when using GZIP
2021-03-22T10:00:26.739248+00:00 app[web.1]: compression.
2021-03-22T10:00:26.739257+00:00 app[web.1]: Default: text/html,text/xml,text/plain,text/css,application/json,application/xml,text/javascript,application/javascript
2021-03-22T10:00:26.739258+00:00 app[web.1]: --context-xml                       The path to the context xml to use.
2021-03-22T10:00:26.739258+00:00 app[web.1]: --enable-basic-auth                 Secure the app with basic auth. Use
2021-03-22T10:00:26.739259+00:00 app[web.1]: with --basic-auth-user and
2021-03-22T10:00:26.739259+00:00 app[web.1]: --basic-auth-pw or --tomcat-users-location
2021-03-22T10:00:26.739259+00:00 app[web.1]: Default: false
2021-03-22T10:00:26.739260+00:00 app[web.1]: --enable-client-auth                Specify -Djavax.net.ssl.keyStore and
2021-03-22T10:00:26.739260+00:00 app[web.1]: -Djavax.net.ssl.keyStorePassword in JAVA_OPTS
2021-03-22T10:00:26.739260+00:00 app[web.1]: Default: false
2021-03-22T10:00:26.739261+00:00 app[web.1]: --enable-compression                Enable GZIP compression on responses
2021-03-22T10:00:26.739261+00:00 app[web.1]: Default: false
2021-03-22T10:00:26.739261+00:00 app[web.1]: --enable-ssl                        Specify -Djavax.net.ssl.trustStore
2021-03-22T10:00:26.739261+00:00 app[web.1]: and -Djavax.net.ssl.trustStorePassword
2021-03-22T10:00:26.739262+00:00 app[web.1]: in JAVA_OPTS. Note: should not be used
2021-03-22T10:00:26.739262+00:00 app[web.1]: if a reverse proxy is terminating SSL
2021-03-22T10:00:26.739262+00:00 app[web.1]: for you (such as on Heroku)
2021-03-22T10:00:26.739263+00:00 app[web.1]: Default: false
2021-03-22T10:00:26.739263+00:00 app[web.1]: --expand-war                        Expand the war file and set it as
2021-03-22T10:00:26.739263+00:00 app[web.1]: source
2021-03-22T10:00:26.739263+00:00 app[web.1]: Default: false
2021-03-22T10:00:26.739265+00:00 app[web.1]: --help
2021-03-22T10:00:26.739265+00:00 app[web.1]: Default: false
2021-03-22T10:00:26.739265+00:00 app[web.1]: --path                              The context path
2021-03-22T10:00:26.739266+00:00 app[web.1]: --port                              The port that the server will accept
2021-03-22T10:00:26.739266+00:00 app[web.1]: http requests on.
2021-03-22T10:00:26.739266+00:00 app[web.1]: Default: 8080
2021-03-22T10:00:26.739267+00:00 app[web.1]: --scanBootstrapClassPath            Set jar scanner scan bootstrap
2021-03-22T10:00:26.739267+00:00 app[web.1]: classpath.
2021-03-22T10:00:26.739267+00:00 app[web.1]: Default: false
2021-03-22T10:00:26.739268+00:00 app[web.1]: --session-store                     Session store to use (valid options
2021-03-22T10:00:26.739268+00:00 app[web.1]: are 'memcache' or 'redis')
2021-03-22T10:00:26.739268+00:00 app[web.1]: --session-store-ignore-pattern      Request pattern to not track
2021-03-22T10:00:26.739268+00:00 app[web.1]: sessions for. Valid only with memcache
2021-03-22T10:00:26.739269+00:00 app[web.1]: session store. (default is
2021-03-22T10:00:26.739269+00:00 app[web.1]: '.*\.(png|gif|jpg|css|js)$'
2021-03-22T10:00:26.739269+00:00 app[web.1]: Default: .*\.(png|gif|jpg|css|js)$
2021-03-22T10:00:26.739270+00:00 app[web.1]: --session-store-locking-mode        Session locking mode for use with
2021-03-22T10:00:26.739270+00:00 app[web.1]: memcache session store. (default is all)
2021-03-22T10:00:26.739270+00:00 app[web.1]: Default: all
2021-03-22T10:00:26.739271+00:00 app[web.1]: --session-store-operation-timeout   Operation timeout for the memcache
2021-03-22T10:00:26.739271+00:00 app[web.1]: session store. (default is 5000ms)
2021-03-22T10:00:26.739281+00:00 app[web.1]: Default: 5000
2021-03-22T10:00:26.739281+00:00 app[web.1]: --session-timeout                   The number of minutes of inactivity
2021-03-22T10:00:26.739282+00:00 app[web.1]: before a user's session is timed out.
2021-03-22T10:00:26.739282+00:00 app[web.1]: --shutdown-override                 Overrides the default behavior and
2021-03-22T10:00:26.739282+00:00 app[web.1]: casues Tomcat to ignore lifecycle failure
2021-03-22T10:00:26.739283+00:00 app[web.1]: events rather than shutting down when they
2021-03-22T10:00:26.739283+00:00 app[web.1]: occur.
2021-03-22T10:00:26.739283+00:00 app[web.1]: Default: false
2021-03-22T10:00:26.739284+00:00 app[web.1]: --temp-directory                    Define the temp directory, default
2021-03-22T10:00:26.739284+00:00 app[web.1]: value: ./target/tomcat.PORT
2021-03-22T10:00:26.739284+00:00 app[web.1]: --tomcat-users-location             Location of the tomcat-users.xml
2021-03-22T10:00:26.739285+00:00 app[web.1]: file. (relative to the location of the
2021-03-22T10:00:26.739285+00:00 app[web.1]: webapp-runner jar file)
2021-03-22T10:00:26.739286+00:00 app[web.1]: --uri-encoding                      Set the URI encoding to be used for
2021-03-22T10:00:26.739286+00:00 app[web.1]: the Connector.
2021-03-22T10:00:26.739286+00:00 app[web.1]: --use-body-encoding-for-uri         Set if the entity body encoding
2021-03-22T10:00:26.739286+00:00 app[web.1]: should be used for the URI.
2021-03-22T10:00:26.739287+00:00 app[web.1]: Default: false
2021-03-22T10:00:26.739359+00:00 app[web.1]:
2021-03-22T10:00:26.842394+00:00 heroku[web.1]: Process exited with status 1
2021-03-22T10:00:26.942478+00:00 heroku[web.1]: State changed from starting to crashed
2021-03-22T10:00:27.000000+00:00 app[api]: Build succeeded
2021-03-22T10:00:45.064216+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=afternoon-everglades-59971.herokuapp.com request_id=32c23e54-9af2-4c5d-a0e6-5b50e3560175 fwd="116.106.26.244" dyno= connect= service= status=503 bytes= protocol=https
2021-03-22T10:00:45.643535+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/favicon.ico" host=afternoon-everglades-59971.herokuapp.com request_id=a9f1ac0f-135d-48ad-a69b-3e951b1bceac fwd="116.106.26.244" dyno= connect= service= status=503 bytes= protocol=https
2021-03-22T10:11:30.179704+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=afternoon-everglades-59971.herokuapp.com request_id=21ca015a-7bec-4e98-bc04-16b646a1229e fwd="116.106.26.244" dyno= connect= service= status=503 bytes= protocol=https
2021-03-22T10:11:30.566927+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/favicon.ico" host=afternoon-everglades-59971.herokuapp.com request_id=afbb2eef-1ba7-4fca-9ce9-9975c9e5d3e2 fwd="116.106.26.244" dyno= connect= service= status=503 bytes= protocol=https

C:\Users\lqcuo>

1 Like
2021-03-22T10:59:37.027281+00:00 app[web.1]: at org.apache.catalina.core.StandardEngine.startInternal(StandardEngine.java:262)
2021-03-22T10:59:37.027282+00:00 app[web.1]: at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
2021-03-22T10:59:37.027282+00:00 app[web.1]: at org.apache.catalina.core.StandardService.startInternal(StandardService.java:434)
2021-03-22T10:59:37.027283+00:00 app[web.1]: at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
2021-03-22T10:59:37.027283+00:00 app[web.1]: at org.apache.catalina.core.StandardServer.startInternal(StandardServer.java:930)
2021-03-22T10:59:37.027283+00:00 app[web.1]: at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
2021-03-22T10:59:37.027284+00:00 app[web.1]: at org.apache.catalina.startup.Tomcat.start(Tomcat.java:486)
2021-03-22T10:59:37.027284+00:00 app[web.1]: at webapp.runner.launch.Main.main(Main.java:289)
2021-03-22T10:59:37.027285+00:00 app[web.1]: Caused by: org.apache.catalina.LifecycleException: A child container failed during start
2021-03-22T10:59:37.027285+00:00 app[web.1]: at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:928)
2021-03-22T10:59:37.027286+00:00 app[web.1]: at org.apache.catalina.core.StandardHost.startInternal(StandardHost.java:843)
2021-03-22T10:59:37.027286+00:00 app[web.1]: at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
2021-03-22T10:59:37.027287+00:00 app[web.1]: at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1384)
2021-03-22T10:59:37.027287+00:00 app[web.1]: at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1374)
2021-03-22T10:59:37.027287+00:00 app[web.1]: at java.util.concurrent.FutureTask.run(FutureTask.java:266)
2021-03-22T10:59:37.027288+00:00 app[web.1]: at org.apache.tomcat.util.threads.InlineExecutorService.execute(InlineExecutorService.java:75)
2021-03-22T10:59:37.027288+00:00 app[web.1]: at java.util.concurrent.AbstractExecutorService.submit(AbstractExecutorService.java:134)
2021-03-22T10:59:37.027288+00:00 app[web.1]: at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:909)
2021-03-22T10:59:37.027289+00:00 app[web.1]: ... 8 more
2021-03-22T10:59:37.027290+00:00 app[web.1]: Caused by: java.util.concurrent.ExecutionException: org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Tomcat].StandardHost[localhost].StandardContext[]]
2021-03-22T10:59:37.027290+00:00 app[web.1]: at java.util.concurrent.FutureTask.report(FutureTask.java:122)
2021-03-22T10:59:37.027291+00:00 app[web.1]: at java.util.concurrent.FutureTask.get(FutureTask.java:192)
2021-03-22T10:59:37.027300+00:00 app[web.1]: at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:916)
2021-03-22T10:59:37.027300+00:00 app[web.1]: ... 16 more
2021-03-22T10:59:37.027301+00:00 app[web.1]: Caused by: org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Tomcat].StandardHost[localhost].StandardContext[]]
2021-03-22T10:59:37.027301+00:00 app[web.1]: at org.apache.catalina.util.LifecycleBase.handleSubClassException(LifecycleBase.java:440)
2021-03-22T10:59:37.027302+00:00 app[web.1]: at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:198)
2021-03-22T10:59:37.027302+00:00 app[web.1]: at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1384)
2021-03-22T10:59:37.027302+00:00 app[web.1]: at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1374)
2021-03-22T10:59:37.027303+00:00 app[web.1]: at java.util.concurrent.FutureTask.run(FutureTask.java:266)
2021-03-22T10:59:37.027303+00:00 app[web.1]: at org.apache.tomcat.util.threads.InlineExecutorService.execute(InlineExecutorService.java:75)
2021-03-22T10:59:37.027303+00:00 app[web.1]: at java.util.concurrent.AbstractExecutorService.submit(AbstractExecutorService.java:134)
2021-03-22T10:59:37.027304+00:00 app[web.1]: at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:909)
2021-03-22T10:59:37.027304+00:00 app[web.1]: ... 16 more
2021-03-22T10:59:37.027305+00:00 app[web.1]: Caused by: java.lang.IllegalArgumentException: More than one fragment with the name [org_apache_jasper_el] was found. This is not legal with relative ordering. See section 8.2.2 2c of the Servlet specification for details. Consider using absolute ordering.
2021-03-22T10:59:37.027305+00:00 app[web.1]: at org.apache.tomcat.util.descriptor.web.WebXml.orderWebFragments(WebXml.java:2260)
2021-03-22T10:59:37.027306+00:00 app[web.1]: at org.apache.tomcat.util.descriptor.web.WebXml.orderWebFragments(WebXml.java:2218)
2021-03-22T10:59:37.027306+00:00 app[web.1]: at org.apache.catalina.startup.ContextConfig.webConfig(ContextConfig.java:1293)
2021-03-22T10:59:37.027306+00:00 app[web.1]: at org.apache.catalina.startup.ContextConfig.configureStart(ContextConfig.java:985)
2021-03-22T10:59:37.027307+00:00 app[web.1]: at org.apache.catalina.startup.ContextConfig.lifecycleEvent(ContextConfig.java:303)
2021-03-22T10:59:37.027307+00:00 app[web.1]: at org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:123)
2021-03-22T10:59:37.027307+00:00 app[web.1]: at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5082)
2021-03-22T10:59:37.027308+00:00 app[web.1]: at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
2021-03-22T10:59:37.027308+00:00 app[web.1]: ... 22 more
2021-03-22T10:59:37.027309+00:00 app[web.1]:
2021-03-22T10:59:37.028599+00:00 app[web.1]: Exception in thread "main" org.apache.catalina.LifecycleException: A child container failed during start
2021-03-22T10:59:37.029619+00:00 app[web.1]: at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:928)
2021-03-22T10:59:37.029773+00:00 app[web.1]: at org.apache.catalina.core.StandardEngine.startInternal(StandardEngine.java:262)
2021-03-22T10:59:37.029917+00:00 app[web.1]: at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
2021-03-22T10:59:37.030065+00:00 app[web.1]: at org.apache.catalina.core.StandardService.startInternal(StandardService.java:434)
2021-03-22T10:59:37.030210+00:00 app[web.1]: at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
2021-03-22T10:59:37.030340+00:00 app[web.1]: at org.apache.catalina.core.StandardServer.startInternal(StandardServer.java:930)
2021-03-22T10:59:37.030461+00:00 app[web.1]: at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
2021-03-22T10:59:37.030629+00:00 app[web.1]: at org.apache.catalina.startup.Tomcat.start(Tomcat.java:486)
2021-03-22T10:59:37.031157+00:00 app[web.1]: at webapp.runner.launch.Main.main(Main.java:289)
2021-03-22T10:59:37.031361+00:00 app[web.1]: Caused by: java.util.concurrent.ExecutionException: org.apache.catalina.LifecycleException: A child container failed during start
2021-03-22T10:59:37.031506+00:00 app[web.1]: at java.util.concurrent.FutureTask.report(FutureTask.java:122)
2021-03-22T10:59:37.031672+00:00 app[web.1]: at java.util.concurrent.FutureTask.get(FutureTask.java:192)
2021-03-22T10:59:37.031802+00:00 app[web.1]: at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:916)
2021-03-22T10:59:37.031913+00:00 app[web.1]: ... 8 more
2021-03-22T10:59:37.033832+00:00 app[web.1]: Caused by: org.apache.catalina.LifecycleException: A child container failed during start
2021-03-22T10:59:37.033979+00:00 app[web.1]: at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:928)
2021-03-22T10:59:37.034124+00:00 app[web.1]: at org.apache.catalina.core.StandardHost.startInternal(StandardHost.java:843)
2021-03-22T10:59:37.034237+00:00 app[web.1]: at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
2021-03-22T10:59:37.034334+00:00 app[web.1]: at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1384)
2021-03-22T10:59:37.034461+00:00 app[web.1]: at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1374)
2021-03-22T10:59:37.034581+00:00 app[web.1]: at java.util.concurrent.FutureTask.run(FutureTask.java:266)
2021-03-22T10:59:37.034679+00:00 app[web.1]: at org.apache.tomcat.util.threads.InlineExecutorService.execute(InlineExecutorService.java:75)
2021-03-22T10:59:37.034803+00:00 app[web.1]: at java.util.concurrent.AbstractExecutorService.submit(AbstractExecutorService.java:134)
2021-03-22T10:59:37.034928+00:00 app[web.1]: at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:909)
2021-03-22T10:59:37.035023+00:00 app[web.1]: ... 8 more
2021-03-22T10:59:37.035245+00:00 app[web.1]: Caused by: java.util.concurrent.ExecutionException: org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Tomcat].StandardHost[localhost].StandardContext[]]
2021-03-22T10:59:37.035366+00:00 app[web.1]: at java.util.concurrent.FutureTask.report(FutureTask.java:122)
2021-03-22T10:59:37.035514+00:00 app[web.1]: at java.util.concurrent.FutureTask.get(FutureTask.java:192)
2021-03-22T10:59:37.035729+00:00 app[web.1]: at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:916)
2021-03-22T10:59:37.035864+00:00 app[web.1]: ... 16 more
2021-03-22T10:59:37.036010+00:00 app[web.1]: Caused by: org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Tomcat].StandardHost[localhost].StandardContext[]]
2021-03-22T10:59:37.036110+00:00 app[web.1]: at org.apache.catalina.util.LifecycleBase.handleSubClassException(LifecycleBase.java:440)
2021-03-22T10:59:37.036237+00:00 app[web.1]: at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:198)
2021-03-22T10:59:37.036894+00:00 app[web.1]: at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1384)
2021-03-22T10:59:37.037045+00:00 app[web.1]: at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1374)
2021-03-22T10:59:37.037149+00:00 app[web.1]: at java.util.concurrent.FutureTask.run(FutureTask.java:266)
2021-03-22T10:59:37.037294+00:00 app[web.1]: at org.apache.tomcat.util.threads.InlineExecutorService.execute(InlineExecutorService.java:75)
2021-03-22T10:59:37.037442+00:00 app[web.1]: at java.util.concurrent.AbstractExecutorService.submit(AbstractExecutorService.java:134)
2021-03-22T10:59:37.037589+00:00 app[web.1]: at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:909)
2021-03-22T10:59:37.037723+00:00 app[web.1]: ... 16 more
2021-03-22T10:59:37.037914+00:00 app[web.1]: Caused by: java.lang.IllegalArgumentException: More than one fragment with the name [org_apache_jasper_el] was found. This is not legal with relative ordering. See section 8.2.2 2c of the Servlet specification for details. Consider using absolute ordering.
2021-03-22T10:59:37.038020+00:00 app[web.1]: at org.apache.tomcat.util.descriptor.web.WebXml.orderWebFragments(WebXml.java:2260)
2021-03-22T10:59:37.038168+00:00 app[web.1]: at org.apache.tomcat.util.descriptor.web.WebXml.orderWebFragments(WebXml.java:2218)
2021-03-22T10:59:37.038303+00:00 app[web.1]: at org.apache.catalina.startup.ContextConfig.webConfig(ContextConfig.java:1293)
2021-03-22T10:59:37.038389+00:00 app[web.1]: at org.apache.catalina.startup.ContextConfig.configureStart(ContextConfig.java:985)
2021-03-22T10:59:37.038513+00:00 app[web.1]: at org.apache.catalina.startup.ContextConfig.lifecycleEvent(ContextConfig.java:303)
2021-03-22T10:59:37.038643+00:00 app[web.1]: at org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:123)
2021-03-22T10:59:37.038743+00:00 app[web.1]: at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5082)
2021-03-22T10:59:37.038886+00:00 app[web.1]: at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
2021-03-22T10:59:37.039030+00:00 app[web.1]: ... 22 more
2021-03-22T10:59:37.381417+00:00 heroku[web.1]: Process exited with status 1
2021-03-22T10:59:37.461300+00:00 heroku[web.1]: State changed from up to crashed
2021-03-22T11:01:36.894717+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=furniturecom.herokuapp.com request_id=b6646c70-d763-4882-8884-9d3eff323131 fwd="116.106.26.244" dyno= connect= service= status=503 bytes= protocol=https
2021-03-22T11:01:37.210916+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/favicon.ico" host=furniturecom.herokuapp.com request_id=0e3647b3-1936-4dda-b36d-ebd0574b2877 fwd="116.106.26.244" dyno= connect= service= status=503 bytes= protocol=https

Nó vẫn bị như này anh ạ. @library

1 Like

Cảm ơn cậu nha @lqcuong99 :smile:

Tớ có thấy dòng log này ở log phía trên:

2021-03-22T10:00:26.732717+00:00 app[web.1]: The specified path “target/helloworld.war” does not exist.

Cậu xem lại câu lệnh trong Procfile xem. Tớ không chắc là đúng đâu.

web: java $JAVA_OPTS -jar target/dependency/webapp-runner.jar --port $PORT target/helloworld.war

Có một vài điểm:

  • Tớ không thấy cậu đề cập build ra war file trong pom.xml. Cậu có chắc là file build được tạo ra là file helloworld.war không?
  • Tại sao cậu lại cần target/dependency/webapp-runner.jar vậy? :smile:
  • Tớ không nhớ ở java có support --port flag. Cậu có nhầm nó với -Dserver.port không?

Cậu nên tham khảo tài liệu này xem:

Hope it helps!

4 Likes

Em mới cập nhật lại bài viết, anh xem lại giúp em.
Sau khi thêm webapp-runner thì lỗi này không còn nữa

Procfile này em tham khảo trên stackoverflow, lúc đầu thì em cũng làm như heroku hướng dẫn nhưng không được anh ạ. Cái này em sẽ thử lại.

Cái này anh chỉ rõ giúp em, có cần thiết phải build file war ra không?

1 Like

Ừ cậu, thực ra ở srping boot, cậu chỉ cần file jar là được rồi. Spring boot có tomcat embedded sẵn rồi, nên cậu không cần file war như cậu dùng để deploy lên một tomcat server nào đó.
Cậu thử giữ nguyên file pom hiện tại, build và vào thư mục target để xem output là gì xem. Tớ nghĩ nó sẽ là file helloworld.jar đó :smile:

Thử kiểm tra lại theo tutorial của Heroku nha cậu :smile:

2 Likes

Em deploy được rồi anh ạ, do trong quá trình hấp tấp quá quên build ra file war/jar

1 Like

Chúc mừng cậu nha :smile: Well done!

3 Likes
83% thành viên diễn đàn không hỏi bài tập, còn bạn thì sao?