我尝试使用单实例配置将jhipster(spring boot)应用程序部署到弹性beanstalk并获取所有静态调用的http 404('/'或'/index.html'),我使用jhispter生成应用程序并进行以下配置:

pom.xml中:

<profile>
        <id>prod</id>
        <dependencies>
            <dependency>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-starter-tomcat</artifactId>
            </dependency>
        </dependencies>
.....
<plugin>
                    <groupId>org.springframework.boot</groupId>
                    <artifactId>spring-boot-maven-plugin</artifactId>
                    <configuration>
                        <executable>false</executable>
                    </configuration>

为了记录,api工作正常!只有静态文件才能获得404 .

2017-07-23 04:34:48.539 DEBUG 30610 --- [nio-5000-exec-3] osswumatcher.AntPathRequestMatcher:请求'GET /'与'OPTIONS / **不匹配2017-07-23 04 :34:48.539 DEBUG 30610 --- [nio-5000-exec-3] osswumatcher.AntPathRequestMatcher:检查请求的匹配:'/';反对'/app//*.{js,html}'2017-07-23 04:34:48.539 DEBUG 30610 --- [nio-5000-exec-3] osswumatcher.AntPathRequestMatcher:检查请求的匹配:'/ “;反对'/ bower_components /'2017-07-23 04:34:48.539 DEBUG 30610 --- [nio-5000-exec-3] o.s.s.w.u.matcher.AntPathRequestMatcher:检查请求的匹配:'/';反对'/ i18n /'2017-07-23 04:34:48.539 DEBUG 30610 --- [nio-5000-exec-3] o.s.s.w.u.matcher.AntPathRequestMatcher:检查请求的匹配:'/';反对'/ content /'2017-07-23 04:34:48.539 DEBUG 30610 --- [nio-5000-exec-3] o.s.s.w.u.matcher.AntPathRequestMatcher:检查请求的匹配:'/';反对'/swagger-ui/index.html'2017-07-23 04:34:48.539 DEBUG 30610 --- [nio-5000-exec-3] o.s.s.w.u.matcher.AntPathRequestMatcher:检查请求的匹配:'/';反对'/ test /'2017-07-23 04:34:48.539 DEBUG 30610 --- [nio-5000-exec-3] o.s.security.web.FilterChainProxy:/在第1位的11位于额外的过滤链中;触发过滤器:'WebAsyncManagerIntegrationFilter'2017-07-23 04:34:48.539 DEBUG 30610 --- [nio-5000-exec-3] o.s.security.web.FilterChainProxy:/在第2位的第11位附加过滤链;过滤:'SecurityContextPersistenceFilter'2017-07-23 04:34:48.539 DEBUG 30610 --- [nio-5000-exec-3] wcHttpSessionSecurityContextRepository:No HttpSession目前存在2017-07-23 04:34:48.539 DEBUG 30610 - - [nio-5000-exec-3] wcHttpSessionSecurityContextRepository:没有来自HttpSession的SecurityContext:null . 将创建一个新的 . 2017-07-23 04:34:48.539 DEBUG 30610 --- [nio-5000-exec-3] o.s.security.web.FilterChainProxy:/位于第3位的11位于额外的过滤链中;触发过滤器:'HeaderWriterFilter'2017-07-23 04:34:48.542 DEBUG 30610 --- [nio-5000-exec-3] osswheader.writers.HstsHeaderWriter:因为它与requestMatcher org不匹配而没有注入HSTS头 . springframework.security.web.header.writers.HstsHeaderWriter$SecureRequestMatcher@2e2f941e 2017-07-23 04:34:48.542 DEBUG 30610 --- [nio-5000-exec-3] ossecurity.web.FilterChainProxy:/ at position 4 11个额外的过滤链;触发过滤器:'CsrfFilter'2017-07-23 04:34:48.543 DEBUG 30610 --- [nio-5000-exec-3] o.s.security.web.FilterChainProxy:/在第5位的11位于额外的过滤链中;过滤:'LogoutFilter'2017-07-23 04:34:48.543 DEBUG 30610 --- [nio-5000-exec-3] osswumatcher.AntPathRequestMatcher:请求'GET /'与'POST / logout 2017-不匹配07-23 04:34:48.543 DEBUG 30610 --- [nio-5000-exec-3] ossecurity.web.FilterChainProxy:/在第6位的11位附加过滤链;触发过滤器:'RequestCacheAwareFilter'2017-07-23 04:34:48.543 DEBUG 30610 --- [nio-5000-exec-3] o.s.security.web.FilterChainProxy:/在第7位,共11个额外的过滤链;触发过滤器:'SecurityContextHolderAwareRequestFilter'2017-07-23 04:34:48.543 DEBUG 30610 --- [nio-5000-exec-3] o.s.security.web.FilterChainProxy:/在第8位的11位于额外的过滤链中;触发过滤器:'AnonymousAuthenticationFilter'2017-07-23 04:34:48.543 DEBUG 30610 --- [nio-5000-exec-3] osswaAnonymousAuthenticationFilter:填充带有匿名标记的SecurityContextHolder:'org.springframework.security.authentication.AnonymousAuthenticationToken @ 9055e4a6:校长:anonymousUser;证书:[保护];认证:真实;详细信息:org.springframework.security.web.authentication.WebAuthenticationDetails@957e:RemoteIpAddress:127.0.0.1; SessionId:null;授权机构:ROLE_ANONYMOUS'2017-07-23 04:34:48.544 DEBUG 30610 --- [nio-5000-exec-3] o.s.security.web.FilterChainProxy:/在第9位,共11个额外的过滤链;触发过滤器:'SessionManagementFilter'2017-07-23 04:34:48.544 DEBUG 30610 --- [nio-5000-exec-3] o.s.security.web.FilterChainProxy:/在第10位的11位于额外的过滤链中;射击过滤:'ExceptionTranslationFilter'2017-07-23 04:34:48.544 DEBUG 30610 --- [nio-5000-exec-3] o.s.security.web.FilterChainProxy:/在11位11的附加过滤链中;触发过滤器:'FilterSecurityInterceptor'2017-07-23 04:34:48.544 DEBUG 30610 --- [nio-5000-exec-3] o.s.s.w.a.i.FilterSecurityInterceptor:安全对象:FilterInvocation:URL:/;属性:[permitAll] 2017-07-23 04:34:48.544 DEBUG 30610 --- [nio-5000-exec-3] osswaiFilterSecurityInterceptor:以前经过身份验证:org.springframework.security.authentication.AnonymousAuthenticationToken@9055e4a6:校长:anonymousUser ;证书:[保护];认证:真实;详细信息:org.springframework.security.web.authentication.WebAuthenticationDetails@957e:RemoteIpAddress:127.0.0.1; SessionId:null;授权机构:ROLE_ANONYMOUS 2017-07-23 04:34:48.544 DEBUG 30610 --- [nio-5000-exec-3] ossaccess.vote.AffirmativeBased:Voter:org.springframework.security.web.access.expression.WebExpressionVoter @ 6e7461cd,返回:1 2017-07-23 04:34:48.546 DEBUG 30610 --- [nio-5000-exec-3] osswaiFilterSecurityInterceptor:授权成功2017-07-23 04:34:48.546 DEBUG 30610 --- [nio-5000-exec-3] osswaiFilterSecurityInterceptor:RunAsManager没有更改Authentication对象2017-07-23 04:34:48.546 DEBUG 30610 --- [nio-5000-exec-3] ossecurity.web.FilterChainProxy:/到达额外过滤链的末端;进行原始链2017-07-23 04:34:48.547 DEBUG 30610 --- [nio-5000-exec-3] osweb.servlet.DispatcherServlet:DispatcherServlet,名称为'dispatcherServlet'处理GET请求[/] 2017- 07-23 04:34:48.549 DEBUG 30610 --- [nio-5000-exec-3] swsmmaRequestMappingHandlerMapping:查找路径的处理程序方法/ 2017-07-23 04:34:48.556 DEBUG 30610 --- [nio- 5000-exec-3] swsmmaRequestMappingHandlerMapping:找不到[/]的处理方法2017-07-23 04:34:48.557 DEBUG 30610 --- [nio-5000-exec-3] oswshandler.SimpleUrlHandlerMapping:匹配模式为请求[/]是[/] 2017-07-23 04:34:48.557 DEBUG 30610 --- [nio-5000-exec-3] oswshandler.SimpleUrlHandlerMapping:URI请求的模板变量[/]是{} 2017- 07-23 04:34:48.557 DEBUG 30610 --- [nio-5000-exec-3] oswshandler.SimpleUrlHandlerMapping:使用处理程序[ResourceHttpRequestHandler [locations = [ServletContext resource [/],类路径res]将[/]映射到HandlerExecutionChain源[META-INF / resources /],类路径资源[resources /],类路径资源[静态/],类路径资源[public /]],解析器= [org.springframework.web.servlet.resource.PathResourceResolver @ 78226c36]]]和1拦截器2017-07-23 04:34:48.558 DEBUG 30610 --- [nio-5000-exec-3] osweb.servlet.DispatcherServlet:[/]的Last-Modified值为:-1 2017-07-23 04:34:48.558 DEBUG 30610 --- [nio-5000-exec-3] wcHttpSessionSecurityContextRepository:SecurityContext为空或内容为匿名 - 上下文不会存储在HttpSession中 . 2017-07-23 04:34:48.558 DEBUG 30610 --- [nio-5000-exec-3] osweb.servlet.DispatcherServlet:Null ModelAndView返回DispatcherServlet,名称为“dispatcherServlet”:假设HandlerAdapter完成请求处理2017-07 -23 04:34:48.558 DEBUG 30610 --- [nio-5000-exec-3] osweb.servlet.DispatcherServlet:已成功完成请求2017-07-23 04:34:48.559 DEBUG 30610 --- [nio-5000 -exec-3] osswaExceptionTranslationFilter:链处理正常2017-07-23 04:34:48.559 DEBUG 30610 --- [nio-5000-exec-3] sswcSecurityContextPersistenceFilter:SecurityContextHolder现已清除,请求处理完成2017-07- 23 04:34:48.560 DEBUG 30610 --- [nio-5000-exec-3] osweb.servlet.DispatcherServlet:名为'dispatcherServlet'的DispatcherServlet处理GET请求[/ error] 2017-07-23 04:34: 48.565 DEBUG 30610 --- [nio-5000-exec-3] swsmmaRequestMappingHandlerMapping:查找路径/错误的处理程序方法2017-07-23 04:34:48.565 DEBUG 30610 --- [nio-5000-exec-3] swsmmaRequestMappingHandlerMapping:返回处理程序方法[public org.springframework.web.servlet.ModelAndView org.springframework.boot.autoconfigure.web.BasicErrorController.errorHtml(javax.servlet.http.HttpServletRequest,javax . servlet.http.HttpServletResponse)] 2017-07-23 04:34:48.565 DEBUG 30610 --- [nio-5000-exec-3] osweb.servlet.DispatcherServlet:[/ error]的Last-Modified值为: - 1 2017-07-23 04:34:48.579 DEBUG 30610 --- [nio-5000-exec-3]oswsvContentNegotiatingViewResolver:请求的媒体类型是[text / html,text / html; q = 0.8],基于Accept Headers 类型和可生成的媒体类型[text / html])2017-07-23 04:34:48.579 DEBUG 30610 --- [nio-5000-exec-3] oswsvContentNegotiatingViewResolver:根据请求的媒体类型'text / html'返回[org.thymeleaf.spring4.view.ThymeleafView@ec234ad] 2017-07-23 04:34:48.579 DEBUG 30610 - - [nio-5000-exec-3] osweb.servlet.DispatcherServlet:在DispatcherServlet中呈现视图[org.thymeleaf.spring4.view.ThymeleafView@ec234ad],名称为“dispatcherServlet”2017-07-23 04:34:48.597 DEBUG 30610 --- [nio-5000-exec-3] osweb.servlet.DispatcherServlet:已成功完成请求

来自默认配置jhipster(底部可执行文件:true):

2017-07-23 10:57:26 UTC-0300    ERROR   [Instance: i-06c0e61a84efdeaf5] Command failed on instance. Return code: 1 Output: (TRUNCATED).../util/SystemPropertyUtils.class Failed to execute '/usr/bin/unzip -o -d /var/app/staging /opt/elasticbeanstalk/deploy/appsource/source_bundle' Failed to execute '/usr/bin/unzip -o -d /var/app/staging /opt/elasticbeanstalk/deploy/appsource/source_bundle'. Hook /opt/elasticbeanstalk/hooks/appdeploy/pre/01_configure_application.sh failed. For more detail, check /var/log/eb-activity.log using console or EB CLI.
2017-07-23 10:57:22 UTC-0300    ERROR   Failed to execute '/usr/bin/unzip -o -d /var/app/staging /opt/elasticbeanstalk/deploy/appsource/source_bundle'