首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >需要帮助Java (webapp-runner,tomcat) heroku (应用程序崩溃)

需要帮助Java (webapp-runner,tomcat) heroku (应用程序崩溃)
EN

Stack Overflow用户
提问于 2017-05-07 19:52:27
回答 1查看 516关注 0票数 0

我在heroku上有一个Java网络应用程序。我创建了一个运行网页+服务器(apache ) 使用来自heroku网页的本教程的web应用程序。它在localhost:3030 (执行批处理文件)和localhost:8080上运行良好。

代码语言:javascript
复制
java -jar target/dependency/webapp-runner.jar target/*.war

我用这样的Procfile把它推到heroku上

代码语言:javascript
复制
web: java $JAVA_OPTS -jar target/dependency/webapp-runner.jar --port $PORT target/*.war

运行中的应用程序在我试图访问它时显示了一个应用程序错误。有什么办法解决这个问题吗?

我的heroku原木

代码语言:javascript
复制
[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

还有我的pom.xml

代码语言:javascript
复制
<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>
EN

回答 1

Stack Overflow用户

发布于 2017-05-07 20:54:03

如果仔细观察,您将看到主要错误:

代码语言:javascript
复制
Failed to create directory: /etc/fuseki

我建议在Heroku上创建/app下的任何目录,因为这是用户空间。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/43835977

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档