简体   繁体   English

需要帮助Java Web App(webapp运行程序,tomcat)heroku(应用程序崩溃)

[英]Need Help Java Web App (webapp-runner, tomcat) heroku (app crashed)

I have a Java web app on heroku. 我在heroku上有一个Java Web应用程序。 I created a web app that run webpage + server (apache jena fuseki) using this tutorial from heroku webpage . 使用heroku网页上的本教程创建了一个运行网页+服务器(apache jena fuseki)的网络应用。 It works fine on localhost:3030 (execute batch file) and localhost:8080 using 使用localhost:3030(执行批处理文件)和localhost:8080可以正常工作

java -jar target/dependency/webapp-runner.jar target/*.war

I push it on heroku with Procfile like this 我像这样用Procfile将其推到heroku上

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

The running app shows an Application Error when I tried to access it. 当我尝试访问正在运行的应用程序时,显示应用程序错误。 Is there any way to resolve this? 有什么办法解决这个问题?

My heroku logs 我的Heroku日志

[web.1]:    at java.lang.Thread.run(Thread.java:745)
[web.1]: May 07, 2017 7:27:56 PM org.apache.catalina.core.StandardContext listenerStart
[web.1]: SEVERE: Exception sending context initialized event to listener instance of class org.apache.jena.fuseki.server.ShiroEnvironmentLoader
[web.1]: org.apache.jena.fuseki.FusekiConfigException: Failed to create directory: /etc/fuseki
[web.1]:    at org.apache.jena.fuseki.server.FusekiServer.ensureDir(FusekiServer.java:363)
[web.1]:    at org.apache.jena.fuseki.server.FusekiServer.formatBaseArea(FusekiServer.java:132)
[web.1]:    at org.apache.jena.fuseki.server.ShiroEnvironmentLoader.contextInitialized(ShiroEnvironmentLoader.java:50)
[web.1]:    at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4727)
[web.1]:    at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5189)
[web.1]:    at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
[web.1]:    at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1419)
[web.1]:    at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1409)
[web.1]:    at java.util.concurrent.FutureTask.run(FutureTask.java:266)
[web.1]:    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
[web.1]:    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
[web.1]:    at java.lang.Thread.run(Thread.java:745)
[web.1]:
[web.1]: [2017-05-07 19:27:56] Server     ERROR Failed to initialize : Server not running
[web.1]: May 07, 2017 7:27:56 PM org.apache.catalina.core.StandardContext startInternal
[web.1]: SEVERE: One or more listeners failed to start. Full details will be found in the appropriate container log file
[web.1]: May 07, 2017 7:27:56 PM org.apache.catalina.core.StandardContext startInternal
[web.1]: SEVERE: Context [] startup failed due to previous errors
[web.1]: May 07, 2017 7:27:56 PM org.apache.catalina.core.ApplicationContext log
[web.1]: SEVERE: Context [] failed in [org.apache.catalina.core.StandardContext] lifecycle. Allowing Tomcat to shutdown.
[web.1]: INFO: Cleaning up Shiro Environment
[web.1]: May 07, 2017 7:27:57 PM org.apache.coyote.AbstractProtocol start
[web.1]: INFO: Starting ProtocolHandler [http-nio-55883]
[web.1]: May 07, 2017 7:27:57 PM org.apache.coyote.AbstractProtocol pause
[web.1]: INFO: Pausing ProtocolHandler ["http-nio-55883"]
heroku[router]: at=error code=H13 desc="Connection closed without response" method=GET path="/" host=lmaokid.herokuapp.com request_id=3250ba55-3f3d-4bfd-a2e7-034c47f7b8d1 fwd="110.139.88.158" dyno=web.1 connect=1ms service=3265ms status=503 bytes=0 protocol=https
heroku[web.1]: Process exited with status 0
heroku[web.1]: State changed from up to crashed
heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/favicon.ico" host=lmaokid.herokuapp.com request_id=90b84002-f43b-49f9-a88f-1e4df6a5e058 fwd="110.139.88.158" dyno= connect= service= status=503 bytes= protocol=https

And my pom.xml 还有我的pom.xml

<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>com.example</groupId>
<artifactId>my-app</artifactId>
<version>1.0-SNAPSHOT</version>
<packaging>war</packaging>

<name>Maven Quick Start Archetype</name>
<url>http://maven.apache.org</url>
<dependencies>
 <dependency>
    <groupId>org.apache.jena</groupId>
    <artifactId>jena-fuseki</artifactId>
    <type>pom</type>
    <version>2.5.0</version>
  </dependency>

   <dependency>
    <groupId>org.apache.jena</groupId>
    <artifactId>jena-fuseki-war</artifactId>
    <type>war</type>
    <version>2.5.0</version>
  </dependency>

   <dependency>
    <groupId>org.apache.jena</groupId>
    <artifactId>jena-fuseki-server</artifactId>
    <version>2.5.0</version>
  </dependency>

</dependencies>

<build>
    <plugins>
        <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.5.11.3</version>
                                <destFileName>webapp-runner.jar</destFileName>
                            </artifactItem>
                        </artifactItems>
                    </configuration>
                </execution>
            </executions>
        </plugin>
    </plugins>
</build>
</project>

If you look closely, you'll see the main error: 如果仔细观察,将会看到主要错误:

Failed to create directory: /etc/fuseki

I recommend creating any directories under /app on Heroku, as this is the user space. 我建议在Heroku的/app下创建任何目录,因为这是用户空间。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 Java Web App在带有webapp-runner的Heroku上崩溃 - Java Web App Crashes on Heroku with webapp-runner 在webapp-runner中运行的对Heroku Web-app的API调用最终失败,并出现google.common中的NoSuchMethodError和NoClassDefFoundError - API calls to Heroku web-app running in webapp-runner eventually fail with NoSuchMethodError then NoClassDefFoundError in google.common Heroku Webapp运行程序-启用命名 - Heroku webapp-runner --enable-naming Heroku Webapp运行程序JNDI命名,资源不可用 - Heroku webapp-runner JNDI naming, resource not available webapp运行程序错误(NoInitialContextException) - webapp-runner error (NoInitialContextException) 使用&#39;webapp-runner&#39;运行Spring Boot应用后,它在“ INFO:Starting ProtocolHandler [“ http-nio-8080”]”行中停止 - After running Spring boot app with 'webapp-runner' it's stoping on a line “INFO: Starting ProtocolHandler [”http-nio-8080“]” 正在运行的Heroku Java WAR应用程序现在失败:“无法访问jarfile webapp-runner-7.0.40.0.jar” - Heroku Java WAR app that was working now failing: “Unable to access jarfile webapp-runner-7.0.40.0.jar” Java Spring MVC无法在Heroku上启动应用程序。 错误H10(找不到webapp运行程序) - Java Spring MVC can't start app on Heroku. Error H10 (can't find webapp runner) 上下文路径与 webapp-runner 中的 Spring UrlTag 冲突? - Context path conflict with Spring UrlTag in webapp-runner? Spymemcached与hibernate-memcached和webapp-runner发生冲突 - Spymemcached conflict with hibernate-memcached and webapp-runner
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM