gpt4 book ai didi

java - Dropwizard REST API服务器已退出,代码为1

转载 作者:行者123 更新时间:2023-12-01 12:12:28 29 4
gpt4 key购买 nike

我面临一个奇怪的问题。我的REST API服务器最初成功启动,但是在一秒钟内显示错误:rest_web_1 exited with code 1
Heroku日志:

2017-08-02T17:10:17.046289 + 00:00 heroku [web.1]:状态从开始更改为崩溃
2017-08-02T17:32:02.558126 + 00:00 heroku [web.1]:状态从崩溃更改为开始
2017-08-02T17:32:08.592558 + 00:00 heroku [web.1]:使用命令`java $ JAVA_OPTS -jar target/rest-api-0.0.1-SNAPSHOT.jar db config.yml && java启动进程$ JAVA_OPTS -Ddw.server.connector.port = 25407 -jar target/rest-api-0.0.1-SNAPSHOT.jar服务器config.yml`
2017-08-02T17:32:11.191891 + 00:00应用程序[web.1]:设置基于dyno大小的JAVA_TOOL_OPTIONS默认值。自定义设置将覆盖它们。
2017-08-02T17:32:11.196719 + 00:00 app [web.1]:拾取了JAVA_TOOL_OPTIONS:-Xmx350m -Xss512k -Dfile.encoding = UTF-8
2017-08-02T17:32:14.934624 + 00:00 app [web.1]:INFO [2017-08-02 17:32:14,927] com.xxx.restapi.RESTAPIConfiguration:Dropwizard数据库URL:未使用URL
2017-08-02T17:32:14.946383 + 00:00 app [web.1]:INFO [2017-08-02 17:32:14,945] com.xxx.restapi.HerokuDatabaseConfiguration:为url postgres://zbmzcwisbahqdv创建数据库:acbd315fe0cfef2f09f863bd917943ac65c07c91426c250e5be73f1c36c78067@ec2-107-22-173-160.compute-1.amazonaws.com:5432/d501u91mttif5a
2017-08-02T17:32:14.955800 + 00:00 app [web.1]:INFO [2017-08-02 17:32:14,955] com.xxx.restapi.RESTAPIConfiguration:Heroku数据库URL = jdbc:postgresql://ec2-107-22-173-160.compute-1.amazonaws.com:5432/d501u91mttif5a?ssl=true&sslfactory=org.postgresql.ssl.NonValidatingFactory
2017-08-02T17:32:17.728489 + 00:00 app [web.1]:INFO [2017-08-02 17:32:17,727] liquibase:成功获取更改日志锁
2017-08-02T17:32:22.267138 + 00:00 app [web.1]:INFO [2017-08-02 17:32:22,266] liquibase:从public.databasechangelog读取
2017-08-02T17:32:22.519081 + 00:00 app [web.1]:INFO [2017-08-02 17:32:22,518] liquibase:成功释放更改日志锁
2017-08-02T17:32:22.653060 + 00:00 app [web.1]:拾取JAVA_TOOL_OPTIONS:-Xmx350m -Xss512k -Dfile.encoding = UTF-8
2017-08-02T17:32:28.741222 + 00:00 app [web.1]:INFO [2017-08-02 17:32:28,737] org.eclipse.jetty.util.log:将初始化@ 6083ms记录到org。 eclipse.jetty.util.log.Slf4jLog
2017-08-02T17:32:28.870054 + 00:00 app [web.1]:INFO [2017-08-02 17:32:28,869] io.dropwizard.server.SimpleServerFactory:注册带有根路径前缀的jersey处理程序:/
2017-08-02T17:32:28.892861 + 00:00 app [web.1]:INFO [2017-08-02 17:32:28,892] com.xxx.restapi.RESTAPIConfiguration:Dropwizard数据库url:未使用的URL
2017-08-02T17:32:28.891933 + 00:00应用程序[web.1]:信息[2017-08-02 17:32:28,891] io.dropwizard.server.SimpleServerFactory:使用根路径前缀注册管理处理程序:/行政
2017-08-02T17:32:28.894018 + 00:00 app [web.1]:INFO [2017-08-02 17:32:28,893] com.xxx.restapi.HerokuDatabaseConfiguration:为url postgres://zbmzcwisbahqdv创建数据库:acbd315fe0cfef2f09f863bd917943ac65c07c91426c250e5be73f1c36c78067@ec2-107-22-173-160.compute-1.amazonaws.com:5432/d501u91mttif5a
2017-08-02T17:32:28.894901 + 00:00 app [web.1]:INFO [2017-08-02 17:32:28,894] com.xxx.restapi.RESTAPIConfiguration:Heroku数据库URL = jdbc:postgresql://ec2-107-22-173-160.compute-1.amazonaws.com:5432/d501u91mttif5a?ssl=true&sslfactory=org.postgresql.ssl.NonValidatingFactory
2017-08-02T17:32:29.556538 + 00:00 app [web.1]:INFO [2017-08-02 17:32:29,556] org.hibernate.Version:HHH000412:Hibernate Core {0.0.1-SNAPSHOT}
2017-08-02T17:32:29.580604 + 00:00 app [web.1]:INFO [2017-08-02 17:32:29,579] io.dropwizard.hibernate.SessionFactoryFactory:实体类:[com.xxx.restapi .model.REST,com.xxx.restapi.model.HardwareVersion]
2017-08-02T17:32:29.558231 + 00:00 app [web.1]:INFO [2017-08-02 17:32:29,557] org.hibernate.cfg。环境:HHH000206:找不到hibernate.properties
2017-08-02T17:32:29.674259 + 00:00 app [web.1]:INFO [2017-08-02 17:32:29,673] org.hibernate.annotations.common.Version:HCANN000001:Hibernate Commons Annotations {5.0 .1。最终}
2017-08-02T17:32:31.480300 + 00:00 app [web.1]:INFO [2017-08-02 17:32:31,479] org.hibernate.dialect.Dialect:HHH000400:使用方言:org.hibernate。方言PostgreSQL94方言
2017-08-02T17:32:32.988141 + 00:00 app [web.1]:INFO [2017-08-02 17:32:32,987] org.hibernate.engine.jdbc.env.internal.LobCreatorBuilderImpl:HHH000424:禁用当createClob()方法引发上下文LOB创建时发生错误:java.lang.reflect.InvocationTargetException
2017-08-02T17:32:32.991166 + 00:00 app [web.1]:INFO [2017-08-02 17:32:32,990] org.hibernate.type.BasicTypeRegistry:HHH000270:类型注册[java.util。 [UUID]会覆盖之前的内容:org.hibernate.type.UUIDBinaryType@b3e86d5
2017-08-02T17:32:34.138436 + 00:00 app [web.1]:INFO [2017-08-02 17:32:34,134] org.hibernate.type.BasicTypeRegistry:HHH000270:类型注册[java.util。货币]覆盖之前的内容:org.hibernate.type.CurrencyType@9b47400
2017-08-02T17:32:34.139054 + 00:00 app [web.1]:INFO [2017-08-02 17:32:34,138] org.hibernate.type.BasicTypeRegistry:HHH000270:类型注册[java.time。持续时间]覆盖上一个:org.hibernate.type.DurationType@747835f5
2017-08-02T17:32:34.139441 + 00:00 app [web.1]:INFO [2017-08-02 17:32:34,139] org.hibernate.type.BasicTypeRegistry:HHH000270:类型注册[java.time。即时]会覆盖之前的内容:org.hibernate.type.InstantType@51d0ec6f
2017-08-02T17:32:34.140427 + 00:00 app [web.1]:INFO [2017-08-02 17:32:34,139] org.hibernate.type.BasicTypeRegistry:HHH000270:类型注册[java.time。 [LocalDate]会覆盖之前的内容:org.hibernate.type.LocalDateType@4e0cc334
2017-08-02T17:32:34.140757 + 00:00 app [web.1]:INFO [2017-08-02 17:32:34,140] org.hibernate.type.BasicTypeRegistry:HHH000270:类型注册[java.time。 [LocalDateTime]会覆盖之前的内容:org.hibernate.type.LocalDateTimeType@1e12a5a6
2017-08-02T17:32:34.141057 + 00:00 app [web.1]:INFO [2017-08-02 17:32:34,140] org.hibernate.type.BasicTypeRegistry:HHH000270:类型注册[java.time。 [LocalTime]会覆盖之前的内容:org.hibernate.type.LocalTimeType@47a7c93e
2017-08-02T17:32:34.141482 + 00:00 app [web.1]:INFO [2017-08-02 17:32:34,141] org.hibernate.type.BasicTypeRegistry:HHH000270:类型注册[java.time。 [OffsetDateTime]会覆盖之前的内容:org.hibernate.type.OffsetDateTimeType@6f9ab79d
2017-08-02T17:32:34.142354 + 00:00 app [web.1]:INFO [2017-08-02 17:32:34,142] org.hibernate.type.BasicTypeRegistry:HHH000270:类型注册[java.time。 [OffsetTime]会覆盖之前的内容:org.hibernate.type.OffsetTimeType@64ae105d
2017-08-02T17:32:34.147946 + 00:00 app [web.1]:INFO [2017-08-02 17:32:34,145] org.hibernate.type.BasicTypeRegistry:HHH000270:类型注册[java.time。 ZonedDateTime]覆盖先前的内容:org.hibernate.type.ZonedDateTimeType@10a18e3e
2017-08-02T17:32:34.778461 + 00:00 app [web.1]:INFO [2017-08-02 17:32:34,769] com.xxx.restapi.RESTAPIApplication:正在启动REST-API应用服务器
2017-08-02T17:32:34.801376 + 00:00应用程序[web.1]:信息[2017-08-02 17:32:34,801] io.dropwizard.server.SimpleServerFactory:使用根路径前缀注册jersey处理程序:/
2017-08-02T17:32:34.812575 + 00:00 app [web.1]:INFO [2017-08-02 17:32:34,810] io.dropwizard.server.SimpleServerFactory:使用根路径前缀注册管理处理程序:/行政
2017-08-02T17:32:34.822918 + 00:00 app [web.1]:INFO [2017-08-02 17:32:34,814] io.dropwizard.server.ServerFactory:启动rest-api
2017-08-02T17:32:35.950162 + 00:00 heroku [web.1]:状态从启动更改为启动
2017-08-02T17:32:35.870712 + 00:00 app [web.1]:INFO [2017-08-02 17:32:35,867] org.eclipse.jetty.setuid.SetUIDListener:已打开rest-api @ 69a5c6be { HTTP/1.1,[http/1.1]} {0.0.0.0:25407}
2017-08-02T17:32:35.870854 + 00:00 app [web.1]:INFO [2017-08-02 17:32:35,869] org.eclipse.jetty.server.Server:jetty-9.4.z-SNAPSHOT
2017-08-02T17:32:36.159048 + 00:00 app [web.1]:信息[2017-08-02 17:32:36,158] org.eclipse.jetty.server.AbstractConnector:已启动rest-api @ 69a5c6be { HTTP/1.1,[http/1.1]} {0.0.0.0:25407}
2017-08-02T17:32:36.159396 + 00:00 app [web.1]:org/glassfish/jersey/spi/ScheduledThreadPoolExecutorProvider
2017-08-02T17:32:36.765005 + 00:00 heroku [web.1]:进程退出,状态为1
2017-08-02T17:32:36.778743 + 00:00 heroku [web.1]:状态从更改为崩溃

更新:

Docker文件
从heroku/java

docker-compose.yml
网络:
build : 。
命令:'bash -c''java $ JAVA_OPTS -jar target/rest-api-0.0.1-SNAPSHOT.jar db migration config.yml && java $ JAVA_OPTS -Ddw.server.connector.port = $ PORT -jar target/rest-api-0.0.1-SNAPSHOT.jar服务器config.yml'''
working_dir:/app/user
环境:
港口:8080
DATABASE_URL:'postgres://postgres:@herokuPostgresql:5432/postgres'
端口:
-'8080:8080'
链接:
-herokuPostgresql
shell :
build : 。
命令:bash
working_dir:/app/user
环境:
港口:8080
DATABASE_URL:'postgres://postgres:@herokuPostgresql:5432/postgres'
端口:
-'8080:8080'
链接:
-herokuPostgresql
数量:
-'。::/app/user'
herokuPostgresql:
图片:postgres

谁能帮我弄清楚这里出了什么问题?

最佳答案

我已经解决了这个问题。我认为这是由于jersey-media-multipart依赖关系所致,当我删除它时,它开始可以正常工作。可能是特定于依赖版本的。

关于java - Dropwizard REST API服务器已退出,代码为1,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/45447052/

29 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com