Web 进程在启动后 90 秒内未能绑定到 $PORT

Posted

技术标签:

【中文标题】Web 进程在启动后 90 秒内未能绑定到 $PORT【英文标题】:Web process failed to bind to $PORT within 90 seconds of launch 【发布时间】:2017-09-03 14:18:26 【问题描述】:

我正在尝试在 heroku 上使用单个 REST 部署简单的 spring boot 应用程序。该应用程序位于此处:application

我的Procfile 看起来像这样

web: java -jar target/java-cloud-sample-0.0.1-SNAPSHOT.jar -Dserver.port=$PORT

heroku 上的构建日志如下所示

-----> Java app detected
-----> Installing JDK... version 9 installed
-----> Installing Maven... version 3.5.0 installed
-----> Maven home: /app/tmp/cache/.maven
-----> Java home: /tmp/build_26e32238a62f5da3214e452f0481421a/.jdk
-----> Build dir: /tmp/build_26e32238a62f5da3214e452f0481421a
-----> Executing build...
       mvn -B -Duser.home=/tmp/build_26e32238a62f5da3214e452f0481421a -Dmaven.repo.local=/app/tmp/cache/.m2/repository -DskipTests=true -U clean install
       [INFO] MAVEN_OPTS=-Xmx384m -Xss128m
       [INFO] ------------------------------------------------------------------------
       [INFO] Scanning for projects...
       [INFO] 
       [INFO] ------------------------------------------------------------------------
       [INFO] Building java-cloud-sample 0.0.1-SNAPSHOT
       [INFO] ------------------------------------------------------------------------
       [INFO] 
       [INFO] --- maven-clean-plugin:2.6.1:clean (default-clean) @ java-cloud-sample ---
       [INFO] 
       [INFO] --- spring-boot-maven-plugin:1.5.6.RELEASE:build-info (default) @ java-cloud-sample ---
       [INFO] 
       [INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ java-cloud-sample ---
       [INFO] Using 'UTF-8' encoding to copy filtered resources.
       [INFO] Copying 1 resource
       [INFO] Copying 0 resource
       [INFO] 
       [INFO] --- maven-compiler-plugin:3.6.2:compile (default-compile) @ java-cloud-sample ---
       [INFO] Required automodules detected. Please don't publish this project to a public artifact repository!
       [INFO] Changes detected - recompiling the module!
       [INFO] Compiling 3 source files to /tmp/build_26e32238a62f5da3214e452f0481421a/target/classes
       [INFO] 
       ....          
       [INFO] --- maven-install-plugin:2.5.2:install (default-install) @ java-cloud-sample ---
       [INFO] Installing /tmp/build_26e32238a62f5da3214e452f0481421a/target/java-cloud-sample-0.0.1-SNAPSHOT.jar to /app/tmp/cache/.m2/repository/com/lapots/breed/platform/cloud/java-cloud-sample/0.0.1-SNAPSHOT/java-cloud-sample-0.0.1-SNAPSHOT.jar
       [INFO] Installing /tmp/build_26e32238a62f5da3214e452f0481421a/pom.xml to /app/tmp/cache/.m2/repository/com/lapots/breed/platform/cloud/java-cloud-sample/0.0.1-SNAPSHOT/java-cloud-sample-0.0.1-SNAPSHOT.pom
       [INFO] ------------------------------------------------------------------------
       [INFO] BUILD SUCCESS
       [INFO] ------------------------------------------------------------------------
       [INFO] Total time: 15.037 s
       [INFO] Finished at: 2017-09-03T14:01:08Z
       [INFO] Final Memory: 32M/107M
       [INFO] ------------------------------------------------------------------------
-----> Cleaning enviroment
       - Deleting local Maven repository... done
-----> Discovering process types
       Procfile declares types -> web
-----> Compressing...
       Done: 309.9M
-----> Launching...
 !     Warning: Your slug size exceeds our soft limit (309 MB) which may affect boot time.
   Released v7
   https://java-cloud-sample.herokuapp.com/ deployed to Heroku

这是我得到的应用程序日志

2017-09-03T14:05:04.778676+00:00 heroku[web.1]: Starting process with command `java -jar target/java-cloud-sample-0.0.1-SNAPSHOT.jar -Dserver.port=14556`
2017-09-03T14:05:10.685730+00:00 app[web.1]:
2017-09-03T14:05:10.685803+00:00 app[web.1]:   .   ____          _            __ _ _
2017-09-03T14:05:10.685868+00:00 app[web.1]:  /\\ / ___'_ __ _ _(_)_ __  __ _ \ \ \ \
2017-09-03T14:05:10.685937+00:00 app[web.1]: ( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \
2017-09-03T14:05:10.685992+00:00 app[web.1]:  \\/  ___)| |_)| | | | | || (_| |  ) ) ) )
2017-09-03T14:05:10.686055+00:00 app[web.1]:   '  |____| .__|_| |_|_| |_\__, | / / / /
2017-09-03T14:05:10.686108+00:00 app[web.1]:  =========|_|==============|___/=/_/_/_/
2017-09-03T14:05:10.708407+00:00 app[web.1]:  :: Spring Boot ::        (v1.5.6.RELEASE)
2017-09-03T14:05:10.708470+00:00 app[web.1]:
2017-09-03T14:05:11.192342+00:00 app[web.1]: 2017-09-03 14:05:11.185  INFO 4 --- [           main] c.l.b.p.c.j.JavaCloudSampleApplication   : Starting JavaCloudSampleApplication v0.0.1-SNAPSHOT on f4c891ec-7872-4f32-996e-1fe573ea2ca7 with PID 4 (/app/target/jav
a-cloud-sample-0.0.1-SNAPSHOT.jar started by u57312 in /app)
2017-09-03T14:05:11.193055+00:00 app[web.1]: 2017-09-03 14:05:11.192  INFO 4 --- [           main] c.l.b.p.c.j.JavaCloudSampleApplication   : No active profile set, falling back to default profiles: default
2017-09-03T14:05:11.474167+00:00 app[web.1]: 2017-09-03 14:05:11.473  INFO 4 --- [           main] ationConfigEmbeddedWebApplicationContext : Refreshing org.springframework.boot.context.embedded.AnnotationConfigEmbeddedWebApplicationContext@62150f9e: startup da
te [Sun Sep 03 14:05:11 UTC 2017]; root of context hierarchy
2017-09-03T14:05:14.172407+00:00 app[web.1]: WARNING: An illegal reflective access operation has occurred
2017-09-03T14:05:14.172418+00:00 app[web.1]: WARNING: Illegal reflective access by org.springframework.cglib.core.ReflectUtils$1 (jar:file:/app/target/java-cloud-sample-0.0.1-SNAPSHOT.jar!/BOOT-INF/lib/spring-core-4.3.10.RELEASE.jar!/) to method java.lang.Class
Loader.defineClass(java.lang.String,byte[],int,int,java.security.ProtectionDomain)
2017-09-03T14:05:14.172419+00:00 app[web.1]: WARNING: Please consider reporting this to the maintainers of org.springframework.cglib.core.ReflectUtils$1
2017-09-03T14:05:14.172420+00:00 app[web.1]: WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
2017-09-03T14:05:14.172425+00:00 app[web.1]: WARNING: All illegal access operations will be denied in a future release
2017-09-03T14:05:15.430298+00:00 app[web.1]: 2017-09-03 14:05:15.430  INFO 4 --- [           main] s.b.c.e.t.TomcatEmbeddedServletContainer : Tomcat initialized with port(s): 8080 (http)
2017-09-03T14:05:15.451153+00:00 app[web.1]: 2017-09-03 14:05:15.450  INFO 4 --- [           main] o.apache.catalina.core.StandardService   : Starting service [Tomcat]
2017-09-03T14:05:15.452398+00:00 app[web.1]: 2017-09-03 14:05:15.452  INFO 4 --- [           main] org.apache.catalina.core.StandardEngine  : Starting Servlet Engine: Apache Tomcat/8.5.16
2017-09-03T14:05:15.582784+00:00 app[web.1]: 2017-09-03 14:05:15.582  INFO 4 --- [ost-startStop-1] o.a.c.c.C.[Tomcat].[localhost].[/]       : Initializing Spring embedded WebApplicationContext
2017-09-03T14:05:15.583083+00:00 app[web.1]: 2017-09-03 14:05:15.582  INFO 4 --- [ost-startStop-1] o.s.web.context.ContextLoader            : Root WebApplicationContext: initialization completed in 4117 ms
2017-09-03T14:05:16.006331+00:00 app[web.1]: 2017-09-03 14:05:16.006  INFO 4 --- [ost-startStop-1] o.s.b.w.servlet.ServletRegistrationBean  : Mapping servlet: 'dispatcherServlet' to [/]
2017-09-03T14:05:16.013268+00:00 app[web.1]: 2017-09-03 14:05:16.013  INFO 4 --- [ost-startStop-1] o.s.b.w.servlet.FilterRegistrationBean   : Mapping filter: 'metricsFilter' to: [/*]
2017-09-03T14:05:16.013794+00:00 app[web.1]: 2017-09-03 14:05:16.013  INFO 4 --- [ost-startStop-1] o.s.b.w.servlet.FilterRegistrationBean   : Mapping filter: 'characterEncodingFilter' to: [/*]
2017-09-03T14:05:16.013969+00:00 app[web.1]: 2017-09-03 14:05:16.013  INFO 4 --- [ost-startStop-1] o.s.b.w.servlet.FilterRegistrationBean   : Mapping filter: 'hiddenHttpMethodFilter' to: [/*]
2017-09-03T14:05:16.014080+00:00 app[web.1]: 2017-09-03 14:05:16.013  INFO 4 --- [ost-startStop-1] o.s.b.w.servlet.FilterRegistrationBean   : Mapping filter: 'httpPutFormContentFilter' to: [/*]
2017-09-03T14:05:16.014311+00:00 app[web.1]: 2017-09-03 14:05:16.014  INFO 4 --- [ost-startStop-1] o.s.b.w.servlet.FilterRegistrationBean   : Mapping filter: 'requestContextFilter' to: [/*]
2017-09-03T14:05:16.014462+00:00 app[web.1]: 2017-09-03 14:05:16.014  INFO 4 --- [ost-startStop-1] o.s.b.w.servlet.FilterRegistrationBean   : Mapping filter: 'webRequestLoggingFilter' to: [/*]
2017-09-03T14:05:16.014603+00:00 app[web.1]: 2017-09-03 14:05:16.014  INFO 4 --- [ost-startStop-1] o.s.b.w.servlet.FilterRegistrationBean   : Mapping filter: 'applicationContextIdFilter' to: [/*]
2017-09-03T14:05:16.730294+00:00 app[web.1]: 2017-09-03 14:05:16.729  INFO 4 --- [           main] s.w.s.m.m.a.RequestMappingHandlerAdapter : Looking for @ControllerAdvice: org.springframework.boot.context.embedded.AnnotationConfigEmbeddedWebApplicationContext@
62150f9e: startup date [Sun Sep 03 14:05:11 UTC 2017]; root of context hierarchy
2017-09-03T14:05:16.957338+00:00 app[web.1]: 2017-09-03 14:05:16.957  INFO 4 --- [           main] s.w.s.m.m.a.RequestMappingHandlerMapping : Mapped "[/rest/hello]" onto public java.lang.String com.lapots.breed.platform.cloud.javacloudsample.rest.HelloRestCon
troller.hello()
2017-09-03T14:05:16.967662+00:00 app[web.1]: 2017-09-03 14:05:16.967  INFO 4 --- [           main] s.w.s.m.m.a.RequestMappingHandlerMapping : Mapped "[/error]" onto public org.springframework.http.ResponseEntity<java.util.Map<java.lang.String, java.lang.Objec
t>> org.springframework.boot.autoconfigure.web.BasicErrorController.error(javax.servlet.http.HttpServletRequest)
2017-09-03T14:05:16.968232+00:00 app[web.1]: 2017-09-03 14:05:16.968  INFO 4 --- [           main] s.w.s.m.m.a.RequestMappingHandlerMapping : Mapped "[/error],produces=[text/html]" onto public org.springframework.web.servlet.ModelAndView org.springframework.b
oot.autoconfigure.web.BasicErrorController.errorHtml(javax.servlet.http.HttpServletRequest,javax.servlet.http.HttpServletResponse)
2017-09-03T14:05:17.015875+00:00 app[web.1]: 2017-09-03 14:05:17.015  INFO 4 --- [           main] o.s.w.s.handler.SimpleUrlHandlerMapping  : Mapped URL path [/webjars/**] onto handler of type [class org.springframework.web.servlet.resource.ResourceHttpRequestH
andler]
2017-09-03T14:05:17.015988+00:00 app[web.1]: 2017-09-03 14:05:17.015  INFO 4 --- [           main] o.s.w.s.handler.SimpleUrlHandlerMapping  : Mapped URL path [/**] onto handler of type [class org.springframework.web.servlet.resource.ResourceHttpRequestHandler]
2017-09-03T14:05:17.073204+00:00 app[web.1]: 2017-09-03 14:05:17.072  INFO 4 --- [           main] o.s.w.s.handler.SimpleUrlHandlerMapping  : Mapped URL path [/**/favicon.ico] onto handler of type [class org.springframework.web.servlet.resource.ResourceHttpRequ
estHandler]
2017-09-03T14:05:17.600843+00:00 app[web.1]: 2017-09-03 14:05:17.600  INFO 4 --- [           main] o.s.b.a.e.mvc.EndpointHandlerMapping     : Mapped "[/info || /info.json],methods=[GET],produces=[application/vnd.spring-boot.actuator.v1+json || application/json
]" onto public java.lang.Object org.springframework.boot.actuate.endpoint.mvc.EndpointMvcAdapter.invoke()
2017-09-03T14:05:17.603060+00:00 app[web.1]: 2017-09-03 14:05:17.602  INFO 4 --- [           main] o.s.b.a.e.mvc.EndpointHandlerMapping     : Mapped "[/auditevents || /auditevents.json],methods=[GET],produces=[application/vnd.spring-boot.actuator.v1+json || ap
plication/json]" onto public org.springframework.http.ResponseEntity<?> org.springframework.boot.actuate.endpoint.mvc.AuditEventsMvcEndpoint.findByPrincipalAndAfterAndType(java.lang.String,java.util.Date,java.lang.String)
2017-09-03T14:05:17.606261+00:00 app[web.1]: 2017-09-03 14:05:17.606  INFO 4 --- [           main] o.s.b.a.e.mvc.EndpointHandlerMapping     : Mapped "[/configprops || /configprops.json],methods=[GET],produces=[application/vnd.spring-boot.actuator.v1+json || ap
plication/json]" onto public java.lang.Object org.springframework.boot.actuate.endpoint.mvc.EndpointMvcAdapter.invoke()
2017-09-03T14:05:17.610341+00:00 app[web.1]: 2017-09-03 14:05:17.610  INFO 4 --- [           main] o.s.b.a.e.mvc.EndpointHandlerMapping     : Mapped "[/beans || /beans.json],methods=[GET],produces=[application/vnd.spring-boot.actuator.v1+json || application/js
on]" onto public java.lang.Object org.springframework.boot.actuate.endpoint.mvc.EndpointMvcAdapter.invoke()
2017-09-03T14:05:17.611621+00:00 app[web.1]: 2017-09-03 14:05:17.611  INFO 4 --- [           main] o.s.b.a.e.mvc.EndpointHandlerMapping     : Mapped "[/trace || /trace.json],methods=[GET],produces=[application/vnd.spring-boot.actuator.v1+json || application/js
on]" onto public java.lang.Object org.springframework.boot.actuate.endpoint.mvc.EndpointMvcAdapter.invoke()
2017-09-03T14:05:17.616752+00:00 app[web.1]: 2017-09-03 14:05:17.616  INFO 4 --- [           main] o.s.b.a.e.mvc.EndpointHandlerMapping     : Mapped "[/metrics/name:.*],methods=[GET],produces=[application/vnd.spring-boot.actuator.v1+json || application/json]
" onto public java.lang.Object org.springframework.boot.actuate.endpoint.mvc.MetricsMvcEndpoint.value(java.lang.String)
2017-09-03T14:05:17.617046+00:00 app[web.1]: 2017-09-03 14:05:17.616  INFO 4 --- [           main] o.s.b.a.e.mvc.EndpointHandlerMapping     : Mapped "[/metrics || /metrics.json],methods=[GET],produces=[application/vnd.spring-boot.actuator.v1+json || applicatio
n/json]" onto public java.lang.Object org.springframework.boot.actuate.endpoint.mvc.EndpointMvcAdapter.invoke()
2017-09-03T14:05:17.630560+00:00 app[web.1]: 2017-09-03 14:05:17.629  INFO 4 --- [           main] o.s.b.a.e.mvc.EndpointHandlerMapping     : Mapped "[/heapdump || /heapdump.json],methods=[GET],produces=[application/octet-stream]" onto public void org.springf
ramework.boot.actuate.endpoint.mvc.HeapdumpMvcEndpoint.invoke(boolean,javax.servlet.http.HttpServletRequest,javax.servlet.http.HttpServletResponse) throws java.io.IOException,javax.servlet.ServletException
2017-09-03T14:05:17.642704+00:00 app[web.1]: 2017-09-03 14:05:17.642  INFO 4 --- [           main] o.s.b.a.e.mvc.EndpointHandlerMapping     : Mapped "[/autoconfig || /autoconfig.json],methods=[GET],produces=[application/vnd.spring-boot.actuator.v1+json || appl
ication/json]" onto public java.lang.Object org.springframework.boot.actuate.endpoint.mvc.EndpointMvcAdapter.invoke()
2017-09-03T14:05:17.650903+00:00 app[web.1]: 2017-09-03 14:05:17.650  INFO 4 --- [           main] o.s.b.a.e.mvc.EndpointHandlerMapping     : Mapped "[/loggers/name:.*],methods=[GET],produces=[application/vnd.spring-boot.actuator.v1+json || application/json]
" onto public java.lang.Object org.springframework.boot.actuate.endpoint.mvc.LoggersMvcEndpoint.get(java.lang.String)
2017-09-03T14:05:17.653138+00:00 app[web.1]: 2017-09-03 14:05:17.651  INFO 4 --- [           main] o.s.b.a.e.mvc.EndpointHandlerMapping     : Mapped "[/loggers/name:.*],methods=[POST],consumes=[application/vnd.spring-boot.actuator.v1+json || application/json
],produces=[application/vnd.spring-boot.actuator.v1+json || application/json]" onto public java.lang.Object org.springframework.boot.actuate.endpoint.mvc.LoggersMvcEndpoint.set(java.lang.String,java.util.Map<java.lang.String, java.lang.String>)
2017-09-03T14:05:17.654524+00:00 app[web.1]: 2017-09-03 14:05:17.653  INFO 4 --- [           main] o.s.b.a.e.mvc.EndpointHandlerMapping     : Mapped "[/loggers || /loggers.json],methods=[GET],produces=[application/vnd.spring-boot.actuator.v1+json || applicatio
n/json]" onto public java.lang.Object org.springframework.boot.actuate.endpoint.mvc.EndpointMvcAdapter.invoke()
2017-09-03T14:05:17.657622+00:00 app[web.1]: 2017-09-03 14:05:17.655  INFO 4 --- [           main] o.s.b.a.e.mvc.EndpointHandlerMapping     : Mapped "[/mappings || /mappings.json],methods=[GET],produces=[application/vnd.spring-boot.actuator.v1+json || applicat
ion/json]" onto public java.lang.Object org.springframework.boot.actuate.endpoint.mvc.EndpointMvcAdapter.invoke()
2017-09-03T14:05:17.663382+00:00 app[web.1]: 2017-09-03 14:05:17.658  INFO 4 --- [           main] o.s.b.a.e.mvc.EndpointHandlerMapping     : Mapped "[/dump || /dump.json],methods=[GET],produces=[application/vnd.spring-boot.actuator.v1+json || application/json
]" onto public java.lang.Object org.springframework.boot.actuate.endpoint.mvc.EndpointMvcAdapter.invoke()
2017-09-03T14:05:17.672330+00:00 app[web.1]: 2017-09-03 14:05:17.672  INFO 4 --- [           main] o.s.b.a.e.mvc.EndpointHandlerMapping     : Mapped "[/env/name:.*],methods=[GET],produces=[application/vnd.spring-boot.actuator.v1+json || application/json]" o
nto public java.lang.Object org.springframework.boot.actuate.endpoint.mvc.EnvironmentMvcEndpoint.value(java.lang.String)
2017-09-03T14:05:17.683275+00:00 app[web.1]: 2017-09-03 14:05:17.683  INFO 4 --- [           main] o.s.b.a.e.mvc.EndpointHandlerMapping     : Mapped "[/env || /env.json],methods=[GET],produces=[application/vnd.spring-boot.actuator.v1+json || application/json]
" onto public java.lang.Object org.springframework.boot.actuate.endpoint.mvc.EndpointMvcAdapter.invoke()
2017-09-03T14:05:17.685550+00:00 app[web.1]: 2017-09-03 14:05:17.685  INFO 4 --- [           main] o.s.b.a.e.mvc.EndpointHandlerMapping     : Mapped "[/health || /health.json],methods=[GET],produces=[application/vnd.spring-boot.actuator.v1+json || application/
json]" onto public java.lang.Object org.springframework.boot.actuate.endpoint.mvc.HealthMvcEndpoint.invoke(javax.servlet.http.HttpServletRequest,java.security.Principal)
2017-09-03T14:05:17.962047+00:00 app[web.1]: 2017-09-03 14:05:17.961  INFO 4 --- [           main] o.s.j.e.a.AnnotationMBeanExporter        : Registering beans for JMX exposure on startup
2017-09-03T14:05:17.981648+00:00 app[web.1]: 2017-09-03 14:05:17.981  INFO 4 --- [           main] o.s.c.support.DefaultLifecycleProcessor  : Starting beans in phase 0
2017-09-03T14:05:18.309932+00:00 app[web.1]: 2017-09-03 14:05:18.309  INFO 4 --- [           main] s.b.c.e.t.TomcatEmbeddedServletContainer : Tomcat started on port(s): 8080 (http)
2017-09-03T14:05:18.328371+00:00 app[web.1]: 2017-09-03 14:05:18.325  INFO 4 --- [           main] c.l.b.p.c.j.JavaCloudSampleApplication   : Started JavaCloudSampleApplication in 9.561 seconds (JVM running for 10.785)
2017-09-03T14:05:45.484008+00:00 heroku[router]: at=error code=H20 desc="App boot timeout" method=GET path="/" host=java-cloud-sample.herokuapp.com request_id=fe61c421-b7c6-47a5-ad20-cb78b2593c53 fwd="93.171.108.185" dyno= connect= service= status=503 bytes= pr
otocol=https
2017-09-03T14:05:50.186722+00:00 heroku[web.1]: Process running mem=514M(100.5%)
2017-09-03T14:05:50.186875+00:00 heroku[web.1]: Error R14 (Memory quota exceeded)
2017-09-03T14:06:17.392379+00:00 heroku[web.1]: Process running mem=514M(100.5%)
2017-09-03T14:06:17.392521+00:00 heroku[web.1]: Error R14 (Memory quota exceeded)
2017-09-03T14:06:35.116087+00:00 heroku[web.1]: Error R10 (Boot timeout) -> Web process failed to bind to $PORT within 90 seconds of launch
2017-09-03T14:06:35.116157+00:00 heroku[web.1]: Stopping process with SIGKILL
2017-09-03T14:06:35.322422+00:00 heroku[web.1]: Process exited with status 137
2017-09-03T14:06:35.338320+00:00 heroku[web.1]: State changed from starting to crashed
2017-09-03T14:06:36.190416+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=java-cloud-sample.herokuapp.com request_id=1b975133-4ab4-4ea0-8366-985fd34ee359 fwd="93.171.108.185" dyno= connect= service= status=503 bytes= protoco
l=https
2017-09-03T14:06:36.814442+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=java-cloud-sample.herokuapp.com request_id=04f98634-63bf-48ea-ac2e-7a43b8c52b85 fwd="93.171.108.185" dyno= connect= service= status=503 bytes= protoco
l=https
2017-09-03T14:07:00.220008+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/rest/hello" host=java-cloud-sample.herokuapp.com request_id=5b88705e-ac20-4913-818f-4aa0e9f79914 fwd="93.171.108.185" dyno= connect= service= status=503 byte
s= protocol=https

有什么问题?为什么它不能绑定到 $PORT?

【问题讨论】:

"2017-09-03T14:05:50.186722+00:00 heroku[web.1]: 进程运行 mem=514M(100.5%) 2017-09-03T14:05:50.186875+00: 00 heroku[web.1]:错误 R14(超出内存配额)2017-09-03T14:06:17.392379+00:00 heroku[web.1]:进程运行 mem=514M(100.5%) 2017-09-03T14: 06:17.392521+00:00 heroku[web.1]: Error R14 (Memory quota exceeded)" 似乎试图部署您的应用程序的服务器内存不足。 【参考方案1】:

为了解决这个问题,我做了两件事。 首先,当它超过 512 mb 时,我设置了 config var

JAVA_TOOL_OPTIONS = -Xmx300m

其次我稍微改变了启动应用程序的命令行

java $JAVA_OPTS -Dserver.port=$PORT -jar target/java-cloud-sample-0.0.1-SNAPSHOT.jar

现在它可以工作了!

【讨论】:

你没有使用标准的heroku/java buildpack吗?它应该为您设置此内存选项,并且它支持 Java 9。 @codefinger,不。我从现有的具有 oracle jdk 的 buildpack 中创建了一个分支,并对其进行了一些更改以支持 java 9 我用官方的heroku/java buildpack(使用 OpenJDK)尝试了你的示例应用程序,它成功了。 @codefinger 也许。我没有尝试,因为我在本地使用oracle jdk(令人惊讶的是,由于maven错误,我无法在本地构建项目哈哈)

以上是关于Web 进程在启动后 90 秒内未能绑定到 $PORT的主要内容,如果未能解决你的问题,请参考以下文章

错误 R10(启动超时)-> Web 进程未能在启动后 90 秒内绑定到 $PORT(Heroku 上的 Java Discord 机器人)

错误 R10 - Web 进程在启动后 60 秒内未能绑定到 $PORT

错误 R10(启动超时)-> Web 进程未能在启动后 60 秒内绑定到 $PORT - HEROKU ERROR

在 python 上获取“错误 R10(启动超时)-> Web 进程未能在启动后 60 秒内绑定到 $PORT”

Heroku 错误:Web 进程在启动后 60 秒内无法绑定到 $PORT(使用 axios)

Heroku:Web 进程在启动后 60 秒内无法绑定到 $PORT