如何使用VRaptor在Heroku中部署

时间:2013-02-20 00:19:48

标签: java vraptor

在开发环境(使用Eclipse)中使用VRaptor开发项目没有问题。

然而,当尝试在Heroku上进行部署时,发生了一个错误,我无法在开发环境中进行游戏。

2013-02-13T13:36:01+00:00 heroku[web.1]: State changed from crashed to starting
2013-02-13T13:36:05+00:00 heroku[web.1]: Starting process with command `${PRE_JAVA}java ${JAVA_OPTS} -jar webapp-runner-7.0.34.0.jar --port ${PORT} ${WEBAPP_RUNNER_OPTS} teste.war`
2013-02-13T13:36:06+00:00 app[web.1]: Adding Context / for teste.war
2013-02-13T13:36:08+00:00 app[web.1]: Feb 13, 2013 1:36:08 PM org.apache.coyote.AbstractProtocol init
2013-02-13T13:36:08+00:00 app[web.1]: INFO: Initializing ProtocolHandler ["http-nio-57620"]
2013-02-13T13:36:08+00:00 app[web.1]: Feb 13, 2013 1:36:08 PM org.apache.tomcat.util.net.NioSelectorPool getSharedSelector
2013-02-13T13:36:08+00:00 app[web.1]: INFO: Using a shared selector for servlet write/read
2013-02-13T13:36:08+00:00 app[web.1]: Feb 13, 2013 1:36:08 PM org.apache.catalina.core.StandardService startInternal
2013-02-13T13:36:08+00:00 app[web.1]: INFO: Starting service Tomcat
2013-02-13T13:36:08+00:00 app[web.1]: Feb 13, 2013 1:36:08 PM org.apache.catalina.core.StandardEngine startInternal
2013-02-13T13:36:08+00:00 app[web.1]: INFO: Starting Servlet Engine: Apache Tomcat/7.0.34
2013-02-13T13:36:09+00:00 app[web.1]: Feb 13, 2013 1:36:09 PM org.apache.catalina.loader.WebappClassLoader validateJarFile
2013-02-13T13:36:09+00:00 app[web.1]: INFO: validateJarFile(/app/target/tomcat.57620/work/Tomcat/localhost/_/WEB-INF/lib/servlet-api.jar) - jar not loaded. See Servlet Spec 2.3, section 9.7.2. Offending class: javax/servlet/Servlet.class
2013-02-13T13:36:09+00:00 app[web.1]: Feb 13, 2013 1:36:09 PM org.apache.catalina.startup.ContextConfig getDefaultWebXmlFragment
2013-02-13T13:36:09+00:00 app[web.1]: INFO: No global web.xml found
2013-02-13T13:36:09+00:00 heroku[web.1]: State changed from starting to up
2013-02-13T13:36:17+00:00 app[web.1]: log4j:ERROR No appender named [rolling-file] could be found.
2013-02-13T13:36:17+00:00 app[web.1]: 13:36:17,288  INFO [BasicConfiguration  ] Using class br.com.caelum.vraptor.ioc.spring.SpringProvider as Container Provider
2013-02-13T13:36:17+00:00 app[web.1]: 13:36:17,288 [localhost-startStop-1] INFO  BasicConfiguration - Using class br.com.caelum.vraptor.ioc.spring.SpringProvider as Container Provider
2013-02-13T13:36:17+00:00 app[web.1]: 13:36:17,303  INFO [DefaultSpringLocator] No application context found
2013-02-13T13:36:17+00:00 app[web.1]: 13:36:17,303 [localhost-startStop-1] INFO  DefaultSpringLocator - No application context found
2013-02-13T13:36:17+00:00 app[web.1]: 13:36:17,367  INFO [BasicConfiguration  ] br.com.caelum.vraptor.scanning = null
2013-02-13T13:36:17+00:00 app[web.1]: 13:36:17,367 [localhost-startStop-1] INFO  BasicConfiguration - br.com.caelum.vraptor.scanning = null
2013-02-13T13:36:17+00:00 app[web.1]: 13:36:17,367  INFO [WebAppBootstrapFactory] Dynamic WebAppBootstrap found.
2013-02-13T13:36:17+00:00 app[web.1]: 13:36:17,367 [localhost-startStop-1] INFO  WebAppBootstrapFactory - Dynamic WebAppBootstrap found.
2013-02-13T13:36:17+00:00 app[web.1]: Feb 13, 2013 1:36:17 PM org.apache.catalina.core.StandardContext filterStart
2013-02-13T13:36:17+00:00 app[web.1]: SEVERE: Exception starting filter vraptor
2013-02-13T13:36:17+00:00 app[web.1]: br.com.caelum.vraptor.scan.ScannerException: Could not determine WEB-INF/classes location
2013-02-13T13:36:17+00:00 app[web.1]:  at br.com.caelum.vraptor.scan.WebBasedClasspathResolver.findWebInfClassesLocation(WebBasedClasspathResolver.java:58)
2013-02-13T13:36:17+00:00 app[web.1]:  at br.com.caelum.vraptor.scan.ScannotationComponentScanner.scan(ScannotationComponentScanner.java:50)
2013-02-13T13:36:17+00:00 app[web.1]:  at br.com.caelum.vraptor.scan.WebAppBootstrapFactory.scannerFor(WebAppBootstrapFactory.java:81)
2013-02-13T13:36:17+00:00 app[web.1]:  at br.com.caelum.vraptor.scan.WebAppBootstrapFactory.create(WebAppBootstrapFactory.java:51)
2013-02-13T13:36:17+00:00 app[web.1]:  at br.com.caelum.vraptor.ioc.spring.SpringProvider.start(SpringProvider.java:83)
2013-02-13T13:36:17+00:00 app[web.1]:  at br.com.caelum.vraptor.VRaptor.init(VRaptor.java:108)
2013-02-13T13:36:17+00:00 app[web.1]:  at br.com.caelum.vraptor.VRaptor.init(VRaptor.java:102)
2013-02-13T13:36:17+00:00 app[web.1]:  at org.apache.catalina.core.ApplicationFilterConfig.initFilter(ApplicationFilterConfig.java:278)
2013-02-13T13:36:17+00:00 app[web.1]:  at org.apache.catalina.core.ApplicationFilterConfig.getFilter(ApplicationFilterConfig.java:259)
2013-02-13T13:36:17+00:00 app[web.1]:  at org.apache.catalina.core.ApplicationFilterConfig.setFilterDef(ApplicationFilterConfig.java:383)
2013-02-13T13:36:17+00:00 app[web.1]:  at org.apache.catalina.core.ApplicationFilterConfig.<init>(ApplicationFilterConfig.java:104)
2013-02-13T13:36:17+00:00 app[web.1]:  at org.apache.catalina.core.StandardContext.filterStart(StandardContext.java:4650)
2013-02-13T13:36:17+00:00 app[web.1]:  at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5306)
2013-02-13T13:36:17+00:00 app[web.1]:  at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
2013-02-13T13:36:17+00:00 app[web.1]:  at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1559)
2013-02-13T13:36:17+00:00 app[web.1]:  at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1549)
2013-02-13T13:36:17+00:00 app[web.1]:  at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334)
2013-02-13T13:36:17+00:00 app[web.1]:  at java.util.concurrent.FutureTask.run(FutureTask.java:166)
2013-02-13T13:36:17+00:00 app[web.1]:  at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
2013-02-13T13:36:17+00:00 app[web.1]:  at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
2013-02-13T13:36:17+00:00 app[web.1]:  at java.lang.Thread.run(Thread.java:636)
2013-02-13T13:36:17+00:00 app[web.1]: Caused by: br.com.caelum.vraptor.scan.ScannerException: Could not locate web.xml. Please use the proper argument in command-line.
2013-02-13T13:36:17+00:00 app[web.1]:  at br.com.caelum.vraptor.scan.StandaloneClasspathResolver.getWebxml(StandaloneClasspathResolver.java:139)
2013-02-13T13:36:17+00:00 app[web.1]:  at br.com.caelum.vraptor.scan.StandaloneClasspathResolver.findWebInfClassesLocation(StandaloneClasspathResolver.java:72)
2013-02-13T13:36:17+00:00 app[web.1]:  at br.com.caelum.vraptor.scan.WebBasedClasspathResolver.findWebInfClassesLocation(WebBasedClasspathResolver.java:55)
2013-02-13T13:36:17+00:00 app[web.1]:  ... 20 more
2013-02-13T13:36:17+00:00 app[web.1]: Feb 13, 2013 1:36:17 PM org.apache.catalina.core.StandardContext startInternal
2013-02-13T13:36:17+00:00 app[web.1]: SEVERE: Error filterStart
2013-02-13T13:36:17+00:00 app[web.1]: Feb 13, 2013 1:36:17 PM org.apache.catalina.core.StandardContext startInternal
2013-02-13T13:36:17+00:00 app[web.1]: SEVERE: Context [/] startup failed due to previous errors
2013-02-13T13:36:17+00:00 app[web.1]: SEVERE: Context [/] failed in [org.apache.catalina.core.StandardContext] lifecycle. Allowing Tomcat to shutdown.
2013-02-13T13:36:17+00:00 app[web.1]: Feb 13, 2013 1:36:17 PM org.apache.catalina.loader.WebappClassLoader clearReferencesJdbc
2013-02-13T13:36:17+00:00 app[web.1]: SEVERE: The web application [/] registered the JDBC driver [com.mysql.jdbc.Driver] but failed to unregister it when the web application was stopped. To prevent a memory leak, the JDBC Driver has been forcibly unregistered.
2013-02-13T13:36:17+00:00 app[web.1]: Feb 13, 2013 1:36:17 PM org.apache.catalina.loader.WebappClassLoader clearReferencesThreads
2013-02-13T13:36:17+00:00 app[web.1]: SEVERE: The web application [/] appears to have started a thread named [Abandoned connection cleanup thread] but has failed to stop it. This is very likely to create a memory leak.
2013-02-13T13:36:17+00:00 app[web.1]: Feb 13, 2013 1:36:17 PM org.apache.coyote.AbstractProtocol start
2013-02-13T13:36:17+00:00 app[web.1]: INFO: Starting ProtocolHandler ["http-nio-57620"]
2013-02-13T13:36:19+00:00 heroku[web.1]: Process exited with status 0
2013-02-13T13:36:19+00:00 heroku[web.1]: State changed from up to crashed

2 个答案:

答案 0 :(得分:2)

您需要在产生战争之前生成静态扫描。

答案 1 :(得分:0)

我没有尝试将Heroku与Vraptor一起使用。但是,您可以查看为在heroku中部署而创建的vraptor-blank-project。我希望它可以帮助你。