我尝试使用单实例配置将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] o.s.s.w.u.matcher.AntPathRequestMatcher:Request&#39; GET /&#39;不匹配&#39; OPTIONS / ** 2017-07-23 04:34:48.539 DEBUG 30610 --- [nio-5000-exec-3] o.s.s.w.u.matcher.AntPathRequestMatcher:检查请求的匹配:&#39; /&#39 ;;反对&#39; / app / / *。{js,html}&#39; 2017-07-23 04:34:48.539 DEBUG 30610 --- [nio-5000-exec-3] o.s.s.w.u.matcher.AntPathRequestMatcher:检查请求的匹配:&#39; /&#39 ;;反对&#39; / bower_components / &#39; 2017-07-23 04:34:48.539 DEBUG 30610 --- [nio-5000-exec-3] o.s.s.w.u.matcher.AntPathRequestMatcher:检查请求的匹配:&#39; /&#39 ;;反对&#39; / i18n / &#39; 2017-07-23 04:34:48.539 DEBUG 30610 --- [nio-5000-exec-3] o.s.s.w.u.matcher.AntPathRequestMatcher:检查请求的匹配:&#39; /&#39 ;;反对&#39; / content / &#39; 2017-07-23 04:34:48.539 DEBUG 30610 --- [nio-5000-exec-3] o.s.s.w.u.matcher.AntPathRequestMatcher:检查请求的匹配:&#39; /&#39 ;;反对&#39; /swagger-ui/index.html' 2017-07-23 04:34:48.539 DEBUG 30610 --- [nio-5000-exec-3] o.s.s.w.u.matcher.AntPathRequestMatcher:检查请求的匹配:&#39; /&#39 ;;反对&#39; / test / &#39; 2017-07-23 04:34:48.539 DEBUG 30610 --- [nio-5000-exec-3] o.s.security.web.FilterChainProxy:/在第1位的11位于额外的过滤链中;触发过滤器:&#39; WebAsyncManagerIntegrationFilter&#39; 2017-07-23 04:34:48.539 DEBUG 30610 --- [nio-5000-exec-3] o.s.security.web.FilterChainProxy:/在第2位的第11位附加过滤链;触发过滤器:&#39; SecurityContextPersistenceFilter&#39; 2017-07-23 04:34:48.539 DEBUG 30610 --- [nio-5000-exec-3] w.c.HttpSessionSecurityContextRepository:当前没有HttpSession存在 2017-07-23 04:34:48.539 DEBUG 30610 --- [nio-5000-exec-3] w.c.HttpSessionSecurityContextRepository:没有来自HttpSession的SecurityContext:null。将创建一个新的。 2017-07-23 04:34:48.539 DEBUG 30610 --- [nio-5000-exec-3] o.s.security.web.FilterChainProxy:/位于第3位的11位于额外的过滤链中;触发过滤器:&#39; HeaderWriterFilter&#39; 2017-07-23 04:34:48.542 DEBUG 30610 --- [nio-5000-exec-3] osswheader.writers.HstsHeaderWriter:没有注入HSTS头,因为它与requestMatcher org.springframework.security.web不匹配。 header.writers.HstsHeaderWriter$SecureRequestMatcher@2e2f941e 2017-07-23 04:34:48.542 DEBUG 30610 --- [nio-5000-exec-3] o.s.security.web.FilterChainProxy:/在第4位的11位额外的过滤链中;烧制过滤器:&#39; CsrfFilter&#39; 2017-07-23 04:34:48.543 DEBUG 30610 --- [nio-5000-exec-3] o.s.security.web.FilterChainProxy:/在第5位的11位于额外的过滤链中;触发过滤器:&#39; LogoutFilter&#39; 2017-07-23 04:34:48.543 DEBUG 30610 --- [nio-5000-exec-3] o.s.s.w.u.matcher.AntPathRequestMatcher:Request&#39; GET /&#39;没有匹配&#39; POST / logout 2017-07-23 04:34:48.543 DEBUG 30610 --- [nio-5000-exec-3] o.s.security.web.FilterChainProxy:/在第6位的11位额外的过滤链中;触发过滤器:&#39; RequestCacheAwareFilter&#39; 2017-07-23 04:34:48.543 DEBUG 30610 --- [nio-5000-exec-3] o.s.security.web.FilterChainProxy:/在第7位的11位额外的过滤链中;触发过滤器:&#39; SecurityContextHolderAwareRequestFilter&#39; 2017-07-23 04:34:48.543 DEBUG 30610 --- [nio-5000-exec-3] o.s.security.web.FilterChainProxy:/在第8位的11位额外的过滤链中;触发过滤器:&#39; AnonymousAuthenticationFilter&#39; 2017-07-23 04:34:48.543 DEBUG 30610 --- [nio-5000-exec-3] osswaAnonymousAuthenticationFilter:填充带有匿名令牌的SecurityContextHolder:&#39; org.springframework.security.authentication.AnonymousAuthenticationToken@9055e4a6:Principal :anonymousUser;证书:[保护];认证:真实;详细信息:org.springframework.security.web.authentication.WebAuthenticationDetails@957e:RemoteIpAddress:127.0.0.1; SessionId:null;授权机构:ROLE_ANONYMOUS&#39; 2017-07-23 04:34:48.544 DEBUG 30610 --- [nio-5000-exec-3] o.s.security.web.FilterChainProxy:/在第9位的11位于额外的过滤链中;触发过滤器:&#39; SessionManagementFilter&#39; 2017-07-23 04:34:48.544 DEBUG 30610 --- [nio-5000-exec-3] o.s.security.web.FilterChainProxy:/在第10位的11位于额外的过滤链中;触发过滤器:&#39; ExceptionTranslationFilter&#39; 2017-07-23 04:34:48.544 DEBUG 30610 --- [nio-5000-exec-3] o.s.security.web.FilterChainProxy:/在11位11的附加过滤链中;触发过滤器:&#39; FilterSecurityInterceptor&#39; 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] o.s.s.w.a.i.FilterSecurityInterceptor:以前经过身份验证:org.springframework.security.authentication.AnonymousAuthenticationToken@9055e4a6:Principal: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] o.s.s.w.a.i.FilterSecurityInterceptor:授权成功 2017-07-23 04:34:48.546 DEBUG 30610 --- [nio-5000-exec-3] o.s.s.w.a.i.FilterSecurityInterceptor:RunAsManager没有更改Authentication对象 2017-07-23 04:34:48.546 DEBUG 30610 --- [nio-5000-exec-3] o.s.security.web.FilterChainProxy:/到达额外过滤链的末尾;继续与原始链 2017-07-23 04:34:48.547 DEBUG 30610 --- [nio-5000-exec-3] o.s.web.servlet.DispatcherServlet:DispatcherServlet with name&#39; dispatcherServlet&#39;处理GET请求[/] 2017-07-23 04:34:48.549 DEBUG 30610 --- [nio-5000-exec-3] s.w.s.m.m.a.RequestMappingHandlerMapping:查找路径的处理程序方法/ 2017-07-23 04:34:48.556 DEBUG 30610 --- [nio-5000-exec-3] s.w.s.m.m.a.RequestMappingHandlerMapping:没找到[/]的处理程序方法 2017-07-23 04:34:48.557 DEBUG 30610 --- [nio-5000-exec-3] o.s.w.s.handler.SimpleUrlHandlerMapping:请求[/]的匹配模式是[/ ] 2017-07-23 04:34:48.557 DEBUG 30610 --- [nio-5000-exec-3] o.s.w.s.handler.SimpleUrlHandlerMapping:URI请求的模板变量[/]是{} 2017-07-23 04:34:48.557 DEBUG 30610 --- [nio-5000-exec-3] oswshandler.SimpleUrlHandlerMapping:使用处理程序[ResourceHttpRequestHandler [locations = [ServletContext资源[/],类]将[/]映射到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] o.s.web.servlet.DispatcherServlet:[/]的Last-Modified值为:-1 2017-07-23 04:34:48.558 DEBUG 30610 --- [nio-5000-exec-3] w.c.HttpSessionSecurityContextRepository:SecurityContext为空或内容为匿名 - 上下文不会存储在HttpSession中。 2017-07-23 04:34:48.558 DEBUG 30610 --- [nio-5000-exec-3] osweb.servlet.DispatcherServlet:Null ModelAndView返回DispatcherServlet,名称为&#39; dispatcherServlet&#39;:假设HandlerAdapter已完成请求处理 2017-07-23 04:34:48.558 DEBUG 30610 --- [nio-5000-exec-3] o.s.web.servlet.DispatcherServlet:已成功完成请求 2017-07-23 04:34:48.559 DEBUG 30610 --- [nio-5000-exec-3] o.s.s.w.a.ExceptionTranslationFilter:链正常处理 2017-07-23 04:34:48.559 DEBUG 30610 --- [nio-5000-exec-3] s.s.w.c.SecurityContextPersistenceFilter:SecurityContextHolder现已清除,请求处理完成 2017-07-23 04:34:48.560 DEBUG 30610 --- [nio-5000-exec-3] o.s.web.servlet.DispatcherServlet:DispatcherServlet with name&#39; dispatcherServlet&#39;处理[/ error]的GET请求 2017-07-23 04:34:48.565 DEBUG 30610 --- [nio-5000-exec-3] s.w.s.m.m.a.RequestMappingHandlerMapping:查找路径/错误的处理程序方法 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] o.s.web.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标题类型和可制作的媒体类型[text / html]) 2017-07-23 04:34:48.579 DEBUG 30610 --- [nio-5000-exec-3] oswsvContentNegotiatingViewResolver:根据要求的媒体类型返回[org.thymeleaf.spring4.view.ThymeleafView@ec234ad]&#39; text / html的&#39; 2017-07-23 04:34:48.579 DEBUG 30610 --- [nio-5000-exec-3] osweb.servlet.DispatcherServlet:使用名称在DispatcherServlet中渲染视图[org.thymeleaf.spring4.view.ThymeleafView@ec234ad] &#39; DispatcherServlet的&#39; 2017-07-23 04:34:48.597 DEBUG 30610 --- [nio-5000-exec-3] o.s.web.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'