在 AWS Elastic Beanstalk 上启动期间 Grails 4 应用程序停止
Posted
技术标签:
【中文标题】在 AWS Elastic Beanstalk 上启动期间 Grails 4 应用程序停止【英文标题】:Grails 4 App stalls during start up on AWS Elastic Beanstalk 【发布时间】:2020-05-15 08:26:26 【问题描述】:我有一个在本地运行良好的 Grails 4.0.1 应用程序。我可以使用java -jar...
运行 WAR 文件,但我尝试将其部署到运行 Java 8 和 Tomcat 8 的 AWS Elastic Beanstalk,它只是在启动期间停止,根本没有任何错误消息。
OpenJDK 64-Bit Server VM warning: ignoring option MaxPermSize=64m; support was removed in 8.0
29-Jan-2020 11:49:38.574 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Server version name: Apache Tomcat/8.5.50
29-Jan-2020 11:49:38.634 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Server built: Jan 6 2020 22:09:40 UTC
29-Jan-2020 11:49:38.634 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Server version number: 8.5.50.0
29-Jan-2020 11:49:38.634 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log OS Name: Linux
29-Jan-2020 11:49:38.634 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log OS Version: 4.14.158-101.185.amzn1.x86_64
29-Jan-2020 11:49:38.634 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Architecture: amd64
29-Jan-2020 11:49:38.634 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Java Home: /usr/lib/jvm/java-1.8.0-openjdk-1.8.0.232.b09-0.48.amzn1.x86_64/jre
29-Jan-2020 11:49:38.634 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log JVM Version: 1.8.0_232-b09
29-Jan-2020 11:49:38.634 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log JVM Vendor: Oracle Corporation
29-Jan-2020 11:49:38.634 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log CATALINA_BASE: /usr/share/tomcat8
29-Jan-2020 11:49:38.634 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log CATALINA_HOME: /usr/share/tomcat8
29-Jan-2020 11:49:38.635 INFO [main] org.apache.catalina.core.AprLifecycleListener.lifecycleEvent The APR based Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: [/usr/java/packages/lib/amd64:/usr/lib64:/lib64:/lib:/usr/lib]
29-Jan-2020 11:49:39.218 INFO [main] org.apache.coyote.AbstractProtocol.init Initializing ProtocolHandler ["http-nio-8080"]
29-Jan-2020 11:49:39.309 INFO [main] org.apache.tomcat.util.net.NioselectorPool.getSharedSelector Using a shared selector for servlet write/read
29-Jan-2020 11:49:39.328 INFO [main] org.apache.coyote.AbstractProtocol.init Initializing ProtocolHandler ["ajp-nio-8009"]
29-Jan-2020 11:49:39.330 INFO [main] org.apache.tomcat.util.net.NioSelectorPool.getSharedSelector Using a shared selector for servlet write/read
29-Jan-2020 11:49:39.331 INFO [main] org.apache.catalina.startup.Catalina.load Initialization processed in 2803 ms
29-Jan-2020 11:49:39.447 INFO [main] org.apache.catalina.core.StandardService.startInternal Starting service [Catalina]
29-Jan-2020 11:49:39.448 INFO [main] org.apache.catalina.core.StandardEngine.startInternal Starting Servlet Engine: Apache Tomcat/8.5.50
29-Jan-2020 11:49:39.479 INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deploying web application directory [/var/lib/tomcat8/webapps/ROOT]
29-Jan-2020 11:49:44.838 WARNING [localhost-startStop-1] org.apache.tomcat.util.descriptor.web.WebXml.setVersion Unknown version string [4.0]. Default version will be used.
2020-01-29 11:50:03.589 INFO --- [ost-startStop-1] us.cloudcard.api.ApplicationLoader : The following profiles are active: production
Configuring Spring Security Core ...
... finished configuring Spring Security Core
Configuring Spring Security REST 3.0.0.RC1...
... finished configuring Spring Security REST
... with GORM support
29-Jan-2020 11:50:09.141 WARNING [localhost-startStop-1] org.apache.tomcat.jdbc.pool.ConnectionPool.checkPoolConfiguration maxActive is smaller than 1, setting maxActive to: 100
2020-01-29 11:50:13.580 WARN --- [ost-startStop-1] o.s.b.GenericTypeAwarePropertyDescriptor : Invalid JavaBean property 'exceptionMappings' being accessed! Ambiguous write methods found next to actually used [public void grails.plugin.springsecurity.web.authentication.AjaxAwareAuthenticationFailureHandler.setExceptionMappings(java.util.List)]: [public void org.springframework.security.web.authentication.ExceptionMappingAuthenticationFailureHandler.setExceptionMappings(java.util.Map)]
【问题讨论】:
【参考方案1】:原来我错过了两件事:
-
我需要将 Spring Boot Starter Tomcat 工件标记为已提供,这样它就不会与外部 Tomcat 容器冲突。
dependencies
...
provided "org.springframework.boot:spring-boot-starter-tomcat"
...
-
我还需要增加容器的大小。我试图在 t3.nano 上运行,结果遇到了 t3.micro。
【讨论】:
以上是关于在 AWS Elastic Beanstalk 上启动期间 Grails 4 应用程序停止的主要内容,如果未能解决你的问题,请参考以下文章
在 AWS Elastic Beanstalk 上扩展 Magento
如何在 AWS Elastic Beanstalk 上设置 HTTPS
如何在 AWS Elastic Beanstalk 上设置 HTTPS
在 AWS Elastic Beanstalk 上运行节点和反应