gpt4 book ai didi

tomcat - Heroku:Tomcat 部署问题

转载 作者:行者123 更新时间:2023-11-28 22:41:07 25 4
gpt4 key购买 nike

我正在将应用程序部署到 heroku 。我使用 tomcat 8 和 Java 8,在本地运行良好。我使用 jar -cvf projectname.war * 命令生成 war 文件。我的 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 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>

<groupId>groupId</groupId>
<artifactId>trainer_for_vac</artifactId>
<version>1.0-SNAPSHOT</version>

<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>1.3.1.RELEASE</version>
</parent>

<properties>
<hibernate.version>5.0.6.Final</hibernate.version>
<java.version>1.8</java.version>
</properties>

<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.8.2</version>
<scope>test</scope>
</dependency>

<dependency>
<groupId>org.postgresql</groupId>
<artifactId>postgresql</artifactId>
<version>9.4.1207</version>
</dependency>

<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-core</artifactId>
<version>3.6.3.Final</version>
</dependency>

<dependency>
<groupId>javassist</groupId>
<artifactId>javassist</artifactId>
<version>3.12.1.GA</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>
<version>2.3</version>
<executions>
<execution>
<phase>package</phase>
<goals><goal>copy</goal></goals>
<configuration>
<artifactItems>
<artifactItem>
<groupId>com.github.jsimone</groupId>
<artifactId>webapp-runner</artifactId>
<version>8.0.24.0</version>
<destFileName>webapp-runner.jar</destFileName>
</artifactItem>
</artifactItems>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>



<repositories>
<repository>
<id>spring-releases</id>
<url>https://repo.spring.io/libs-release</url>
</repository>
<repository>
<id>JBoss repository</id>
<url>http://repository.jboss.org/nexus/content/groups/public/</url>
</repository>
</repositories>
<pluginRepositories>
<pluginRepository>
<id>spring-releases</id>
<url>https://repo.spring.io/libs-release</url>
</pluginRepository>
</pluginRepositories>

我根据 heroku 规范添加了 Procfile:

web: java $JAVA_OPTS -jar target/dependency/jetty-runner.jar --port $PORT target/*.war

heroku 日志给了我这样的异常(exception):

2016-02-04T14:27:28.481053+00:00 heroku[web.1]: Starting process with command `java $JAVA_OPTS -jar webapp-runner.jar ${WEBAPP_RUNNER_OPTS:-"--expand-war"} --port 51689 ./target/trainer_for_vac-1.0-SNAPSHOT.war`
2016-02-04T14:27:30.668475+00:00 app[web.1]: Picked up JAVA_TOOL_OPTIONS: -Xmx350m -Xss512k -Dfile.encoding=UTF-8
2016-02-04T14:27:30.662818+00:00 app[web.1]: Setting JAVA_TOOL_OPTIONS defaults based on dyno size. Custom settings will override them.
2016-02-04T14:27:31.475129+00:00 app[web.1]: Expanding trainer_for_vac-1.0-SNAPSHOT.war into /app/target/tomcat.51689/webapps/expanded
2016-02-04T14:27:31.475228+00:00 app[web.1]: Adding Context for /app/target/tomcat.51689/webapps/expanded
2016-02-04T14:27:32.271282+00:00 app[web.1]: Feb 04, 2016 2:27:32 PM org.apache.catalina.core.StandardService startInternal
2016-02-04T14:27:32.274659+00:00 app[web.1]: Feb 04, 2016 2:27:32 PM org.apache.catalina.core.StandardEngine startInternal
2016-02-04T14:27:32.261615+00:00 app[web.1]: INFO: Using a shared selector for servlet write/read
2016-02-04T14:27:32.274662+00:00 app[web.1]: INFO: Starting Servlet Engine: Apache Tomcat/8.0.23
2016-02-04T14:27:32.218347+00:00 app[web.1]: Feb 04, 2016 2:27:32 PM org.apache.coyote.AbstractProtocol init
2016-02-04T14:27:32.261610+00:00 app[web.1]: Feb 04, 2016 2:27:32 PM org.apache.tomcat.util.net.NioSelectorPool getSharedSelector
2016-02-04T14:27:32.218351+00:00 app[web.1]: INFO: Initializing ProtocolHandler ["http-nio-51689"]
2016-02-04T14:27:32.271285+00:00 app[web.1]: INFO: Starting service Tomcat
2016-02-04T14:27:32.689684+00:00 app[web.1]: Feb 04, 2016 2:27:32 PM org.apache.catalina.core.ContainerBase startInternal
2016-02-04T14:27:32.637943+00:00 app[web.1]: INFO: No global web.xml found
2016-02-04T14:27:32.689689+00:00 app[web.1]: java.util.concurrent.ExecutionException: org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Tomcat].StandardHost[localhost].StandardContext[]]
2016-02-04T14:27:32.637937+00:00 app[web.1]: Feb 04, 2016 2:27:32 PM org.apache.catalina.startup.ContextConfig getDefaultWebXmlFragment
2016-02-04T14:27:32.689694+00:00 app[web.1]: at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1409)
2016-02-04T14:27:32.689690+00:00 app[web.1]: at java.util.concurrent.FutureTask.report(FutureTask.java:122)
2016-02-04T14:27:32.689697+00:00 app[web.1]: at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
2016-02-04T14:27:32.689693+00:00 app[web.1]: at org.apache.catalina.core.StandardHost.startInternal(StandardHost.java:871)
2016-02-04T14:27:32.689691+00:00 app[web.1]: at java.util.concurrent.FutureTask.get(FutureTask.java:192)
2016-02-04T14:27:32.689687+00:00 app[web.1]: SEVERE: A child container failed during start
2016-02-04T14:27:32.689694+00:00 app[web.1]: at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
2016-02-04T14:27:32.689692+00:00 app[web.1]: at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:917)
2016-02-04T14:27:32.689695+00:00 app[web.1]: at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1399)
2016-02-04T14:27:32.689696+00:00 app[web.1]: at java.util.concurrent.FutureTask.run(FutureTask.java:266)
2016-02-04T14:27:32.689706+00:00 app[web.1]: at org.apache.catalina.startup.ContextConfig.processServletContainerInitializers(ContextConfig.java:1616)
2016-02-04T14:27:32.689708+00:00 app[web.1]: at org.apache.catalina.startup.ContextConfig.lifecycleEvent(ContextConfig.java:305)
2016-02-04T14:27:32.689703+00:00 app[web.1]: at java.lang.Class.forName0(Native Method)
2016-02-04T14:27:32.689699+00:00 app[web.1]: at java.lang.Thread.run(Thread.java:745)
2016-02-04T14:27:32.689705+00:00 app[web.1]: at org.apache.catalina.startup.WebappServiceLoader.load(WebappServiceLoader.java:156)
2016-02-04T14:27:32.689702+00:00 app[web.1]: Caused by: java.lang.NoClassDefFoundError: javax/websocket/DeploymentException
2016-02-04T14:27:32.689711+00:00 app[web.1]: at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
2016-02-04T14:27:32.689700+00:00 app[web.1]: Caused by: org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Tomcat].StandardHost[localhost].StandardContext[]]
2016-02-04T14:27:32.689704+00:00 app[web.1]: at java.lang.Class.forName(Class.java:348)
2016-02-04T14:27:32.689698+00:00 app[web.1]: at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
2016-02-04T14:27:32.689709+00:00 app[web.1]: at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:117)
2016-02-04T14:27:32.689713+00:00 app[web.1]: Caused by: java.lang.ClassNotFoundException: javax.websocket.DeploymentException
2016-02-04T14:27:32.689712+00:00 app[web.1]: ... 6 more
2016-02-04T14:27:32.689714+00:00 app[web.1]: at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1157)
2016-02-04T14:27:32.689702+00:00 app[web.1]: ... 6 more
2016-02-04T14:27:32.689716+00:00 app[web.1]:
2016-02-04T14:27:32.689715+00:00 app[web.1]: ... 18 more
2016-02-04T14:27:32.689709+00:00 app[web.1]: at org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:90)
2016-02-04T14:27:32.689707+00:00 app[web.1]: at org.apache.catalina.startup.ContextConfig.configureStart(ContextConfig.java:771)
2016-02-04T14:27:32.689707+00:00 app[web.1]: at org.apache.catalina.startup.ContextConfig.webConfig(ContextConfig.java:1128)
2016-02-04T14:27:32.689701+00:00 app[web.1]: at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:154)
2016-02-04T14:27:32.691438+00:00 app[web.1]: at java.util.concurrent.FutureTask.report(FutureTask.java:122)
2016-02-04T14:27:32.691436+00:00 app[web.1]: SEVERE: A child container failed during start
2016-02-04T14:27:32.691437+00:00 app[web.1]: java.util.concurrent.ExecutionException: org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Tomcat].StandardHost[localhost]]
2016-02-04T14:27:32.689710+00:00 app[web.1]: at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5066)
2016-02-04T14:27:32.691442+00:00 app[web.1]: at org.apache.catalina.core.StandardService.startInternal(StandardService.java:439)
2016-02-04T14:27:32.691442+00:00 app[web.1]: at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
2016-02-04T14:27:32.691440+00:00 app[web.1]: at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:917)
2016-02-04T14:27:32.691440+00:00 app[web.1]: at org.apache.catalina.core.StandardEngine.startInternal(StandardEngine.java:262)
2016-02-04T14:27:32.689713+00:00 app[web.1]: at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1305)
2016-02-04T14:27:32.691441+00:00 app[web.1]: at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
2016-02-04T14:27:32.689704+00:00 app[web.1]: at org.apache.catalina.startup.WebappServiceLoader.loadServices(WebappServiceLoader.java:186)
2016-02-04T14:27:32.691449+00:00 app[web.1]: at java.util.concurrent.FutureTask.run(FutureTask.java:266)
2016-02-04T14:27:32.691451+00:00 app[web.1]: at java.lang.Thread.run(Thread.java:745)
2016-02-04T14:27:32.691453+00:00 app[web.1]: at org.apache.catalina.core.StandardHost.startInternal(StandardHost.java:871)
2016-02-04T14:27:32.691455+00:00 app[web.1]: ... 6 more
2016-02-04T14:27:32.691443+00:00 app[web.1]: at org.apache.catalina.core.StandardServer.startInternal(StandardServer.java:769)
2016-02-04T14:27:32.691444+00:00 app[web.1]: at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
2016-02-04T14:27:32.691445+00:00 app[web.1]: at webapp.runner.launch.Main.main(Main.java:230)
2016-02-04T14:27:32.691447+00:00 app[web.1]: at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:154)
2016-02-04T14:27:32.691448+00:00 app[web.1]: at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1409)
2016-02-04T14:27:32.692231+00:00 app[web.1]: Exception in thread "main" org.apache.catalina.LifecycleException: Failed to start component [StandardServer[-1]]
2016-02-04T14:27:32.691445+00:00 app[web.1]: at org.apache.catalina.startup.Tomcat.start(Tomcat.java:337)
2016-02-04T14:27:32.691448+00:00 app[web.1]: at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1399)
2016-02-04T14:27:32.692749+00:00 app[web.1]: Caused by: org.apache.catalina.LifecycleException: Failed to start component [StandardService[Tomcat]]
2016-02-04T14:27:32.691454+00:00 app[web.1]: at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
2016-02-04T14:27:32.691451+00:00 app[web.1]: at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
2016-02-04T14:27:32.693245+00:00 app[web.1]: ... 2 more
2016-02-04T14:27:32.692859+00:00 app[web.1]: at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:154)
2016-02-04T14:27:32.692361+00:00 app[web.1]: at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:154)
2016-02-04T14:27:32.693174+00:00 app[web.1]: at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
2016-02-04T14:27:32.693480+00:00 app[web.1]: at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:154)
2016-02-04T14:27:32.691433+00:00 app[web.1]: Feb 04, 2016 2:27:32 PM org.apache.catalina.core.ContainerBase startInternal
2016-02-04T14:27:32.693549+00:00 app[web.1]: at org.apache.catalina.core.StandardService.startInternal(StandardService.java:439)
2016-02-04T14:27:32.691446+00:00 app[web.1]: Caused by: org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Tomcat].StandardHost[localhost]]
2016-02-04T14:27:32.691450+00:00 app[web.1]: at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
2016-02-04T14:27:32.693651+00:00 app[web.1]: at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
2016-02-04T14:27:32.691453+00:00 app[web.1]: at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:925)
2016-02-04T14:27:32.691439+00:00 app[web.1]: at java.util.concurrent.FutureTask.get(FutureTask.java:192)
2016-02-04T14:27:32.691456+00:00 app[web.1]:
2016-02-04T14:27:32.692614+00:00 app[web.1]: at webapp.runner.launch.Main.main(Main.java:230)
2016-02-04T14:27:32.693875+00:00 app[web.1]: Caused by: org.apache.catalina.LifecycleException: A child container failed during start
2016-02-04T14:27:32.693723+00:00 app[web.1]: ... 4 more
2016-02-04T14:27:32.694009+00:00 app[web.1]: at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:925)
2016-02-04T14:27:32.692467+00:00 app[web.1]: at org.apache.catalina.startup.Tomcat.start(Tomcat.java:337)
2016-02-04T14:27:32.694082+00:00 app[web.1]: at org.apache.catalina.core.StandardEngine.startInternal(StandardEngine.java:262)
2016-02-04T14:27:32.694254+00:00 app[web.1]: ... 6 more
2016-02-04T14:27:32.693380+00:00 app[web.1]: Caused by: org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Tomcat]]
2016-02-04T14:27:32.691452+00:00 app[web.1]: Caused by: org.apache.catalina.LifecycleException: A child container failed during start
2016-02-04T14:27:32.692997+00:00 app[web.1]: at org.apache.catalina.core.StandardServer.startInternal(StandardServer.java:769)
2016-02-04T14:27:32.694183+00:00 app[web.1]: at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
2016-02-04T14:27:33.870195+00:00 heroku[web.1]: Process exited with status 1
2016-02-04T14:27:32.841495+00:00 heroku[web.1]: State changed from starting to up
2016-02-04T14:27:33.902287+00:00 heroku[web.1]: State changed from up to crashed

我的*.war的内容:

drwxr-xr-x  2.0 unx        0 b- stor 16-Feb-03 17:27 META-INF/
-rw-r--r-- 2.0 unx 299 bl defN 16-Feb-03 17:27 META-INF/MANIFEST.MF
-rw-rw-r-- 2.0 unx 114 bl defN 16-Feb-03 17:27 META-INF/maven/groupId/trainer_for_vac/pom.properties
-rw-rw-r-- 2.0 unx 3450 bl defN 16-Feb-02 18:25 META-INF/maven/groupId/trainer_for_vac/pom.xml
drwxrwxr-x 2.0 unx 0 b- stor 16-Feb-03 17:24 WEB-INF/
drwxrwxr-x 2.0 unx 0 b- stor 16-Feb-03 17:24 WEB-INF/classes/
-rw-rw-r-- 2.0 unx 977 bl defN 16-Feb-02 17:55 WEB-INF/classes/User.hbm.xml
-rw-rw-r-- 2.0 unx 75 bl defN 16-Feb-03 17:27 WEB-INF/classes/application.properties
drwxrwxr-x 2.0 unx 0 b- stor 16-Feb-03 17:24 WEB-INF/classes/controller/
-rw-rw-r-- 2.0 unx 2882 bl defN 16-Feb-03 17:21 WEB-INF/classes/controller/Application.class
-rw-rw-r-- 2.0 unx 920 bl defN 16-Feb-03 17:21 WEB-INF/classes/hibernate.cfg.xml
drwxrwxr-x 2.0 unx 0 b- stor 16-Feb-03 17:24 WEB-INF/classes/model/
-rw-rw-r-- 2.0 unx 692 bl defN 16-Feb-03 17:21 WEB-INF/classes/model/User.class
drwxrwxr-x 2.0 unx 0 b- stor 16-Feb-03 17:24 WEB-INF/classes/util/
-rw-rw-r-- 2.0 unx 545 bl defN 16-Feb-03 17:21 WEB-INF/classes/util/CommonUtil.class
-rw-rw-r-- 2.0 unx 1427 bl defN 16-Feb-03 17:21 WEB-INF/classes/util/HibernateUtil.class
drwxrwxr-x 2.0 unx 0 b- stor 16-Feb-03 17:24 WEB-INF/lib/
-rw-rw-r-- 2.0 unx 445288 bl defN 15-Dec-18 14:49 WEB-INF/lib/antlr-2.7.7.jar
-rw-rw-r-- 2.0 unx 4467 bl defN 15-Dec-24 18:34 WEB-INF/lib/aopalliance-1.0.jar
-rw-rw-r-- 2.0 unx 62873 bl defN 15-Dec-24 18:34 WEB-INF/lib/classmate-1.1.0.jar
-rw-rw-r-- 2.0 unx 588337 bl defN 15-Dec-25 16:01 WEB-INF/lib/commons-collections-3.2.2.jar
-rw-rw-r-- 2.0 unx 313898 bl defN 15-Dec-18 14:49 WEB-INF/lib/dom4j-1.6.1.jar
-rw-rw-r-- 2.0 unx 71283 bl defN 15-Dec-25 16:01 WEB-INF/lib/hibernate-commons-annotations-3.2.0.Final.jar
-rw-rw-r-- 2.0 unx 3111916 bl defN 15-Dec-25 16:01 WEB-INF/lib/hibernate-core-3.6.3.Final.jar
-rw-rw-r-- 2.0 unx 100884 bl defN 15-Dec-25 16:01 WEB-INF/lib/hibernate-jpa-2.0-api-1.0.0.Final.jar
-rw-rw-r-- 2.0 unx 697321 bl defN 15-Dec-24 18:34 WEB-INF/lib/hibernate-validator-5.2.2.Final.jar
-rw-rw-r-- 2.0 unx 46989 bl defN 15-Dec-24 18:34 WEB-INF/lib/jackson-annotations-2.6.4.jar
-rw-rw-r-- 2.0 unx 258877 bl defN 15-Dec-24 18:34 WEB-INF/lib/jackson-core-2.6.4.jar
-rw-rw-r-- 2.0 unx 1171262 bl defN 15-Dec-24 18:34 WEB-INF/lib/jackson-databind-2.6.4.jar
-rw-rw-r-- 2.0 unx 644148 bl defN 15-Dec-25 16:01 WEB-INF/lib/javassist-3.12.1.GA.jar
-rw-rw-r-- 2.0 unx 66802 bl defN 15-Dec-24 18:34 WEB-INF/lib/jboss-logging-3.3.0.Final.jar
-rw-rw-r-- 2.0 unx 16430 bl defN 15-Dec-24 18:34 WEB-INF/lib/jcl-over-slf4j-1.7.13.jar
-rw-rw-r-- 2.0 unx 15071 bl defN 15-Dec-25 16:01 WEB-INF/lib/jta-1.1.jar
-rw-rw-r-- 2.0 unx 4595 bl defN 15-Dec-24 18:34 WEB-INF/lib/jul-to-slf4j-1.7.13.jar
-rw-rw-r-- 2.0 unx 24137 bl defN 15-Dec-24 18:34 WEB-INF/lib/log4j-over-slf4j-1.7.13.jar
-rw-rw-r-- 2.0 unx 280928 bl defN 15-Dec-24 18:34 WEB-INF/lib/logback-classic-1.1.3.jar
-rw-rw-r-- 2.0 unx 455041 bl defN 15-Dec-24 18:34 WEB-INF/lib/logback-core-1.1.3.jar
-rw-rw-r-- 2.0 unx 607093 bl defN 16-Feb-02 17:21 WEB-INF/lib/postgresql-9.4.1207.jar
-rw-rw-r-- 2.0 unx 33088 bl defN 15-Dec-24 18:34 WEB-INF/lib/slf4j-api-1.7.13.jar
-rw-rw-r-- 2.0 unx 269579 bl defN 15-Dec-24 18:34 WEB-INF/lib/snakeyaml-1.16.jar
-rw-rw-r-- 2.0 unx 370051 bl defN 15-Dec-24 18:34 WEB-INF/lib/spring-aop-4.2.4.RELEASE.jar
-rw-rw-r-- 2.0 unx 731512 bl defN 15-Dec-24 18:34 WEB-INF/lib/spring-beans-4.2.4.RELEASE.jar
-rw-rw-r-- 2.0 unx 540376 bl defN 15-Dec-24 18:34 WEB-INF/lib/spring-boot-1.3.1.RELEASE.jar
-rw-rw-r-- 2.0 unx 750598 bl defN 15-Dec-24 18:34 WEB-INF/lib/spring-boot-autoconfigure-1.3.1.RELEASE.jar
-rw-rw-r-- 2.0 unx 2219 bl defN 15-Dec-24 18:34 WEB-INF/lib/spring-boot-starter-1.3.1.RELEASE.jar
-rw-rw-r-- 2.0 unx 2254 bl defN 15-Dec-24 18:34 WEB-INF/lib/spring-boot-starter-logging-1.3.1.RELEASE.jar
-rw-rw-r-- 2.0 unx 2218 bl defN 15-Dec-24 18:34 WEB-INF/lib/spring-boot-starter-tomcat-1.3.1.RELEASE.jar
-rw-rw-r-- 2.0 unx 2241 bl defN 15-Dec-24 18:34 WEB-INF/lib/spring-boot-starter-validation-1.3.1.RELEASE.jar
-rw-rw-r-- 2.0 unx 2226 bl defN 15-Dec-24 18:34 WEB-INF/lib/spring-boot-starter-web-1.3.1.RELEASE.jar
-rw-rw-r-- 2.0 unx 1097552 bl defN 15-Dec-24 18:34 WEB-INF/lib/spring-context-4.2.4.RELEASE.jar
-rw-rw-r-- 2.0 unx 1078737 bl defN 15-Dec-24 18:34 WEB-INF/lib/spring-core-4.2.4.RELEASE.jar
-rw-rw-r-- 2.0 unx 262990 bl defN 15-Dec-24 18:34 WEB-INF/lib/spring-expression-4.2.4.RELEASE.jar
-rw-rw-r-- 2.0 unx 767333 bl defN 15-Dec-24 18:34 WEB-INF/lib/spring-web-4.2.4.RELEASE.jar
-rw-rw-r-- 2.0 unx 874575 bl defN 15-Dec-24 18:34 WEB-INF/lib/spring-webmvc-4.2.4.RELEASE.jar
-rw-rw-r-- 2.0 unx 2829987 bl defN 15-Dec-24 18:34 WEB-INF/lib/tomcat-embed-core-8.0.30.jar
-rw-rw-r-- 2.0 unx 238012 bl defN 15-Dec-24 18:34 WEB-INF/lib/tomcat-embed-el-8.0.30.jar
-rw-rw-r-- 2.0 unx 40845 bl defN 15-Dec-24 18:34 WEB-INF/lib/tomcat-embed-logging-juli-8.0.30.jar
-rw-rw-r-- 2.0 unx 245948 bl defN 15-Dec-24 18:34 WEB-INF/lib/tomcat-embed-websocket-8.0.30.jar
-rw-rw-r-- 2.0 unx 63777 bl defN 15-Dec-24 18:34 WEB-INF/lib/validation-api-1.1.0.Final.jar

任何人都可以提示我这里出了什么问题以及我应该如何解决它。在此先感谢您的帮助!

最佳答案

根本原因是库中缺少一个类,根据您的 Servlet 容器,它似乎有不同的实现。

您正在 Tomcat 上本地开发并将嵌入式 Tomcat 与您的应用程序捆绑在一起,但似乎试图在 Jetty 中运行远程应用程序?

web: java $JAVA_OPTS -jar target/dependency/jetty-runner.jar --port $PORT target/*.war

我建议您在捆绑的 Tomcat 服务器中运行它:

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

关于tomcat - Heroku:Tomcat 部署问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35203908/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com