월 19,800원
5개월 할부 시다른 수강생들이 자주 물어보는 질문이 궁금하신가요?
- 미해결스프링 기반 REST API 개발
토큰 갱신 질문드립니다.
강의자료 38. 이벤트 API 점검 의 토큰 갱신하기 입니다. 폼의 token 이 refresh_token 으로 수정되어야 하지 않을까 하는 생각에 글을 남깁니다. 토큰 재발급 POST :: http://localhost:8081/oauth/token -> 500 Error { "error": "server_error", "error_description": "Internal Server Error" } -> 200 OK { "access_token": "d1110be3-1603-4724-9aa1-54b990fa2cb5", "token_type": "bearer", "refresh_token": "653c38ac-f000-4955-9e01-06bc29d4be77", "expires_in": 591, "scope": "read write" }
- 미해결스프링 기반 REST API 개발
Gradle 인 경우엔 어떻게 선언해줘야하나요??
Gradle 인 경우엔 어떻게 선언해줘야하나요??
- 미해결스프링 기반 REST API 개발
Entity와 DTO의 차이점이 무엇인가요??
정확히 어떤 차이점이 있나요??
- 미해결스프링 기반 REST API 개발
UNAUTHORIZED 상태코드 관련 질문드립니다.
안녕하세요. 뒤늦게 REST API 강의에 승선하게 된 취준생입니다😊 강의를 보다가 21:50 시간대에 401(UNAUTHORIZED) 상태코드 관련해서 질문이 있어 글을 쓰게 되었습니다. EventController.class //... @PutMapping("/{id}"} public ResponseEntity updateEvent(...) { //... if(!existingEvent.getManager().equals(currentUser)) { return new ResponseEntity(HttpStatus.UNAUTHORIZED); } } 제 생각에는 currentUser가 null 일 경우 :: 401(UNAUTHORIZED) currentUser와 getManager()가 다를 경우 :: 403(FORBIDDEN) 으로 응답해야 한다고 생각했었는데, 위의 경우에서 401(UNAUTHORIZED)로 통일해서 쓰는게 더 나은 방법인지 궁금합니다.
- 해결됨스프링 기반 REST API 개발
인텔리제이 로그 마우스 조작 관련
기선님 영상 보다 궁금한게 있어서 질문드립니다. 스프링부트앱을 실행하면 인텔리제이 콘솔에 로그가 쫙 올라오잖아요. 그 로그를 보면서 기선님이 마우스 포인터를 옮기면 자연스럽게 수평, 수직 스크롤이 되던데요. 전 아무리해도 안되서 계속 스크롤바 당겨서 보고 있습니다. 저도 맥을 쓰고 있는데, 방법을 좀 알려주실 수 있을까요?
- 미해결스프링 기반 REST API 개발
html 파일 생성이 안되는데 한번 봐주실수 있으실까요?
제가 gradle 기반으로 하는게 익숙해서 RestDocs 생성을 gradle 기반으로 작성을 하였는데,html 파일 생성이 되지가 않네요.RestDocs의 Documents에 있는 대로 gradle을 셋팅했는데,, 코드 한번 봐주실수 있으신가요? 코드는 github에 올려두었습니다. :)https://github.com/ggamzang/restapistudy
- 해결됨스프링 기반 REST API 개발
git 레파지토리 주소 좀 알려주세요~
git 레파지토리 주소 좀 알려주세요~
- 미해결스프링 기반 REST API 개발
Errors에 관한 질문 드립니다.
안녕하세요 반복해서 열심히 강의 잘 듣고 있습니다. 바쁘시겠지만 답변 부탁 드리겠습니다. 【EventController.createEvent 의 Errors에 관한 질문 드립니다.】 ■Errors 인터페이스는 스프링 프레임 워크에서 자동으로 Errors를 구현 한 클래스를 빈으로 등록을 해 주는 건가요? ■그렇기 때문에 EventValidator에서 Errors에 에러를 담고 특별히 반환을 하지 않아도 EventController 에서 사용할 수 있는 건가요? ■마지막으로 에러 객체가 빈으로 등록이 된다면 다른 Controller에서도 동일한 객체를 사용 할 수 있는건가요? 아니면 EventController 안에서만 사용이 가능한지요 【ModelMapper 주입에 관한 질문 드립니다.】 ■전 강의에서 모델 메퍼를 공용으로 사용하기 위해서 메인 메소드에서 빈으로 등록을 했는데 pom.xml에서 의존성을 설정하면 빈으로 등록이 되고 그러면 어디에서도 주입을 받아서 사용할 수 있는게 아닌가요?
- 미해결스프링 기반 REST API 개발
생성자 주입 관련 질문 입니다.
안녕하세요강의 잘 듣고 있습니다.질문 드립니다.전 강의에서 생성자가 하나이고 파라메터가 빈으로 등록 되어 있는 객체이면 Autowired를 붙이지않아도 주입이 가능하다고 배웠는데 빈으로 등록만 되어 있으면 하나 이상이라도 주입이 가능한지요그리고 생성자가 하나이고 파라메터가 빈으로 등록되어 있지 않은 클래스 하나이면 자동으로 빈으로 등록을 해서 Autowired를 붙이지 않아도 주입이 되나요?답변 부탁드리겠습니다.
- 미해결스프링 기반 REST API 개발
Pathvariable 값 셋팅 관련 질문
안녕하세요 잘 모르지만 반복해서 열심히 듣고 있습니다. 질문 드립니다. 이벤트를 등록해서 id값을 꺼내서 셋팅 하기 전에 테스트 실행해서 출력된 url의 {id} 값은 어디서 셋팅된 값이 출력되는 건가요? 혹시 비어 있는 값이 찍히는건가요? 답변 부탁 드릴께요 URI createdUri = linkTo(EventController.class).slash("{id}").toUri()
- 미해결스프링 기반 REST API 개발
예제소스에서 profile의 링크를 볼수가 없습니다
gitlab의 natural, github의 study밑의 ksug모두프로필의 링크에서 나오는 문서의 모습을 볼 수가 없었습니다.기억은 안나지만 ksug는 oauth 토큰 가져오 는 부분도 안되었던 것 같습니다github/study의 rest-api-with-spring으로 oauth와 나머지 실습은 따라했지만여전히 프로필의 링크의 문서는 볼 수가 없습니다아무도 글이 없는 것을 보니저만 못보는 것인가요? ㅠㅠ 제가 실행을 잘못했을까요?;;예제들..한번 확인해주시면 감사하겠습니다..
- 미해결스프링 기반 REST API 개발
예상치못한 예외가 throw 되었을 경우의 Response 처리에 관련하여 질문드립니다
실제로 컨트롤러에서 처리를 하다보면, 예상치 못한 에러가 발생하는 경우가 있는 것 같습니다. 가령 강의의 예제에서는 JSON serialization, deserialization 과정에서 checked exception이 발생할수 있으며, Repository객체를 사용하는 경우에는 DataAccessException 런타임 예외가 발생할 수 있을 것 같습니다. 이러한 경우들에도 적절한 응답을 돌려주고 싶은데, 그 때의 베스트 프렉티스에 대해서 여쭤보고자 합니다.결국 @ExeptionHandler 라는 어노테이션이 붙은 메소드를 최소한 글로벌하게 하나는 만들어서 인터널 서버 에러(500)에 매핑시키게 되는 꼭 필요한 부분이라고 생각하는데, 맞는 생각일까요? 잘못하면 에러 로그를 view로 보여주게 될 것 같아서 그것을 방지하고자 함입니다.@ExceptionHandlerpublic void globalExecptionHandler(Exception e) {return ResponseEntity.internalServerError();}컨트롤러 내부에서도 결국 적어도 Unchecked Runtime Exception을 잡기 위해서 @ExceptionHandler를 정의하면 컨트롤러별로 예상치 못한 예외를 적절히 핸들링해 필요한 처리를 할 수 있게 되기 때문에 정의하는 것이 좋을것 같다고 생각하는데요, 이렇게 정의 했을 때 제가 고민되는 부분이 있습니다. 예제에서 나오는 것처럼 로직으로 인해서 발생하는 에러는 ResponseEntity를 리턴하는 형태로 처리하고, 그 외의 에러는 @ExceptionHandler로 잡게되면, 에러를 2가지 서로 다른 방법으로 처리함으로서 코드의 가독성을 해치는게 아닐까라고 생각해 보았습니다.그렇다고 ResponseEntity로 통일하고자하면, 컨트롤러 메소드 각각에서 반드시 return으로 예외를 처리해야 하기 때문에, 컨트롤러 메소드 마다 try catch로 감싸주고 catch(Exception e) 같은 블록에서 반복적으로 internalServerError를 리턴해야만 하는 문제가 있습니다.그리고 @ExceptionHandler로 통일하고자하면, throw 문을 goto처럼 사용하는 것이되어, 코드의 가독성을 해칩니다. 하지만 동시에 컨트롤러 메소드 내부의 if else를 줄여 줘서 가독성을 증가시키고, 컨트롤러 / 기타 빈 객체의 책임을 나누는 효과도 있습니다. 가령 service레벨이나 레포지토리 레벨에서 여러 데이터를 종합하다보니(MSA설계에서 자주 있는것 같습니다) 상황에 따라 200대가 아닌 리스폰스를 돌려줘야 할 필요가 있는 경우, 이것을 controller에서 호출한 service.method()의 리턴값으로 돌려줘서 컨트롤러에서 if else로 처리하게 되겠죠. 하지만 적절한 예외를 정의하여 그것을 컨트롤러가 아닌 webmvc빈에서 throw를 하여 ExceptionHandler가 처리하도록 하면, 컨트롤러 메소드 코드를 간결하게 할 수 있을 것 같습니다. 하지만 역시 throw 를 goto처럼 써서 가독성을 떨어뜨리는게 아닐까 하는 부담감이 있기도 하네요.이런 것들을 복합적으로 고민해서 어떻게 1) 예제처럼 간단하게 체크해서 발생시킬수 있는 에러 2) 복잡한 상황에서 컨트롤러 객체가 아닌 곳에서 확인할 수 있는 에러 3) 예상치못한 런타임 에러(Repository connection pool error, httpclient socket timeout ...)를 깔끔하게 처리하여 클라이언트에 돌려줄 수 있을지 고민입니다. 어떻게 하는게 베스트일까요?
- 미해결스프링 기반 REST API 개발
예제 에러 질문 드립니다.
강의를 여러번 돌려보아도 놓친 부분이 없는데 문제가 발생하였고여러가지를 손보아도 해결이 되지않아 질문 드립니다ㅠㅠ첫번째 예제 실행시 /docs/index.html 로 접속하면 로그인 페이지로 이동이 됩니다@Overridepublic void configure(WebSecurity web) throws Exception { web.ignoring().mvcMatchers("/docs/index.html"); web.ignoring().requestMatchers(PathRequest.toStaticResources().atCommonLocations());}org.springframework.security.access.AccessDeniedException: Access is deniedat org.springframework.security.access.vote.AffirmativeBased.decide(AffirmativeBased.java:84) ~[spring-security-core-5.1.3.RELEASE.jar:5.1.3.RELEASE]at org.springframework.security.access.intercept.AbstractSecurityInterceptor.beforeInvocation(AbstractSecurityInterceptor.java:233) ~[spring-security-core-5.1.3.RELEASE.jar:5.1.3.RELEASE]at org.springframework.security.web.access.intercept.FilterSecurityInterceptor.invoke(FilterSecurityInterceptor.java:124) ~[spring-security-web-5.1.3.RELEASE.jar:5.1.3.RELEASE]at org.springframework.security.web.access.intercept.FilterSecurityInterceptor.doFilter(FilterSecurityInterceptor.java:91) ~[spring-security-web-5.1.3.RELEASE.jar:5.1.3.RELEASE]at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:334) ~[spring-security-web-5.1.3.RELEASE.jar:5.1.3.RELEASE]at org.springframework.security.web.access.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:119) ~[spring-security-web-5.1.3.RELEASE.jar:5.1.3.RELEASE]at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:334) ~[spring-security-web-5.1.3.RELEASE.jar:5.1.3.RELEASE]at org.springframework.security.web.session.SessionManagementFilter.doFilter(SessionManagementFilter.java:137) ~[spring-security-web-5.1.3.RELEASE.jar:5.1.3.RELEASE]at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:334) ~[spring-security-web-5.1.3.RELEASE.jar:5.1.3.RELEASE]at org.springframework.security.web.authentication.AnonymousAuthenticationFilter.doFilter(AnonymousAuthenticationFilter.java:111) ~[spring-security-web-5.1.3.RELEASE.jar:5.1.3.RELEASE]at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:334) ~[spring-security-web-5.1.3.RELEASE.jar:5.1.3.RELEASE]at org.springframework.security.web.servletapi.SecurityContextHolderAwareRequestFilter.doFilter(SecurityContextHolderAwareRequestFilter.java:170) ~[spring-security-web-5.1.3.RELEASE.jar:5.1.3.RELEASE]at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:334) ~[spring-security-web-5.1.3.RELEASE.jar:5.1.3.RELEASE]at org.springframework.security.web.savedrequest.RequestCacheAwareFilter.doFilter(RequestCacheAwareFilter.java:63) ~[spring-security-web-5.1.3.RELEASE.jar:5.1.3.RELEASE]at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:334) ~[spring-security-web-5.1.3.RELEASE.jar:5.1.3.RELEASE]at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:101) ~[spring-web-5.1.4.RELEASE.jar:5.1.4.RELEASE]at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:334) ~[spring-security-web-5.1.3.RELEASE.jar:5.1.3.RELEASE]at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:101) ~[spring-web-5.1.4.RELEASE.jar:5.1.4.RELEASE]at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:334) ~[spring-security-web-5.1.3.RELEASE.jar:5.1.3.RELEASE]at org.springframework.security.web.authentication.ui.DefaultLoginPageGeneratingFilter.doFilter(DefaultLoginPageGeneratingFilter.java:206) ~[spring-security-web-5.1.3.RELEASE.jar:5.1.3.RELEASE]at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:334) ~[spring-security-web-5.1.3.RELEASE.jar:5.1.3.RELEASE]at org.springframework.security.web.authentication.AbstractAuthenticationProcessingFilter.doFilter(AbstractAuthenticationProcessingFilter.java:200) ~[spring-security-web-5.1.3.RELEASE.jar:5.1.3.RELEASE]at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:334) ~[spring-security-web-5.1.3.RELEASE.jar:5.1.3.RELEASE]at org.springframework.security.web.authentication.logout.LogoutFilter.doFilter(LogoutFilter.java:116) ~[spring-security-web-5.1.3.RELEASE.jar:5.1.3.RELEASE]at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:334) ~[spring-security-web-5.1.3.RELEASE.jar:5.1.3.RELEASE]at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:101) ~[spring-web-5.1.4.RELEASE.jar:5.1.4.RELEASE]at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:334) ~[spring-security-web-5.1.3.RELEASE.jar:5.1.3.RELEASE]at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:101) ~[spring-web-5.1.4.RELEASE.jar:5.1.4.RELEASE]at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:334) ~[spring-security-web-5.1.3.RELEASE.jar:5.1.3.RELEASE]at org.springframework.security.web.context.SecurityContextPersistenceFilter.doFilter(SecurityContextPersistenceFilter.java:105) ~[spring-security-web-5.1.3.RELEASE.jar:5.1.3.RELEASE]at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:334) ~[spring-security-web-5.1.3.RELEASE.jar:5.1.3.RELEASE]at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:101) ~[spring-web-5.1.4.RELEASE.jar:5.1.4.RELEASE]at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:334) ~[spring-security-web-5.1.3.RELEASE.jar:5.1.3.RELEASE]at org.springframework.security.web.FilterChainProxy.doFilterInternal(FilterChainProxy.java:215) ~[spring-security-web-5.1.3.RELEASE.jar:5.1.3.RELEASE]at org.springframework.security.web.FilterChainProxy.doFilter(FilterChainProxy.java:178) ~[spring-security-web-5.1.3.RELEASE.jar:5.1.3.RELEASE]at org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:357) ~[spring-web-5.1.4.RELEASE.jar:5.1.4.RELEASE]at org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:270) ~[spring-web-5.1.4.RELEASE.jar:5.1.4.RELEASE]at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) ~[tomcat-embed-core-9.0.14.jar:9.0.14]at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) ~[tomcat-embed-core-9.0.14.jar:9.0.14]at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:712) ~[tomcat-embed-core-9.0.14.jar:9.0.14]at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:461) ~[tomcat-embed-core-9.0.14.jar:9.0.14]at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:384) ~[tomcat-embed-core-9.0.14.jar:9.0.14]at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:312) ~[tomcat-embed-core-9.0.14.jar:9.0.14]at org.apache.catalina.core.StandardHostValve.custom(StandardHostValve.java:394) ~[tomcat-embed-core-9.0.14.jar:9.0.14]at org.apache.catalina.core.StandardHostValve.status(StandardHostValve.java:253) ~[tomcat-embed-core-9.0.14.jar:9.0.14]at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:175) ~[tomcat-embed-core-9.0.14.jar:9.0.14]at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:92) ~[tomcat-embed-core-9.0.14.jar:9.0.14]at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:74) ~[tomcat-embed-core-9.0.14.jar:9.0.14]at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:343) ~[tomcat-embed-core-9.0.14.jar:9.0.14]at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:408) ~[tomcat-embed-core-9.0.14.jar:9.0.14]at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66) ~[tomcat-embed-core-9.0.14.jar:9.0.14]at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:834) ~[tomcat-embed-core-9.0.14.jar:9.0.14]at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1417) ~[tomcat-embed-core-9.0.14.jar:9.0.14]at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49) ~[tomcat-embed-core-9.0.14.jar:9.0.14]at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) ~[na:na]at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) ~[na:na]at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) ~[tomcat-embed-core-9.0.14.jar:9.0.14]at java.base/java.lang.Thread.run(Thread.java:834) ~[na:na]2019-02-26 23:18:33.044 DEBUG 15076 --- [nio-8080-exec-1] o.s.s.w.util.matcher.AndRequestMatcher : Trying to match using Ant [pattern='/', GET]2019-02-26 23:18:33.045 DEBUG 15076 --- [nio-8080-exec-1] o.s.s.w.u.matcher.AntPathRequestMatcher : Request '/error' matched by universal pattern '/'2019-02-26 23:18:33.045 DEBUG 15076 --- [nio-8080-exec-1] o.s.s.w.util.matcher.AndRequestMatcher : Trying to match using NegatedRequestMatcher [requestMatcher=Ant [pattern='/*/favicon.']]2019-02-26 23:18:33.045 DEBUG 15076 --- [nio-8080-exec-1] o.s.s.w.u.matcher.AntPathRequestMatcher : Checking match of request : '/error'; against '//favicon.'2019-02-26 23:18:33.045 DEBUG 15076 --- [nio-8080-exec-1] o.s.s.w.u.matcher.NegatedRequestMatcher : matches = true2019-02-26 23:18:33.045 DEBUG 15076 --- [nio-8080-exec-1] o.s.s.w.util.matcher.AndRequestMatcher : Trying to match using NegatedRequestMatcher [requestMatcher=MediaTypeRequestMatcher [contentNegotiationStrategy=org.springframework.web.accept.ContentNegotiationManager@5020e5ab, matchingMediaTypes=[application/json], useEquals=false, ignoredMediaTypes=[/]]]2019-02-26 23:18:33.046 DEBUG 15076 --- [nio-8080-exec-1] o.s.s.w.u.m.MediaTypeRequestMatcher : httpRequestMediaTypes=[text/html, application/xhtml+xml, image/webp, image/apng, application/xml;q=0.9, /;q=0.8]2019-02-26 23:18:33.046 DEBUG 15076 --- [nio-8080-exec-1] o.s.s.w.u.m.MediaTypeRequestMatcher : Processing text/html2019-02-26 23:18:33.046 DEBUG 15076 --- [nio-8080-exec-1] o.s.s.w.u.m.MediaTypeRequestMatcher : application/json .isCompatibleWith text/html = false2019-02-26 23:18:33.046 DEBUG 15076 --- [nio-8080-exec-1] o.s.s.w.u.m.MediaTypeRequestMatcher : Processing application/xhtml+xml2019-02-26 23:18:33.046 DEBUG 15076 --- [nio-8080-exec-1] o.s.s.w.u.m.MediaTypeRequestMatcher : application/json .isCompatibleWith application/xhtml+xml = false2019-02-26 23:18:33.046 DEBUG 15076 --- [nio-8080-exec-1] o.s.s.w.u.m.MediaTypeRequestMatcher : Processing image/webp2019-02-26 23:18:33.046 DEBUG 15076 --- [nio-8080-exec-1] o.s.s.w.u.m.MediaTypeRequestMatcher : application/json .isCompatibleWith image/webp = false2019-02-26 23:18:33.046 DEBUG 15076 --- [nio-8080-exec-1] o.s.s.w.u.m.MediaTypeRequestMatcher : Processing image/apng2019-02-26 23:18:33.046 DEBUG 15076 --- [nio-8080-exec-1] o.s.s.w.u.m.MediaTypeRequestMatcher : application/json .isCompatibleWith image/apng = false2019-02-26 23:18:33.046 DEBUG 15076 --- [nio-8080-exec-1] o.s.s.w.u.m.MediaTypeRequestMatcher : Processing application/xml;q=0.92019-02-26 23:18:33.046 DEBUG 15076 --- [nio-8080-exec-1] o.s.s.w.u.m.MediaTypeRequestMatcher : application/json .isCompatibleWith application/xml;q=0.9 = false2019-02-26 23:18:33.047 DEBUG 15076 --- [nio-8080-exec-1] o.s.s.w.u.m.MediaTypeRequestMatcher : Processing /;q=0.82019-02-26 23:18:33.047 DEBUG 15076 --- [nio-8080-exec-1] o.s.s.w.u.m.MediaTypeRequestMatcher : Ignoring2019-02-26 23:18:33.047 DEBUG 15076 --- [nio-8080-exec-1] o.s.s.w.u.m.MediaTypeRequestMatcher : Did not match any media types2019-02-26 23:18:33.047 DEBUG 15076 --- [nio-8080-exec-1] o.s.s.w.u.matcher.NegatedRequestMatcher : matches = true2019-02-26 23:18:33.047 DEBUG 15076 --- [nio-8080-exec-1] o.s.s.w.util.matcher.AndRequestMatcher : Trying to match using NegatedRequestMatcher [requestMatcher=RequestHeaderRequestMatcher [expectedHeaderName=X-Requested-With, expectedHeaderValue=XMLHttpRequest]]2019-02-26 23:18:33.047 DEBUG 15076 --- [nio-8080-exec-1] o.s.s.w.u.matcher.NegatedRequestMatcher : matches = true2019-02-26 23:18:33.047 DEBUG 15076 --- [nio-8080-exec-1] o.s.s.w.util.matcher.AndRequestMatcher : All requestMatchers returned true2019-02-26 23:18:33.585 WARN 15076 --- [nio-8080-exec-1] o.a.c.util.SessionIdGeneratorBase : Creation of SecureRandom instance for session ID generation using [SHA1PRNG] took [522] milliseconds.2019-02-26 23:18:33.587 DEBUG 15076 --- [nio-8080-exec-1] o.s.s.w.s.HttpSessionRequestCache : DefaultSavedRequest added to Session: DefaultSavedRequest[http://localhost:8080/error]2019-02-26 23:18:33.587 DEBUG 15076 --- [nio-8080-exec-1] o.s.s.w.a.ExceptionTranslationFilter : Calling Authentication entry point.2019-02-26 23:18:33.587 DEBUG 15076 --- [nio-8080-exec-1] s.w.a.DelegatingAuthenticationEntryPoint : Trying to match using AndRequestMatcher [requestMatchers=[NegatedRequestMatcher [requestMatcher=RequestHeaderRequestMatcher [expectedHeaderName=X-Requested-With, expectedHeaderValue=XMLHttpRequest]], MediaTypeRequestMatcher [contentNegotiationStrategy=org.springframework.web.accept.ContentNegotiationManager@5020e5ab, matchingMediaTypes=[application/xhtml+xml, image/, text/html, text/plain], useEquals=false, ignoredMediaTypes=[/]]]]2019-02-26 23:18:33.587 DEBUG 15076 --- [nio-8080-exec-1] o.s.s.w.util.matcher.AndRequestMatcher : Trying to match using NegatedRequestMatcher [requestMatcher=RequestHeaderRequestMatcher [expectedHeaderName=X-Requested-With, expectedHeaderValue=XMLHttpRequest]]2019-02-26 23:18:33.587 DEBUG 15076 --- [nio-8080-exec-1] o.s.s.w.u.matcher.NegatedRequestMatcher : matches = true2019-02-26 23:18:33.587 DEBUG 15076 --- [nio-8080-exec-1] o.s.s.w.util.matcher.AndRequestMatcher : Trying to match using MediaTypeRequestMatcher [contentNegotiationStrategy=org.springframework.web.accept.ContentNegotiationManager@5020e5ab, matchingMediaTypes=[application/xhtml+xml, image/, text/html, text/plain], useEquals=false, ignoredMediaTypes=[/]]2019-02-26 23:18:33.587 DEBUG 15076 --- [nio-8080-exec-1] o.s.s.w.u.m.MediaTypeRequestMatcher : httpRequestMediaTypes=[text/html, application/xhtml+xml, image/webp, image/apng, application/xml;q=0.9, /;q=0.8]2019-02-26 23:18:33.587 DEBUG 15076 --- [nio-8080-exec-1] o.s.s.w.u.m.MediaTypeRequestMatcher : Processing text/html2019-02-26 23:18:33.588 DEBUG 15076 --- [nio-8080-exec-1] o.s.s.w.u.m.MediaTypeRequestMatcher : application/xhtml+xml .isCompatibleWith text/html = false2019-02-26 23:18:33.588 DEBUG 15076 --- [nio-8080-exec-1] o.s.s.w.u.m.MediaTypeRequestMatcher : image/ .isCompatibleWith text/html = false2019-02-26 23:18:33.588 DEBUG 15076 --- [nio-8080-exec-1] o.s.s.w.u.m.MediaTypeRequestMatcher : text/html .isCompatibleWith text/html = true2019-02-26 23:18:33.588 DEBUG 15076 --- [nio-8080-exec-1] o.s.s.w.util.matcher.AndRequestMatcher : All requestMatchers returned true2019-02-26 23:18:33.588 DEBUG 15076 --- [nio-8080-exec-1] s.w.a.DelegatingAuthenticationEntryPoint : Match found! Executing org.springframework.security.web.authentication.LoginUrlAuthenticationEntryPoint@4abfa2ff2019-02-26 23:18:33.589 DEBUG 15076 --- [nio-8080-exec-1] o.s.s.web.DefaultRedirectStrategy : Redirecting to 'http://localhost:8080/login'2019-02-26 23:18:33.589 DEBUG 15076 --- [nio-8080-exec-1] w.c.HttpSessionSecurityContextRepository : SecurityContext is empty or contents are anonymous - context will not be stored in HttpSession.2019-02-26 23:18:33.591 DEBUG 15076 --- [nio-8080-exec-1] s.s.w.c.SecurityContextPersistenceFilter : SecurityContextHolder now cleared, as request processing completed2019-02-26 23:18:33.602 DEBUG 15076 --- [nio-8080-exec-2] o.s.s.web.util.matcher.OrRequestMatcher : Trying to match using Ant [pattern='/css/']2019-02-26 23:18:33.602 DEBUG 15076 --- [nio-8080-exec-2] o.s.s.w.u.matcher.AntPathRequestMatcher : Checking match of request : '/login'; against '/css/'2019-02-26 23:18:33.602 DEBUG 15076 --- [nio-8080-exec-2] o.s.s.web.util.matcher.OrRequestMatcher : Trying to match using Ant [pattern='/js/']2019-02-26 23:18:33.602 DEBUG 15076 --- [nio-8080-exec-2] o.s.s.w.u.matcher.AntPathRequestMatcher : Checking match of request : '/login'; against '/js/'2019-02-26 23:18:33.602 DEBUG 15076 --- [nio-8080-exec-2] o.s.s.web.util.matcher.OrRequestMatcher : Trying to match using Ant [pattern='/images/']2019-02-26 23:18:33.602 DEBUG 15076 --- [nio-8080-exec-2] o.s.s.w.u.matcher.AntPathRequestMatcher : Checking match of request : '/login'; against '/images/'2019-02-26 23:18:33.602 DEBUG 15076 --- [nio-8080-exec-2] o.s.s.web.util.matcher.OrRequestMatcher : Trying to match using Ant [pattern='/webjars/']2019-02-26 23:18:33.602 DEBUG 15076 --- [nio-8080-exec-2] o.s.s.w.u.matcher.AntPathRequestMatcher : Checking match of request : '/login'; against '/webjars/'2019-02-26 23:18:33.602 DEBUG 15076 --- [nio-8080-exec-2] o.s.s.web.util.matcher.OrRequestMatcher : Trying to match using Ant [pattern='//favicon.ico']2019-02-26 23:18:33.602 DEBUG 15076 --- [nio-8080-exec-2] o.s.s.w.u.matcher.AntPathRequestMatcher : Checking match of request : '/login'; against '/**/favicon.ico'2019-02-26 23:18:33.602 DEBUG 15076 --- [nio-8080-exec-2] o.s.s.web.util.matcher.OrRequestMatcher : No matches found2019-02-26 23:18:33.603 DEBUG 15076 --- [nio-8080-exec-2] o.s.security.web.FilterChainProxy : /login at position 1 of 15 in additional filter chain; firing Filter: 'WebAsyncManagerIntegrationFilter'2019-02-26 23:18:33.604 DEBUG 15076 --- [nio-8080-exec-2] o.s.security.web.FilterChainProxy : /login at position 2 of 15 in additional filter chain; firing Filter: 'SecurityContextPersistenceFilter'2019-02-26 23:18:33.604 DEBUG 15076 --- [nio-8080-exec-2] w.c.HttpSessionSecurityContextRepository : HttpSession returned null object for SPRING_SECURITY_CONTEXT2019-02-26 23:18:33.604 DEBUG 15076 --- [nio-8080-exec-2] w.c.HttpSessionSecurityContextRepository : No SecurityContext was available from the HttpSession: org.apache.catalina.session.StandardSessionFacade@63c5180d. A new one will be created.2019-02-26 23:18:33.604 DEBUG 15076 --- [nio-8080-exec-2] o.s.security.web.FilterChainProxy : /login at position 3 of 15 in additional filter chain; firing Filter: 'HeaderWriterFilter'2019-02-26 23:18:33.605 DEBUG 15076 --- [nio-8080-exec-2] o.s.security.web.FilterChainProxy : /login at position 4 of 15 in additional filter chain; firing Filter: 'CsrfFilter'2019-02-26 23:18:33.607 DEBUG 15076 --- [nio-8080-exec-2] o.s.security.web.FilterChainProxy : /login at position 5 of 15 in additional filter chain; firing Filter: 'LogoutFilter'2019-02-26 23:18:33.607 DEBUG 15076 --- [nio-8080-exec-2] o.s.s.w.u.matcher.AntPathRequestMatcher : Request 'GET /login' doesn't match 'POST /logout'2019-02-26 23:18:33.607 DEBUG 15076 --- [nio-8080-exec-2] o.s.security.web.FilterChainProxy : /login at position 6 of 15 in additional filter chain; firing Filter: 'UsernamePasswordAuthenticationFilter'2019-02-26 23:18:33.607 DEBUG 15076 --- [nio-8080-exec-2] o.s.s.w.u.matcher.AntPathRequestMatcher : Request 'GET /login' doesn't match 'POST /login'2019-02-26 23:18:33.607 DEBUG 15076 --- [nio-8080-exec-2] o.s.security.web.FilterChainProxy : /login at position 7 of 15 in additional filter chain; firing Filter: 'DefaultLoginPageGeneratingFilter'2019-02-26 23:18:33.610 DEBUG 15076 --- [nio-8080-exec-2] o.s.s.w.header.writers.HstsHeaderWriter : Not injecting HSTS header since it did not match the requestMatcher org.springframework.security.web.header.writers.HstsHeaderWriter$SecureRequestMatcher@5cbf4d4c2019-02-26 23:18:33.611 DEBUG 15076 --- [nio-8080-exec-2] w.c.HttpSessionSecurityContextRepository : SecurityContext is empty or contents are anonymous - context will not be stored in HttpSession.2019-02-26 23:18:33.611 DEBUG 15076 --- [nio-8080-exec-2] s.s.w.c.SecurityContextPersistenceFilter : SecurityContextHolder now cleared, as request processing completed2번째 예제로 /docs/index.html에 접속시에는 404 에러가 발생합니다@Overrideprotected void configure(HttpSecurity http) throws Exception { http.authorizeRequests() .mvcMatchers("/docs/index.html").anonymous() .requestMatchers(PathRequest.toStaticResources().atCommonLocations()).anonymous();} . ____ _ __ _ _/\ / ' () _ ( ( ) | ' | '| | ' / ` | \/ )| |)| | | | | || (| | ) ) ) )' |__| .|| ||| |, | / / / /=========||==============|/=///_/:: Spring Boot :: (v2.1.2.RELEASE)2019-02-26 23:23:31.800 INFO 8696 --- [ main] n.s.demoinfleanrestapi.DemoApplication : Starting DemoApplication on DESKTOP-822PETH with PID 8696 (D:intel-springdemo-inflean-rest-apitargetclasses started by sangjin in D:intel-springdemo-inflean-rest-api)2019-02-26 23:23:31.804 INFO 8696 --- [ main] n.s.demoinfleanrestapi.DemoApplication : No active profile set, falling back to default profiles: default2019-02-26 23:23:34.220 INFO 8696 --- [ main] .s.d.r.c.RepositoryConfigurationDelegate : Bootstrapping Spring Data repositories in DEFAULT mode.2019-02-26 23:23:34.573 INFO 8696 --- [ main] .s.d.r.c.RepositoryConfigurationDelegate : Finished Spring Data repository scanning in 303ms. Found 2 repository interfaces.2019-02-26 23:23:35.201 INFO 8696 --- [ main] trationDelegate$BeanPostProcessorChecker : Bean 'org.springframework.transaction.annotation.ProxyTransactionManagementConfiguration' of type [org.springframework.transaction.annotation.ProxyTransactionManagementConfiguration$$EnhancerBySpringCGLIB$$b320f992] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)2019-02-26 23:23:35.245 INFO 8696 --- [ main] trationDelegate$BeanPostProcessorChecker : Bean 'org.springframework.hateoas.config.HateoasConfiguration' of type [org.springframework.hateoas.config.HateoasConfiguration$$EnhancerBySpringCGLIB$$32a146c4] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)2019-02-26 23:23:36.086 INFO 8696 --- [ main] o.s.b.w.embedded.tomcat.TomcatWebServer : Tomcat initialized with port(s): 8080 (http)2019-02-26 23:23:36.122 INFO 8696 --- [ main] o.apache.catalina.core.StandardService : Starting service [Tomcat]2019-02-26 23:23:36.122 INFO 8696 --- [ main] org.apache.catalina.core.StandardEngine : Starting Servlet engine: [Apache Tomcat/9.0.14]2019-02-26 23:23:36.134 INFO 8696 --- [ main] o.a.catalina.core.AprLifecycleListener : The APR based Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: [C:Program FilesJavajdk-11.0.2bin;C:WINDOWSSunJavabin;C:WINDOWSsystem32;C:WINDOWS;D:appsangjinproduct12.2.0dbhome_1bin;C:Windowssystem32;C:Windows;C:WindowsSystem32Wbem;"C:C:WINDOWSsystem32;C:WINDOWS;C:WINDOWSSystem32Wbem;C:WINDOWSSystem32;";C:Program FilesJavajdk-11.0.2bin;C:Program Files (x86)Windows Kits8.1Windows Performance Toolkit;C:Program FilesMicrosoft SQL Server110ToolsBinn;C:Program Files (x86)Microsoft SDKsTypeScript1.0;C:Program FilesMicrosoft SQL Server120ToolsBinn;C:Program FilesMySQLMySQL Utilities 1.6;C:WINDOWSsystem32;C:WINDOWSSystem32WindowsPowerShellv1.0;C:WINDOWSSystem32OpenSSH;C:Program FilesGitcmd;C:UserssangjinAppDataLocalMicrosoftWindowsApps;D:Program FilesJetBrainsIntelliJ IDEA Community Edition 2018.3.1bin;;C:Program FilesJavajdk-11.0.2bin;;.]2019-02-26 23:23:36.449 INFO 8696 --- [ main] o.a.c.c.C.[Tomcat].[localhost].[/] : Initializing Spring embedded WebApplicationContext2019-02-26 23:23:36.449 INFO 8696 --- [ main] o.s.web.context.ContextLoader : Root WebApplicationContext: initialization completed in 4553 ms2019-02-26 23:23:36.673 INFO 8696 --- [ main] com.zaxxer.hikari.HikariDataSource : HikariPool-1 - Starting...2019-02-26 23:23:36.833 INFO 8696 --- [ main] com.zaxxer.hikari.HikariDataSource : HikariPool-1 - Start completed.2019-02-26 23:23:36.901 INFO 8696 --- [ main] o.hibernate.jpa.internal.util.LogHelper : HHH000204: Processing PersistenceUnitInfo [name: default...]2019-02-26 23:23:37.002 INFO 8696 --- [ main] org.hibernate.Version : HHH000412: Hibernate Core {5.3.7.Final}2019-02-26 23:23:37.003 INFO 8696 --- [ main] org.hibernate.cfg.Environment : HHH000206: hibernate.properties not found2019-02-26 23:23:37.263 INFO 8696 --- [ main] o.hibernate.annotations.common.Version : HCANN000001: Hibernate Commons Annotations {5.0.4.Final}2019-02-26 23:23:37.454 INFO 8696 --- [ main] org.hibernate.dialect.Dialect : HHH000400: Using dialect: org.hibernate.dialect.MySQL5Dialect2019-02-26 23:23:38.364 DEBUG 8696 --- [ main] org.hibernate.SQL : drop table if exists account2019-02-26 23:23:38.373 DEBUG 8696 --- [ main] org.hibernate.SQL : drop table if exists account_roles2019-02-26 23:23:38.376 DEBUG 8696 --- [ main] org.hibernate.SQL : drop table if exists event2019-02-26 23:23:38.379 DEBUG 8696 --- [ main] org.hibernate.SQL : drop table if exists hibernate_sequence2019-02-26 23:23:38.389 DEBUG 8696 --- [ main] org.hibernate.SQL : create table account ( id integer not null, email varchar(255), password varchar(255), primary key (id)) engine=MyISAM2019-02-26 23:23:38.403 DEBUG 8696 --- [ main] org.hibernate.SQL : create table account_roles ( account_id integer not null, roles varchar(255)) engine=MyISAM2019-02-26 23:23:38.415 DEBUG 8696 --- [ main] org.hibernate.SQL : create table event ( id integer not null, base_price integer not null, begin_enrollment_date_time datetime, begin_event_date_time datetime, close_enrollment_date_time datetime, description varchar(255), end_event_date_time datetime, event_status varchar(255), free bit not null, limit_of_enrollment integer not null, location varchar(255), max_price integer not null, name varchar(255), offline bit not null, manager_id integer, primary key (id)) engine=MyISAM2019-02-26 23:23:38.427 DEBUG 8696 --- [ main] org.hibernate.SQL : create table hibernate_sequence ( next_val bigint) engine=MyISAM2019-02-26 23:23:38.439 DEBUG 8696 --- [ main] org.hibernate.SQL : insert into hibernate_sequence values ( 1 )2019-02-26 23:23:38.441 DEBUG 8696 --- [ main] org.hibernate.SQL : insert into hibernate_sequence values ( 1 )2019-02-26 23:23:38.442 DEBUG 8696 --- [ main] org.hibernate.SQL : alter table account_roles add constraint FKtp61eta5i06bug3w1qr6286uf foreign key (account_id) references account (id)2019-02-26 23:23:38.463 DEBUG 8696 --- [ main] org.hibernate.SQL : alter table event add constraint FKphlyw4y37tcvehs0e107b93cn foreign key (manager_id) references account (id)2019-02-26 23:23:38.489 INFO 8696 --- [ main] o.h.t.schema.internal.SchemaCreatorImpl : HHH000476: Executing import script 'org.hibernate.tool.schema.internal.exec.ScriptSourceInputNonExistentImpl@25765a49'2019-02-26 23:23:38.491 INFO 8696 --- [ main] j.LocalContainerEntityManagerFactoryBean : Initialized JPA EntityManagerFactory for persistence unit 'default'2019-02-26 23:23:39.205 WARN 8696 --- [ main] aWebConfiguration$JpaWebMvcConfiguration : spring.jpa.open-in-view is enabled by default. Therefore, database queries may be performed during view rendering. Explicitly configure spring.jpa.open-in-view to disable this warning2019-02-26 23:23:39.338 DEBUG 8696 --- [ main] edFilterInvocationSecurityMetadataSource : Adding web access control expression 'anonymous', for Mvc [pattern='/docs/index.html']2019-02-26 23:23:39.339 DEBUG 8696 --- [ main] edFilterInvocationSecurityMetadataSource : Adding web access control expression 'anonymous', for org.springframework.boot.autoconfigure.security.servlet.StaticResourceRequest$StaticResourceRequestMatcher@4113d9ab2019-02-26 23:23:39.344 DEBUG 8696 --- [ main] o.s.s.w.a.i.FilterSecurityInterceptor : Validated configuration attributes2019-02-26 23:23:39.345 DEBUG 8696 --- [ main] o.s.s.w.a.i.FilterSecurityInterceptor : Validated configuration attributes2019-02-26 23:23:39.348 INFO 8696 --- [ main] o.s.s.web.DefaultSecurityFilterChain : Creating filter chain: any request, [org.springframework.security.web.context.request.async.WebAsyncManagerIntegrationFilter@347f8029, org.springframework.security.web.context.SecurityContextPersistenceFilter@4ed19540, org.springframework.security.web.header.HeaderWriterFilter@73230721, org.springframework.security.web.csrf.CsrfFilter@4e210016, org.springframework.security.web.authentication.logout.LogoutFilter@7d7f966f, org.springframework.security.web.savedrequest.RequestCacheAwareFilter@322eb1a, org.springframework.security.web.servletapi.SecurityContextHolderAwareRequestFilter@cce92b5, org.springframework.security.web.authentication.AnonymousAuthenticationFilter@3f78a5ed, org.springframework.security.web.session.SessionManagementFilter@62264d4f, org.springframework.security.web.access.ExceptionTranslationFilter@4abfa2ff, org.springframework.security.web.access.intercept.FilterSecurityInterceptor@384f0e32]2019-02-26 23:23:39.606 INFO 8696 --- [ main] o.s.s.concurrent.ThreadPoolTaskExecutor : Initializing ExecutorService 'applicationTaskExecutor'2019-02-26 23:23:40.510 INFO 8696 --- [ main] o.s.b.w.embedded.tomcat.TomcatWebServer : Tomcat started on port(s): 8080 (http) with context path ''2019-02-26 23:23:40.513 INFO 8696 --- [ main] n.s.demoinfleanrestapi.DemoApplication : Started DemoApplication in 9.558 seconds (JVM running for 10.686)2019-02-26 23:23:40.661 INFO 8696 --- [nio-8080-exec-1] o.a.c.c.C.[Tomcat].[localhost].[/] : Initializing Spring DispatcherServlet 'dispatcherServlet'2019-02-26 23:23:40.661 INFO 8696 --- [nio-8080-exec-1] o.s.web.servlet.DispatcherServlet : Initializing Servlet 'dispatcherServlet'2019-02-26 23:23:40.671 INFO 8696 --- [nio-8080-exec-1] o.s.web.servlet.DispatcherServlet : Completed initialization in 10 ms2019-02-26 23:23:40.682 DEBUG 8696 --- [nio-8080-exec-1] o.s.security.web.FilterChainProxy : /docs/index.html at position 1 of 11 in additional filter chain; firing Filter: 'WebAsyncManagerIntegrationFilter'2019-02-26 23:23:40.684 DEBUG 8696 --- [nio-8080-exec-1] o.s.security.web.FilterChainProxy : /docs/index.html at position 2 of 11 in additional filter chain; firing Filter: 'SecurityContextPersistenceFilter'2019-02-26 23:23:40.684 DEBUG 8696 --- [nio-8080-exec-1] w.c.HttpSessionSecurityContextRepository : No HttpSession currently exists2019-02-26 23:23:40.684 DEBUG 8696 --- [nio-8080-exec-1] w.c.HttpSessionSecurityContextRepository : No SecurityContext was available from the HttpSession: null. A new one will be created.2019-02-26 23:23:40.686 DEBUG 8696 --- [nio-8080-exec-1] o.s.security.web.FilterChainProxy : /docs/index.html at position 3 of 11 in additional filter chain; firing Filter: 'HeaderWriterFilter'2019-02-26 23:23:40.687 DEBUG 8696 --- [nio-8080-exec-1] o.s.security.web.FilterChainProxy : /docs/index.html at position 4 of 11 in additional filter chain; firing Filter: 'CsrfFilter'2019-02-26 23:23:40.688 DEBUG 8696 --- [nio-8080-exec-1] o.s.security.web.FilterChainProxy : /docs/index.html at position 5 of 11 in additional filter chain; firing Filter: 'LogoutFilter'2019-02-26 23:23:40.689 DEBUG 8696 --- [nio-8080-exec-1] o.s.s.w.u.matcher.AntPathRequestMatcher : Request 'GET /docs/index.html' doesn't match 'POST /logout'2019-02-26 23:23:40.689 DEBUG 8696 --- [nio-8080-exec-1] o.s.security.web.FilterChainProxy : /docs/index.html at position 6 of 11 in additional filter chain; firing Filter: 'RequestCacheAwareFilter'2019-02-26 23:23:40.689 DEBUG 8696 --- [nio-8080-exec-1] o.s.s.w.s.HttpSessionRequestCache : saved request doesn't match2019-02-26 23:23:40.689 DEBUG 8696 --- [nio-8080-exec-1] o.s.security.web.FilterChainProxy : /docs/index.html at position 7 of 11 in additional filter chain; firing Filter: 'SecurityContextHolderAwareRequestFilter'2019-02-26 23:23:40.690 DEBUG 8696 --- [nio-8080-exec-1] o.s.security.web.FilterChainProxy : /docs/index.html at position 8 of 11 in additional filter chain; firing Filter: 'AnonymousAuthenticationFilter'2019-02-26 23:23:40.692 DEBUG 8696 --- [nio-8080-exec-1] o.s.s.w.a.AnonymousAuthenticationFilter : Populated SecurityContextHolder with anonymous token: 'org.springframework.security.authentication.AnonymousAuthenticationToken@6332191e: Principal: anonymousUser; Credentials: [PROTECTED]; Authenticated: true; Details: org.springframework.security.web.authentication.WebAuthenticationDetails@957e: RemoteIpAddress: 127.0.0.1; SessionId: null; Granted Authorities: ROLE_ANONYMOUS'2019-02-26 23:23:40.692 DEBUG 8696 --- [nio-8080-exec-1] o.s.security.web.FilterChainProxy : /docs/index.html at position 9 of 11 in additional filter chain; firing Filter: 'SessionManagementFilter'2019-02-26 23:23:40.692 DEBUG 8696 --- [nio-8080-exec-1] o.s.s.w.session.SessionManagementFilter : Requested session ID FBA1E30ACC405B91BAD285151F88F495 is invalid.2019-02-26 23:23:40.692 DEBUG 8696 --- [nio-8080-exec-1] o.s.security.web.FilterChainProxy : /docs/index.html at position 10 of 11 in additional filter chain; firing Filter: 'ExceptionTranslationFilter'2019-02-26 23:23:40.692 DEBUG 8696 --- [nio-8080-exec-1] o.s.security.web.FilterChainProxy : /docs/index.html at position 11 of 11 in additional filter chain; firing Filter: 'FilterSecurityInterceptor'2019-02-26 23:23:40.702 DEBUG 8696 --- [nio-8080-exec-1] o.s.s.w.a.i.FilterSecurityInterceptor : Secure object: FilterInvocation: URL: /docs/index.html; Attributes: [anonymous]2019-02-26 23:23:40.703 DEBUG 8696 --- [nio-8080-exec-1] o.s.s.w.a.i.FilterSecurityInterceptor : Previously Authenticated: org.springframework.security.authentication.AnonymousAuthenticationToken@6332191e: Principal: anonymousUser; Credentials: [PROTECTED]; Authenticated: true; Details: org.springframework.security.web.authentication.WebAuthenticationDetails@957e: RemoteIpAddress: 127.0.0.1; SessionId: null; Granted Authorities: ROLE_ANONYMOUS2019-02-26 23:23:40.709 DEBUG 8696 --- [nio-8080-exec-1] o.s.s.access.vote.AffirmativeBased : Voter: org.springframework.security.web.access.expression.WebExpressionVoter@2bccb588, returned: 12019-02-26 23:23:40.709 DEBUG 8696 --- [nio-8080-exec-1] o.s.s.w.a.i.FilterSecurityInterceptor : Authorization successful2019-02-26 23:23:40.709 DEBUG 8696 --- [nio-8080-exec-1] o.s.s.w.a.i.FilterSecurityInterceptor : RunAsManager did not change Authentication object2019-02-26 23:23:40.709 DEBUG 8696 --- [nio-8080-exec-1] o.s.security.web.FilterChainProxy : /docs/index.html reached end of additional filter chain; proceeding with original chain2019-02-26 23:23:40.725 DEBUG 8696 --- [nio-8080-exec-1] o.s.s.w.header.writers.HstsHeaderWriter : Not injecting HSTS header since it did not match the requestMatcher org.springframework.security.web.header.writers.HstsHeaderWriter$SecureRequestMatcher@151c286f2019-02-26 23:23:40.725 DEBUG 8696 --- [nio-8080-exec-1] w.c.HttpSessionSecurityContextRepository : SecurityContext is empty or contents are anonymous - context will not be stored in HttpSession.2019-02-26 23:23:40.726 DEBUG 8696 --- [nio-8080-exec-1] o.s.s.w.a.ExceptionTranslationFilter : Chain processed normally2019-02-26 23:23:40.727 DEBUG 8696 --- [nio-8080-exec-1] s.s.w.c.SecurityContextPersistenceFilter : SecurityContextHolder now cleared, as request processing completed2019-02-26 23:23:40.730 DEBUG 8696 --- [nio-8080-exec-1] o.s.security.web.FilterChainProxy : /error at position 1 of 11 in additional filter chain; firing Filter: 'WebAsyncManagerIntegrationFilter'2019-02-26 23:23:40.730 DEBUG 8696 --- [nio-8080-exec-1] o.s.security.web.FilterChainProxy : /error at position 2 of 11 in additional filter chain; firing Filter: 'SecurityContextPersistenceFilter'2019-02-26 23:23:40.730 DEBUG 8696 --- [nio-8080-exec-1] w.c.HttpSessionSecurityContextRepository : No HttpSession currently exists2019-02-26 23:23:40.730 DEBUG 8696 --- [nio-8080-exec-1] w.c.HttpSessionSecurityContextRepository : No SecurityContext was available from the HttpSession: null. A new one will be created.2019-02-26 23:23:40.730 DEBUG 8696 --- [nio-8080-exec-1] o.s.security.web.FilterChainProxy : /error at position 3 of 11 in additional filter chain; firing Filter: 'HeaderWriterFilter'2019-02-26 23:23:40.730 DEBUG 8696 --- [nio-8080-exec-1] o.s.security.web.FilterChainProxy : /error at position 4 of 11 in additional filter chain; firing Filter: 'CsrfFilter'2019-02-26 23:23:40.730 DEBUG 8696 --- [nio-8080-exec-1] o.s.security.web.FilterChainProxy : /error at position 5 of 11 in additional filter chain; firing Filter: 'LogoutFilter'2019-02-26 23:23:40.730 DEBUG 8696 --- [nio-8080-exec-1] o.s.s.w.u.matcher.AntPathRequestMatcher : Request 'GET /error' doesn't match 'POST /logout'2019-02-26 23:23:40.730 DEBUG 8696 --- [nio-8080-exec-1] o.s.security.web.FilterChainProxy : /error at position 6 of 11 in additional filter chain; firing Filter: 'RequestCacheAwareFilter'2019-02-26 23:23:40.730 DEBUG 8696 --- [nio-8080-exec-1] o.s.s.w.s.HttpSessionRequestCache : saved request doesn't match2019-02-26 23:23:40.730 DEBUG 8696 --- [nio-8080-exec-1] o.s.security.web.FilterChainProxy : /error at position 7 of 11 in additional filter chain; firing Filter: 'SecurityContextHolderAwareRequestFilter'2019-02-26 23:23:40.730 DEBUG 8696 --- [nio-8080-exec-1] o.s.security.web.FilterChainProxy : /error at position 8 of 11 in additional filter chain; firing Filter: 'AnonymousAuthenticationFilter'2019-02-26 23:23:40.730 DEBUG 8696 --- [nio-8080-exec-1] o.s.s.w.a.AnonymousAuthenticationFilter : Populated SecurityContextHolder with anonymous token: 'org.springframework.security.authentication.AnonymousAuthenticationToken@6332191e: Principal: anonymousUser; Credentials: [PROTECTED]; Authenticated: true; Details: org.springframework.security.web.authentication.WebAuthenticationDetails@957e: RemoteIpAddress: 127.0.0.1; SessionId: null; Granted Authorities: ROLE_ANONYMOUS'2019-02-26 23:23:40.730 DEBUG 8696 --- [nio-8080-exec-1] o.s.security.web.FilterChainProxy : /error at position 9 of 11 in additional filter chain; firing Filter: 'SessionManagementFilter'2019-02-26 23:23:40.730 DEBUG 8696 --- [nio-8080-exec-1] o.s.security.web.FilterChainProxy : /error at position 10 of 11 in additional filter chain; firing Filter: 'ExceptionTranslationFilter'2019-02-26 23:23:40.730 DEBUG 8696 --- [nio-8080-exec-1] o.s.security.web.FilterChainProxy : /error at position 11 of 11 in additional filter chain; firing Filter: 'FilterSecurityInterceptor'2019-02-26 23:23:40.731 DEBUG 8696 --- [nio-8080-exec-1] o.s.security.web.FilterChainProxy : /error reached end of additional filter chain; proceeding with original chain2019-02-26 23:23:40.763 DEBUG 8696 --- [nio-8080-exec-1] o.s.s.w.a.ExceptionTranslationFilter : Chain processed normally2019-02-26 23:23:40.763 DEBUG 8696 --- [nio-8080-exec-1] w.c.HttpSessionSecurityContextRepository : SecurityContext is empty or contents are anonymous - context will not be stored in HttpSession.2019-02-26 23:23:40.763 DEBUG 8696 --- [nio-8080-exec-1] s.s.w.c.SecurityContextPersistenceFilter : SecurityContextHolder now cleared, as request processing completed2019-02-26 23:23:48.532 DEBUG 8696 --- [nio-8080-exec-2] o.s.security.web.FilterChainProxy : /docs/index.html at position 1 of 11 in additional filter chain; firing Filter: 'WebAsyncManagerIntegrationFilter'2019-02-26 23:23:48.533 DEBUG 8696 --- [nio-8080-exec-2] o.s.security.web.FilterChainProxy : /docs/index.html at position 2 of 11 in additional filter chain; firing Filter: 'SecurityContextPersistenceFilter'2019-02-26 23:23:48.533 DEBUG 8696 --- [nio-8080-exec-2] w.c.HttpSessionSecurityContextRepository : No HttpSession currently exists2019-02-26 23:23:48.533 DEBUG 8696 --- [nio-8080-exec-2] w.c.HttpSessionSecurityContextRepository : No SecurityContext was available from the HttpSession: null. A new one will be created.2019-02-26 23:23:48.533 DEBUG 8696 --- [nio-8080-exec-2] o.s.security.web.FilterChainProxy : /docs/index.html at position 3 of 11 in additional filter chain; firing Filter: 'HeaderWriterFilter'2019-02-26 23:23:48.533 DEBUG 8696 --- [nio-8080-exec-2] o.s.security.web.FilterChainProxy : /docs/index.html at position 4 of 11 in additional filter chain; firing Filter: 'CsrfFilter'2019-02-26 23:23:48.533 DEBUG 8696 --- [nio-8080-exec-2] o.s.security.web.FilterChainProxy : /docs/index.html at position 5 of 11 in additional filter chain; firing Filter: 'LogoutFilter'2019-02-26 23:23:48.533 DEBUG 8696 --- [nio-8080-exec-2] o.s.s.w.u.matcher.AntPathRequestMatcher : Request 'GET /docs/index.html' doesn't match 'POST /logout'2019-02-26 23:23:48.533 DEBUG 8696 --- [nio-8080-exec-2] o.s.security.web.FilterChainProxy : /docs/index.html at position 6 of 11 in additional filter chain; firing Filter: 'RequestCacheAwareFilter'2019-02-26 23:23:48.533 DEBUG 8696 --- [nio-8080-exec-2] o.s.s.w.s.HttpSessionRequestCache : saved request doesn't match2019-02-26 23:23:48.533 DEBUG 8696 --- [nio-8080-exec-2] o.s.security.web.FilterChainProxy : /docs/index.html at position 7 of 11 in additional filter chain; firing Filter: 'SecurityContextHolderAwareRequestFilter'2019-02-26 23:23:48.533 DEBUG 8696 --- [nio-8080-exec-2] o.s.security.web.FilterChainProxy : /docs/index.html at position 8 of 11 in additional filter chain; firing Filter: 'AnonymousAuthenticationFilter'2019-02-26 23:23:48.534 DEBUG 8696 --- [nio-8080-exec-2] o.s.s.w.a.AnonymousAuthenticationFilter : Populated SecurityContextHolder with anonymous token: 'org.springframework.security.authentication.AnonymousAuthenticationToken@6332191e: Principal: anonymousUser; Credentials: [PROTECTED]; Authenticated: true; Details: org.springframework.security.web.authentication.WebAuthenticationDetails@957e: RemoteIpAddress: 127.0.0.1; SessionId: null; Granted Authorities: ROLE_ANONYMOUS'2019-02-26 23:23:48.534 DEBUG 8696 --- [nio-8080-exec-2] o.s.security.web.FilterChainProxy : /docs/index.html at position 9 of 11 in additional filter chain; firing Filter: 'SessionManagementFilter'2019-02-26 23:23:48.534 DEBUG 8696 --- [nio-8080-exec-2] o.s.s.w.session.SessionManagementFilter : Requested session ID FBA1E30ACC405B91BAD285151F88F495 is invalid.2019-02-26 23:23:48.534 DEBUG 8696 --- [nio-8080-exec-2] o.s.security.web.FilterChainProxy : /docs/index.html at position 10 of 11 in additional filter chain; firing Filter: 'ExceptionTranslationFilter'2019-02-26 23:23:48.534 DEBUG 8696 --- [nio-8080-exec-2] o.s.security.web.FilterChainProxy : /docs/index.html at position 11 of 11 in additional filter chain; firing Filter: 'FilterSecurityInterceptor'2019-02-26 23:23:48.536 DEBUG 8696 --- [nio-8080-exec-2] o.s.s.w.a.i.FilterSecurityInterceptor : Secure object: FilterInvocation: URL: /docs/index.html; Attributes: [anonymous]2019-02-26 23:23:48.536 DEBUG 8696 --- [nio-8080-exec-2] o.s.s.w.a.i.FilterSecurityInterceptor : Previously Authenticated: org.springframework.security.authentication.AnonymousAuthenticationToken@6332191e: Principal: anonymousUser; Credentials: [PROTECTED]; Authenticated: true; Details: org.springframework.security.web.authentication.WebAuthenticationDetails@957e: RemoteIpAddress: 127.0.0.1; SessionId: null; Granted Authorities: ROLE_ANONYMOUS2019-02-26 23:23:48.537 DEBUG 8696 --- [nio-8080-exec-2] o.s.s.access.vote.AffirmativeBased : Voter: org.springframework.security.web.access.expression.WebExpressionVoter@2bccb588, returned: 12019-02-26 23:23:48.537 DEBUG 8696 --- [nio-8080-exec-2] o.s.s.w.a.i.FilterSecurityInterceptor : Authorization successful2019-02-26 23:23:48.537 DEBUG 8696 --- [nio-8080-exec-2] o.s.s.w.a.i.FilterSecurityInterceptor : RunAsManager did not change Authentication object2019-02-26 23:23:48.537 DEBUG 8696 --- [nio-8080-exec-2] o.s.security.web.FilterChainProxy : /docs/index.html reached end of additional filter chain; proceeding with original chain2019-02-26 23:23:48.542 DEBUG 8696 --- [nio-8080-exec-2] o.s.s.w.header.writers.HstsHeaderWriter : Not injecting HSTS header since it did not match the requestMatcher org.springframework.security.web.header.writers.HstsHeaderWriter$SecureRequestMatcher@151c286f2019-02-26 23:23:48.543 DEBUG 8696 --- [nio-8080-exec-2] w.c.HttpSessionSecurityContextRepository : SecurityContext is empty or contents are anonymous - context will not be stored in HttpSession.2019-02-26 23:23:48.543 DEBUG 8696 --- [nio-8080-exec-2] o.s.s.w.a.ExceptionTranslationFilter : Chain processed normally2019-02-26 23:23:48.543 DEBUG 8696 --- [nio-8080-exec-2] s.s.w.c.SecurityContextPersistenceFilter : SecurityContextHolder now cleared, as request processing completed2019-02-26 23:23:48.543 DEBUG 8696 --- [nio-8080-exec-2] o.s.security.web.FilterChainProxy : /error at position 1 of 11 in additional filter chain; firing Filter: 'WebAsyncManagerIntegrationFilter'2019-02-26 23:23:48.543 DEBUG 8696 --- [nio-8080-exec-2] o.s.security.web.FilterChainProxy : /error at position 2 of 11 in additional filter chain; firing Filter: 'SecurityContextPersistenceFilter'2019-02-26 23:23:48.543 DEBUG 8696 --- [nio-8080-exec-2] w.c.HttpSessionSecurityContextRepository : No HttpSession currently exists2019-02-26 23:23:48.543 DEBUG 8696 --- [nio-8080-exec-2] w.c.HttpSessionSecurityContextRepository : No SecurityContext was available from the HttpSession: null. A new one will be created.2019-02-26 23:23:48.543 DEBUG 8696 --- [nio-8080-exec-2] o.s.security.web.FilterChainProxy : /error at position 3 of 11 in additional filter chain; firing Filter: 'HeaderWriterFilter'2019-02-26 23:23:48.544 DEBUG 8696 --- [nio-8080-exec-2] o.s.security.web.FilterChainProxy : /error at position 4 of 11 in additional filter chain; firing Filter: 'CsrfFilter'2019-02-26 23:23:48.544 DEBUG 8696 --- [nio-8080-exec-2] o.s.security.web.FilterChainProxy : /error at position 5 of 11 in additional filter chain; firing Filter: 'LogoutFilter'2019-02-26 23:23:48.544 DEBUG 8696 --- [nio-8080-exec-2] o.s.s.w.u.matcher.AntPathRequestMatcher : Request 'GET /error' doesn't match 'POST /logout'2019-02-26 23:23:48.544 DEBUG 8696 --- [nio-8080-exec-2] o.s.security.web.FilterChainProxy : /error at position 6 of 11 in additional filter chain; firing Filter: 'RequestCacheAwareFilter'2019-02-26 23:23:48.544 DEBUG 8696 --- [nio-8080-exec-2] o.s.s.w.s.HttpSessionRequestCache : saved request doesn't match2019-02-26 23:23:48.544 DEBUG 8696 --- [nio-8080-exec-2] o.s.security.web.FilterChainProxy : /error at position 7 of 11 in additional filter chain; firing Filter: 'SecurityContextHolderAwareRequestFilter'2019-02-26 23:23:48.544 DEBUG 8696 --- [nio-8080-exec-2] o.s.security.web.FilterChainProxy : /error at position 8 of 11 in additional filter chain; firing Filter: 'AnonymousAuthenticationFilter'2019-02-26 23:23:48.544 DEBUG 8696 --- [nio-8080-exec-2] o.s.s.w.a.AnonymousAuthenticationFilter : Populated SecurityContextHolder with anonymous token: 'org.springframework.security.authentication.AnonymousAuthenticationToken@6332191e: Principal: anonymousUser; Credentials: [PROTECTED]; Authenticated: true; Details: org.springframework.security.web.authentication.WebAuthenticationDetails@957e: RemoteIpAddress: 127.0.0.1; SessionId: null; Granted Authorities: ROLE_ANONYMOUS'2019-02-26 23:23:48.544 DEBUG 8696 --- [nio-8080-exec-2] o.s.security.web.FilterChainProxy : /error at position 9 of 11 in additional filter chain; firing Filter: 'SessionManagementFilter'2019-02-26 23:23:48.544 DEBUG 8696 --- [nio-8080-exec-2] o.s.security.web.FilterChainProxy : /error at position 10 of 11 in additional filter chain; firing Filter: 'ExceptionTranslationFilter'2019-02-26 23:23:48.544 DEBUG 8696 --- [nio-8080-exec-2] o.s.security.web.FilterChainProxy : /error at position 11 of 11 in additional filter chain; firing Filter: 'FilterSecurityInterceptor'2019-02-26 23:23:48.544 DEBUG 8696 --- [nio-8080-exec-2] o.s.security.web.FilterChainProxy : /error reached end of additional filter chain; proceeding with original chain2019-02-26 23:23:48.547 DEBUG 8696 --- [nio-8080-exec-2] o.s.s.w.a.ExceptionTranslationFilter : Chain processed normally2019-02-26 23:23:48.547 DEBUG 8696 --- [nio-8080-exec-2] w.c.HttpSessionSecurityContextRepository : SecurityContext is empty or contents are anonymous - context will not be stored in HttpSession.2019-02-26 23:23:48.547 DEBUG 8696 --- [nio-8080-exec-2] s.s.w.c.SecurityContextPersistenceFilter : SecurityContextHolder now cleared, as request processing completed
- 미해결스프링 기반 REST API 개발
Event newEvent = this.eventRepository.save(event)
이벤트 생성 API 개발 중 "이벤트 Repository"강의강의 내용 중 해당 코드가 있는데 혹시 어떤 의미인지 간략하게 알 수 있을까요?'''Event newEvent = this.eventRepository.save(event)'''
- 미해결스프링 기반 REST API 개발
안녕하세요~ 질문드립니다.
자바 초보인데 잘 듣고 있습니다 다름이 아니라 mvn package로 빌드 하려면 아래와 같은 에러가 발생하는데 왜그럴까요? Failed to execute goal org.asciidoctor:asciidoctor-maven-plugin:1.5.3:process-asciidoc (generate-docs) on project rest-api-with-spring: Error copying resources: Source '[project root]/src/main/asciidoc' does not exist -> [Help 1]해결책으로 위의 메세지대로 main/asciidoc 을 생성 해 주었는데, 강사님과 다른 현상이라 질문드립니다.
- 미해결스프링 기반 REST API 개발
MockMvc를 활용하는 테스트에서 403 에러가 발생하는 문제
안녕하세요 기선님,강의를 따라하다가 잘 되지 않는 부분이 있어서 질문 남깁니다.강의 내용과 정말 똑같이 따라치고 있는데--github의 코드와도 대조해보았습니다--이상하게 mockMvc를 통해 테스트를 하는 부분 전체에서 결과값이 403으로 떨어지네요.구글링 해보니 @WebMvcTest를 사용하는 경우 webapplicationcontext를 가져오도록 하라는 가이드만 나오고, @AutoConfigureMockMvc를 사용하는 경우는 사례를 찾기가 좀 어렵습니다.제가 어떤 부분을 좀 살펴보아야 할 지 도움을 주실 수 있을까요?에러 메시지는 다음과 같습니다.MockHttpServletRequest: HTTP Method = POST Request URI = /api/events/ Parameters = {} Headers = [Content-Type:"application/json;charset=UTF-8", Accept:"application/hal+json"] Body = {"id":100,"name":"Spring","description":"REST API Development with Spring","beginEnrollmentDateTime":"2018-11-23T14:21:00","closeEnrollmentDateTime":"2018-11-24T14:21:00","beginEventDateTime":"2018-11-25T14:21:00","endEventDateTime":"2018-11-26T14:21:00","location":"강남역 D2 스타텁 팩토리","basePrice":100,"maxPrice":200,"limitOfEnrollment":100,"offline":false,"free":true,"eventStatus":"PUBLISHED"} Session Attrs = {org.springframework.security.web.csrf.HttpSessionCsrfTokenRepository.CSRF_TOKEN=org.springframework.security.web.csrf.DefaultCsrfToken@553d828a}Handler: Type = nullAsync: Async started = false Async result = nullResolved Exception: Type = nullModelAndView: View name = null View = null Model = nullFlashMap: Attributes = nullMockHttpServletResponse: Status = 403 Error message = Forbidden Headers = [X-Content-Type-Options:"nosniff", X-XSS-Protection:"1; mode=block", Cache-Control:"no-cache, no-store, max-age=0, must-revalidate", Pragma:"no-cache", Expires:"0", X-Frame-Options:"DENY"] Content type = null Body = Forwarded URL = null Redirected URL = null Cookies = []MockHttpServletRequest: HTTP Method = POST Request URI = /api/events/ Parameters = {} Headers = [Content-Type:"application/json;charset=UTF-8", Accept:"application/hal+json"] Body = {"id":100,"name":"Spring","description":"REST API Development with Spring","beginEnrollmentDateTime":"2018-11-23T14:21:00","closeEnrollmentDateTime":"2018-11-24T14:21:00","beginEventDateTime":"2018-11-25T14:21:00","endEventDateTime":"2018-11-26T14:21:00","location":"강남역 D2 스타텁 팩토리","basePrice":100,"maxPrice":200,"limitOfEnrollment":100,"offline":false,"free":true,"eventStatus":"PUBLISHED"} Session Attrs = {org.springframework.security.web.csrf.HttpSessionCsrfTokenRepository.CSRF_TOKEN=org.springframework.security.web.csrf.DefaultCsrfToken@553d828a}Handler: Type = nullAsync: Async started = false Async result = nullResolved Exception: Type = nullModelAndView: View name = null View = null Model = nullFlashMap: Attributes = nullMockHttpServletResponse: Status = 403 Error message = Forbidden Headers = [X-Content-Type-Options:"nosniff", X-XSS-Protection:"1; mode=block", Cache-Control:"no-cache, no-store, max-age=0, must-revalidate", Pragma:"no-cache", Expires:"0", X-Frame-Options:"DENY"] Content type = null Body = Forwarded URL = null Redirected URL = null Cookies = []java.lang.AssertionError: Status Expected :400Actual :403 <Click to see difference> at org.springframework.test.util.AssertionErrors.fail(AssertionErrors.java:55) at org.springframework.test.util.AssertionErrors.assertEquals(AssertionErrors.java:82) at org.springframework.test.web.servlet.result.StatusResultMatchers.lambda$matcher$9(StatusResultMatchers.java:619) at org.springframework.test.web.servlet.MockMvc$1.andExpect(MockMvc.java:195) at com.rest.api.events.EventControllerTests.createEvent_Bad_Request(EventControllerTests.java:151) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.base/java.lang.reflect.Method.invoke(Method.java:566) at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50) at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12) at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47) at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17) at org.springframework.test.context.junit4.statements.RunBeforeTestExecutionCallbacks.evaluate(RunBeforeTestExecutionCallbacks.java:74) at org.springframework.test.context.junit4.statements.RunAfterTestExecutionCallbacks.evaluate(RunAfterTestExecutionCallbacks.java:84) at org.springframework.test.context.junit4.statements.RunBeforeTestMethodCallbacks.evaluate(RunBeforeTestMethodCallbacks.java:75) at org.springframework.test.context.junit4.statements.RunAfterTestMethodCallbacks.evaluate(RunAfterTestMethodCallbacks.java:86) at org.springframework.test.context.junit4.statements.SpringRepeat.evaluate(SpringRepeat.java:84) at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325) at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.runChild(SpringJUnit4ClassRunner.java:251) at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.runChild(SpringJUnit4ClassRunner.java:97) at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290) at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71) at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288) at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58) at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268) at org.springframework.test.context.junit4.statements.RunBeforeTestClassCallbacks.evaluate(RunBeforeTestClassCallbacks.java:61) at org.springframework.test.context.junit4.statements.RunAfterTestClassCallbacks.evaluate(RunAfterTestClassCallbacks.java:70) at org.junit.runners.ParentRunner.run(ParentRunner.java:363) at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.run(SpringJUnit4ClassRunner.java:190) at org.junit.runner.JUnitCore.run(JUnitCore.java:137) at com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:68) at com.intellij.rt.execution.junit.IdeaTestRunner$Repeater.startRunnerWithArgs(IdeaTestRunner.java:47) at com.intellij.rt.execution.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:242) at com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:70)
- 미해결스프링 기반 REST API 개발
@Configuration 애노테이션
안녕하세요.@Configuration 애노테이션이 어떻게 동작되는지 헷갈리는 부분이 생겨 문의드립니다.'스프링 부트 개념과 활용' 강좌의 '자동 설정 만들기 1부: Starter와 AutoConfigure'에서 예제를 통해 @EnableAutoConfigure를 설명해주셨습니다.그 때는 HolomanConfiguration.java에 @Configuration 애노테이션을 넣은 후, spring.factories 파일을 생성하였습니다. 그 결과 @EnableAutoConfigure로 Holoman 빈이 등록되게 하였습니다.그런데, 이번 강좌에서는 AppConfig.java에 @Configuration 사용 시에, spring.factories를 사용하시지 않더라고요. 그래서 @Configuration 애노테이션의 부모를 보니, 또 @Component가 있더라고요. 이 것은 @ComponentScan으로 빈으로 등록되면서, 그 필드에 있는 ModelMapper, PasswordEncoder 등등이 빈으로 등록되는건가요?
- 미해결스프링 기반 REST API 개발
본 강의에서 참조하신 index.adoc 의 영어 원본 샘플 있는 URL 을 알고 싶습니다
/asciidoc/index.adoc 의 참조하신 영어 원문이 있는 곳을 알았으면 좋겠습니다. 영어로 index.adoc 을 생성할 때, 도움이 될 것 같습니다.
- 미해결스프링 기반 REST API 개발
컨트롤러에서 linkTo 가 뭐하는건가요 ..?
무슨 메서드인지 모르겠어요. 다른 클래스를줘도 테스트가 잘돼서 ,, ㅠㅠ
- 미해결스프링 기반 REST API 개발
Spring OAuth2 인증서버 TokenStore 관련 문의
1,인증서버 설정시 TokenStore를 In Memory 방식을 사용하는것은 권장되지 않는다고 하는데 이유가 1)인증서버와 리소스서버를 분리할 경우 인증 토큰이 공유 되지 않는 이슈 2)서버 재시작시 인증토큰이 모두 초기회 되여 클라이언트가 다시 인증을 받아야 하는 이슈 이외에 다른 이슈가 있는지 궁금합니다. 서비스 규모가 크지 않아서 인증서버와 리소스서버를 분리하지 않고 서비스 재시작시 토큰은 만료 시키고 재인증을 요구하는 해야 하는 상황이면 JDBC 로 DB에 저장시 OAuth2 인증을 관리 하기 위하여 사용하는 테이블이 6개정도 생성해야 하는것으로 기억하는데 오히려 인메모리가 유리하지 않을까요? 그리고 인중토큰은 Rdsis에서 관리하는 방법은 없는지요? 2.TokenStore를 JWT Tokenstore로 사용하려고 하는데 Spring 공식 문서는 OAuth2 에 관련된 레퍼런스가 많지 않고 OAuth2 라이브러리도 여러 프로젝트에서 별도로 관리되고 있어서 여러 싸이트의 문서를 보았는데 Spring Secury 에 대한 이야기 부족해서인지 연동이 잘되지 않고 있습니다. Spring Security 강좌를 진행하실 계획이 있으신지요? 있다면 언제쯤 등록 되나요?