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ị.