我正在使用 Atlassian Bamboo Heroku 插件来构建我的 Java Web 应用程序并将其部署到 Heroku。构建成功执行,然后将 war 文件上传到现在应该可用的 Heroku,但是,我得到了标准的 Heroku 应用程序错误页面,并且可以在我的 Heroku 日志中看到以下内容:
2012-11-11T12:41:12+00:00 app[web.1]: INFO: Initializing Spring root WebApplicationContext
2012-11-11T12:41:17+00:00 app[web.1]: at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1549)
2012-11-11T12:41:17+00:00 app[web.1]: at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334)
2012-11-11T12:41:17+00:00 app[web.1]: at java.util.concurrent.FutureTask.run(FutureTask.java:166)
2012-11-11T12:41:17+00:00 app[web.1]: at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
2012-11-11T12:41:17+00:00 app[web.1]: at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
2012-11-11T12:41:17+00:00 app[web.1]: at java.lang.Thread.run(Thread.java:636)
2012-11-11T12:41:17+00:00 app[web.1]: Nov 11, 2012 12:41:17 PM org.apache.catalina.core.StandardContext startInternal
2012-11-11T12:41:17+00:00 app[web.1]: SEVERE: Error listenerStart
2012-11-11T12:41:17+00:00 app[web.1]: Nov 11, 2012 12:41:17 PM org.apache.catalina.core.StandardContext listenerStart
2012-11-11T12:41:17+00:00 app[web.1]: SEVERE: Exception sending context initialized event to listener instance of class org.springframework.web.util.Log4jConfigListener
2012-11-11T12:41:17+00:00 app[web.1]: java.lang.IllegalStateException: Cannot set web app root system property when WAR file is not expanded
2012-11-11T12:41:17+00:00 app[web.1]: at org.springframework.web.util.WebUtils.setWebAppRootSystemProperty(WebUtils.java:137)
2012-11-11T12:41:17+00:00 app[web.1]: at org.springframework.web.util.Log4jWebConfigurer.initLogging(Log4jWebConfigurer.java:117)
2012-11-11T12:41:17+00:00 app[web.1]: at org.springframework.web.util.Log4jConfigListener.contextInitialized(Log4jConfigListener.java:45)
2012-11-11T12:41:17+00:00 app[web.1]: at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4791)
2012-11-11T12:41:17+00:00 app[web.1]: at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5285)
2012-11-11T12:41:17+00:00 app[web.1]: at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
2012-11-11T12:41:17+00:00 app[web.1]: at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1559)
2012-11-11T12:41:19+00:00 app[web.1]: Nov 11, 2012 12:41:19 PM org.apache.catalina.util.SessionIdGenerator createSecureRandom
2012-11-11T12:41:19+00:00 app[web.1]: INFO: Creation of SecureRandom instance for session ID generation using [SHA1PRNG] took [2,144] milliseconds.
2012-11-11T12:41:19+00:00 app[web.1]: Nov 11, 2012 12:41:19 PM org.apache.catalina.core.StandardContext startInternal
2012-11-11T12:41:19+00:00 app[web.1]: SEVERE: Context [/] startup failed due to previous errors
2012-11-11T12:41:19+00:00 app[web.1]: SEVERE: Context [/] failed in [org.apache.catalina.core.StandardContext] lifecycle. Allowing Tomcat to shutdown.
2012-11-11T12:41:19+00:00 app[web.1]: Nov 11, 2012 12:41:19 PM org.apache.catalina.core.ApplicationContext log
2012-11-11T12:41:19+00:00 app[web.1]: INFO: Shutting down log4j
2012-11-11T12:41:19+00:00 app[web.1]: INFO: Closing Spring root WebApplicationContext
如果我从我的控制台安装应用程序战争(使用 git push heroku master),它似乎一切正常。