我正在尝试在Heroku上部署Web应用程序。我将其转换为WAR文件,并尝试对其进行部署。虽然当我查看日志时仍然遇到此错误
2020-02-02T05:02:12.566944+00:00 app[web.1]: at org.apache.catalina.core.StandardEngine.startInternal(StandardEngine.java:262)
2020-02-02T05:02:12.566946+00:00 app[web.1]: at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
2020-02-02T05:02:12.566948+00:00 app[web.1]: at org.apache.catalina.core.StandardService.startInternal(StandardService.java:421)
2020-02-02T05:02:12.566951+00:00 app[web.1]: at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
2020-02-02T05:02:12.566953+00:00 app[web.1]: at org.apache.catalina.core.StandardServer.startInternal(StandardServer.java:930)
2020-02-02T05:02:12.566955+00:00 app[web.1]: at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
2020-02-02T05:02:12.566957+00:00 app[web.1]: at org.apache.catalina.startup.Tomcat.start(Tomcat.java:459)
2020-02-02T05:02:12.566959+00:00 app[web.1]: at webapp.runner.launch.Main.main(Main.java:289)
2020-02-02T05:02:12.566961+00:00 app[web.1]: Caused by: org.apache.catalina.LifecycleException: A child container failed during start
2020-02-02T05:02:12.566963+00:00 app[web.1]: at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:928)
2020-02-02T05:02:12.566965+00:00 app[web.1]: at org.apache.catalina.core.StandardHost.startInternal(StandardHost.java:841)
2020-02-02T05:02:12.566967+00:00 app[web.1]: at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
2020-02-02T05:02:12.566969+00:00 app[web.1]: at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1384)
2020-02-02T05:02:12.566971+00:00 app[web.1]: at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1374)
2020-02-02T05:02:12.566973+00:00 app[web.1]: at java.util.concurrent.FutureTask.run(FutureTask.java:266)
2020-02-02T05:02:12.566975+00:00 app[web.1]: at org.apache.tomcat.util.threads.InlineExecutorService.execute(InlineExecutorService.java:75)
2020-02-02T05:02:12.566977+00:00 app[web.1]: at java.util.concurrent.AbstractExecutorService.submit(AbstractExecutorService.java:134)
2020-02-02T05:02:12.566978+00:00 app[web.1]: at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:909)
2020-02-02T05:02:12.566980+00:00 app[web.1]: ... 8 more
2020-02-02T05:02:12.566984+00:00 app[web.1]: Caused by: java.util.concurrent.ExecutionException: org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Tomcat].StandardHost[localhost].StandardContext[]]
2020-02-02T05:02:12.566986+00:00 app[web.1]: at java.util.concurrent.FutureTask.report(FutureTask.java:122)
2020-02-02T05:02:12.566988+00:00 app[web.1]: at java.util.concurrent.FutureTask.get(FutureTask.java:192)
2020-02-02T05:02:12.566990+00:00 app[web.1]: at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:916)
2020-02-02T05:02:12.566992+00:00 app[web.1]: ... 16 more
2020-02-02T05:02:12.566994+00:00 app[web.1]: Caused by: org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Tomcat].StandardHost[localhost].StandardContext[]]
2020-02-02T05:02:12.566996+00:00 app[web.1]: at org.apache.catalina.util.LifecycleBase.handleSubClassException(LifecycleBase.java:440)
2020-02-02T05:02:12.566998+00:00 app[web.1]: at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:198)
2020-02-02T05:02:12.567001+00:00 app[web.1]: at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1384)
2020-02-02T05:02:12.567003+00:00 app[web.1]: at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1374)
2020-02-02T05:02:12.567004+00:00 app[web.1]: at java.util.concurrent.FutureTask.run(FutureTask.java:266)
2020-02-02T05:02:12.567006+00:00 app[web.1]: at org.apache.tomcat.util.threads.InlineExecutorService.execute(InlineExecutorService.java:75)
2020-02-02T05:02:12.567008+00:00 app[web.1]: at java.util.concurrent.AbstractExecutorService.submit(AbstractExecutorService.java:134)
2020-02-02T05:02:12.567010+00:00 app[web.1]: at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:909)
2020-02-02T05:02:12.567012+00:00 app[web.1]: ... 16 more
2020-02-02T05:02:12.567014+00:00 app[web.1]: Caused by: java.lang.NoClassDefFoundError: javax/ws/rs/core/Application
2020-02-02T05:02:12.567016+00:00 app[web.1]: at org.glassfish.jersey.servlet.init.JerseyServletContainerInitializer.addServletWithDefaultConfiguration(JerseyServletContainerInitializer.java:216)
2020-02-02T05:02:12.567018+00:00 app[web.1]: at org.glassfish.jersey.servlet.init.JerseyServletContainerInitializer.onStartupImpl(JerseyServletContainerInitializer.java:158)
2020-02-02T05:02:12.567020+00:00 app[web.1]: at org.glassfish.jersey.servlet.init.JerseyServletContainerInitializer.onStartup(JerseyServletContainerInitializer.java:119)
2020-02-02T05:02:12.567022+00:00 app[web.1]: at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5135)
2020-02-02T05:02:12.567024+00:00 app[web.1]: at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
2020-02-02T05:02:12.567026+00:00 app[web.1]: ... 22 more
2020-02-02T05:02:12.567028+00:00 app[web.1]: Caused by: java.lang.ClassNotFoundException: javax.ws.rs.core.Application
2020-02-02T05:02:12.567030+00:00 app[web.1]: at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1365)
2020-02-02T05:02:12.567032+00:00 app[web.1]: at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1188)
2020-02-02T05:02:12.567034+00:00 app[web.1]: ... 27 more
2020-02-02T05:02:12.567036+00:00 app[web.1]:
2020-02-02T05:02:12.567575+00:00 app[web.1]: Exception in thread "main" org.apache.catalina.LifecycleException: A child container failed during start
2020-02-02T05:02:12.567736+00:00 app[web.1]: at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:928)
2020-02-02T05:02:12.567789+00:00 app[web.1]: at org.apache.catalina.core.StandardEngine.startInternal(StandardEngine.java:262)
2020-02-02T05:02:12.567838+00:00 app[web.1]: at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
2020-02-02T05:02:12.567891+00:00 app[web.1]: at org.apache.catalina.core.StandardService.startInternal(StandardService.java:421)
2020-02-02T05:02:12.567943+00:00 app[web.1]: at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
2020-02-02T05:02:12.567996+00:00 app[web.1]: at org.apache.catalina.core.StandardServer.startInternal(StandardServer.java:930)
2020-02-02T05:02:12.568263+00:00 app[web.1]: at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
2020-02-02T05:02:12.568323+00:00 app[web.1]: at org.apache.catalina.startup.Tomcat.start(Tomcat.java:459)
2020-02-02T05:02:12.568376+00:00 app[web.1]: at webapp.runner.launch.Main.main(Main.java:289)
2020-02-02T05:02:12.568411+00:00 app[web.1]: Caused by: java.util.concurrent.ExecutionException: org.apache.catalina.LifecycleException: A child container failed during start
2020-02-02T05:02:12.568447+00:00 app[web.1]: at java.util.concurrent.FutureTask.report(FutureTask.java:122)
2020-02-02T05:02:12.568506+00:00 app[web.1]: at java.util.concurrent.FutureTask.get(FutureTask.java:192)
2020-02-02T05:02:12.568552+00:00 app[web.1]: at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:916)
2020-02-02T05:02:12.568580+00:00 app[web.1]: ... 8 more
2020-02-02T05:02:12.568618+00:00 app[web.1]: Caused by: org.apache.catalina.LifecycleException: A child container failed during start
2020-02-02T05:02:12.568650+00:00 app[web.1]: at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:928)
2020-02-02T05:02:12.568686+00:00 app[web.1]: at org.apache.catalina.core.StandardHost.startInternal(StandardHost.java:841)
2020-02-02T05:02:12.568711+00:00 app[web.1]: at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
2020-02-02T05:02:12.568803+00:00 app[web.1]: at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1384)
2020-02-02T05:02:12.568806+00:00 app[web.1]: at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1374)
2020-02-02T05:02:12.568808+00:00 app[web.1]: at java.util.concurrent.FutureTask.run(FutureTask.java:266)
2020-02-02T05:02:12.568841+00:00 app[web.1]: at org.apache.tomcat.util.threads.InlineExecutorService.execute(InlineExecutorService.java:75)
2020-02-02T05:02:12.568882+00:00 app[web.1]: at java.util.concurrent.AbstractExecutorService.submit(AbstractExecutorService.java:134)
2020-02-02T05:02:12.568908+00:00 app[web.1]: at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:909)
2020-02-02T05:02:12.568975+00:00 app[web.1]: ... 8 more
2020-02-02T05:02:12.569054+00:00 app[web.1]: Caused by: java.util.concurrent.ExecutionException: org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Tomcat].StandardHost[localhost].StandardContext[]]
2020-02-02T05:02:12.569116+00:00 app[web.1]: at java.util.concurrent.FutureTask.report(FutureTask.java:122)
2020-02-02T05:02:12.569179+00:00 app[web.1]: at java.util.concurrent.FutureTask.get(FutureTask.java:192)
2020-02-02T05:02:12.569240+00:00 app[web.1]: at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:916)
2020-02-02T05:02:12.569303+00:00 app[web.1]: ... 16 more
2020-02-02T05:02:12.569385+00:00 app[web.1]: Caused by: org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Tomcat].StandardHost[localhost].StandardContext[]]
2020-02-02T05:02:12.569446+00:00 app[web.1]: at org.apache.catalina.util.LifecycleBase.handleSubClassException(LifecycleBase.java:440)
2020-02-02T05:02:12.569496+00:00 app[web.1]: at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:198)
2020-02-02T05:02:12.569544+00:00 app[web.1]: at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1384)
2020-02-02T05:02:12.569602+00:00 app[web.1]: at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1374)
2020-02-02T05:02:12.569649+00:00 app[web.1]: at java.util.concurrent.FutureTask.run(FutureTask.java:266)
2020-02-02T05:02:12.569706+00:00 app[web.1]: at org.apache.tomcat.util.threads.InlineExecutorService.execute(InlineExecutorService.java:75)
2020-02-02T05:02:12.569760+00:00 app[web.1]: at java.util.concurrent.AbstractExecutorService.submit(AbstractExecutorService.java:134)
2020-02-02T05:02:12.569822+00:00 app[web.1]: at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:909)
2020-02-02T05:02:12.569875+00:00 app[web.1]: ... 16 more
2020-02-02T05:02:12.569954+00:00 app[web.1]: Caused by: java.lang.NoClassDefFoundError: javax/ws/rs/core/Application
2020-02-02T05:02:12.570016+00:00 app[web.1]: at org.glassfish.jersey.servlet.init.JerseyServletContainerInitializer.addServletWithDefaultConfiguration(JerseyServletContainerInitializer.java:216)
2020-02-02T05:02:12.570105+00:00 app[web.1]: at org.glassfish.jersey.servlet.init.JerseyServletContainerInitializer.onStartupImpl(JerseyServletContainerInitializer.java:158)
2020-02-02T05:02:12.570139+00:00 app[web.1]: at org.glassfish.jersey.servlet.init.JerseyServletContainerInitializer.onStartup(JerseyServletContainerInitializer.java:119)
2020-02-02T05:02:12.570180+00:00 app[web.1]: at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5135)
2020-02-02T05:02:12.570205+00:00 app[web.1]: at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
2020-02-02T05:02:12.570282+00:00 app[web.1]: ... 22 more
2020-02-02T05:02:12.570400+00:00 app[web.1]: Caused by: java.lang.ClassNotFoundException: javax.ws.rs.core.Application
2020-02-02T05:02:12.570461+00:00 app[web.1]: at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1365)
2020-02-02T05:02:12.570526+00:00 app[web.1]: at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1188)
2020-02-02T05:02:12.570586+00:00 app[web.1]: ... 27 more
2020-02-02T05:02:14.390454+00:00 heroku[web.1]: State changed from up to crashed
2020-02-02T05:02:14.370411+00:00 heroku[web.1]: Process exited with status 1
我找不到不使用Maven的堆栈溢出问题,也有同样的问题,该解决方案对我有用。我的战争档案是
39 Thu Nov 28 08:47:36 EST 2019 META-INF/MANIFEST.MF
0 Thu Nov 28 08:47:36 EST 2019 META-INF/
0 Mon Dec 02 07:20:34 EST 2019 WEB-INF/
0 Fri Nov 29 21:37:34 EST 2019 WEB-INF/classes/
0 Mon Dec 02 09:07:28 EST 2019 WEB-INF/classes/fbla/
2306 Sat Feb 01 20:41:06 EST 2020 WEB-INF/classes/fbla/AddStudentServlet.class
2180 Sat Feb 01 20:41:06 EST 2020 WEB-INF/classes/fbla/DeleteStudentServlet.class
10920 Sat Feb 01 09:32:28 EST 2020 WEB-INF/classes/fbla/FblaDAO.class
3516 Sat Feb 01 09:32:28 EST 2020 WEB-INF/classes/fbla/FblaManager.class
3226 Sat Feb 01 20:41:06 EST 2020 WEB-INF/classes/fbla/FblaServlet.class
2947 Sat Feb 01 20:41:06 EST 2020 WEB-INF/classes/fbla/ReportServlet.class
1871 Sat Feb 01 09:32:28 EST 2020 WEB-INF/classes/fbla/Student.class
1422 Sat Feb 01 09:32:28 EST 2020 WEB-INF/classes/fbla/StudentActivity.class
2667 Sat Feb 01 20:41:06 EST 2020 WEB-INF/classes/fbla/StudentServlet.class
2549 Sat Feb 01 20:41:06 EST 2020 WEB-INF/classes/fbla/StudentsDashboardServlet.class
2707 Sat Feb 01 20:41:06 EST 2020 WEB-INF/classes/fbla/UpdateStudentActivityServlet.class
0 Thu Nov 28 10:17:04 EST 2019 WEB-INF/classes/model/
797 Sat Feb 01 09:32:28 EST 2020 WEB-INF/classes/model/ModelRestWS.class
0 Mon Dec 02 07:20:48 EST 2019 WEB-INF/images/
15671 Mon Dec 02 07:20:48 EST 2019 WEB-INF/images/trashcan.jpg
0 Sat Nov 30 07:56:18 EST 2019 WEB-INF/javascript/
463 Sat Nov 30 07:57:14 EST 2019 WEB-INF/javascript/Signin.js
0 Sun Dec 01 17:17:20 EST 2019 WEB-INF/lib/
229650 Sat Nov 30 13:07:36 EST 2019 WEB-INF/lib/gson-2.6.2.jar
95505 Thu Nov 28 21:27:26 EST 2019 WEB-INF/lib/javax.servlet-api-4.0.1.jar
196494 Thu Nov 28 21:27:26 EST 2019 WEB-INF/lib/jersey-client-2.28.jar
1141593 Thu Nov 28 21:27:26 EST 2019 WEB-INF/lib/jersey-common-2.28.jar
32135 Thu Nov 28 21:27:26 EST 2019 WEB-INF/lib/jersey-container-servlet-2.28 (1).jar
32135 Thu Nov 28 21:27:26 EST 2019 WEB-INF/lib/jersey-container-servlet-2.28.jar
73338 Thu Nov 28 21:27:26 EST 2019 WEB-INF/lib/jersey-container-servlet-core-2.28.jar
83813 Thu Nov 28 21:27:26 EST 2019 WEB-INF/lib/jersey-entity-filtering-2.28.jar
76530 Thu Nov 28 21:27:26 EST 2019 WEB-INF/lib/jersey-hk2-2.28.jar
75210 Thu Nov 28 21:27:26 EST 2019 WEB-INF/lib/jersey-media-json-jackson-2.28.jar
935993 Thu Nov 28 21:27:26 EST 2019 WEB-INF/lib/jersey-server-2.28.jar
6012107 Sun Dec 01 17:17:20 EST 2019 WEB-INF/lib/sqlite-jdbc-3.27.2.1.jar
0 Mon Dec 02 09:05:12 EST 2019 WEB-INF/pages/
739 Sun Dec 01 22:00:22 EST 2019 WEB-INF/pages/AddStudent.jsp
522 Mon Dec 02 07:29:30 EST 2019 WEB-INF/pages/DeleteStudent.jsp
4027 Sat Nov 30 12:05:02 EST 2019 WEB-INF/pages/ErrorUser_not_USED.jsp
2426 Sat Nov 30 20:50:40 EST 2019 WEB-INF/pages/LoginUser.jspf
362 Sun Dec 01 11:50:16 EST 2019 WEB-INF/pages/StudentDetail.jsp
1176 Mon Dec 02 12:25:28 EST 2019 WEB-INF/pages/StudentHeader.jspf
524 Mon Dec 02 11:49:02 EST 2019 WEB-INF/pages/StudentReport.jsp
906 Mon Dec 02 12:54:04 EST 2019 WEB-INF/pages/StudentsDashboard.jspf
809 Mon Dec 02 11:57:38 EST 2019 WEB-INF/pages/UpdateStudentActivity.jsp
12278 Mon Dec 02 12:52:40 EST 2019 WEB-INF/pages/fbla.jsp
2602 Sat Feb 01 20:50:58 EST 2020 WEB-INF/web.xml
375 Thu Nov 28 08:51:16 EST 2019 index.jsp
让我知道你们还需要什么,我可以用它来编辑这篇文章 谢谢!