diff --git a/.gitignore b/.gitignore index f98b419fc..ddff07278 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,2 @@ -.idea/ +**.idea/ /starter_code/target/ diff --git a/logs/myapp.log b/logs/myapp.log index b9dc355eb..7196afdce 100644 --- a/logs/myapp.log +++ b/logs/myapp.log @@ -1,195 +1,100 @@ -00:09:02.740 [main] INFO com.example.demo.SareetaApplication - Starting SareetaApplication on Duc-Than-Trong.local with PID 44418 (/Users/mac/Documents/workspace/nd035-c4-Security-and-DevOps/starter_code/target/classes started by mac in /Users/mac/Documents/workspace/nd035-c4-Security-and-DevOps) -00:09:02.743 [main] INFO com.example.demo.SareetaApplication - No active profile set, falling back to default profiles: default -00:09:03.376 [main] INFO o.s.d.r.c.RepositoryConfigurationDelegate - Bootstrapping Spring Data repositories in DEFAULT mode. -00:09:03.461 [main] INFO o.s.d.r.c.RepositoryConfigurationDelegate - Finished Spring Data repository scanning in 75ms. Found 4 repository interfaces. -00:09:04.052 [main] INFO o.s.c.s.PostProcessorRegistrationDelegate$BeanPostProcessorChecker - Bean 'org.springframework.transaction.annotation.ProxyTransactionManagementConfiguration' of type [org.springframework.transaction.annotation.ProxyTransactionManagementConfiguration$$EnhancerBySpringCGLIB$$2ee56919] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying) -00:09:04.380 [main] INFO o.s.b.w.e.tomcat.TomcatWebServer - Tomcat initialized with port(s): 8080 (http) -00:09:04.397 [main] INFO o.a.coyote.http11.Http11NioProtocol - Initializing ProtocolHandler ["http-nio-8080"] -00:09:04.410 [main] INFO o.a.catalina.core.StandardService - Starting service [Tomcat] -00:09:04.411 [main] INFO o.a.catalina.core.StandardEngine - Starting Servlet engine: [Apache Tomcat/9.0.19] -00:09:04.511 [main] INFO o.a.c.c.C.[Tomcat].[localhost].[/] - Initializing Spring embedded WebApplicationContext -00:09:04.511 [main] INFO o.s.web.context.ContextLoader - Root WebApplicationContext: initialization completed in 1716 ms -00:09:04.712 [main] INFO com.zaxxer.hikari.HikariDataSource - HikariPool-1 - Starting... -00:09:04.884 [main] INFO com.zaxxer.hikari.HikariDataSource - HikariPool-1 - Start completed. -00:09:04.957 [main] INFO o.h.jpa.internal.util.LogHelper - HHH000204: Processing PersistenceUnitInfo [ +00:37:48.766 [main] INFO com.example.demo.SareetaApplication - Starting SareetaApplication on Duc-Than-Trong.local with PID 83541 (/Users/mac/Documents/Project4/nd035-c4-Security-and-DevOps/starter_code/target/classes started by mac in /Users/mac/Documents/Project4/nd035-c4-Security-and-DevOps) +00:37:48.769 [main] INFO com.example.demo.SareetaApplication - No active profile set, falling back to default profiles: default +00:37:49.303 [main] INFO o.s.d.r.c.RepositoryConfigurationDelegate - Bootstrapping Spring Data repositories in DEFAULT mode. +00:37:49.394 [main] INFO o.s.d.r.c.RepositoryConfigurationDelegate - Finished Spring Data repository scanning in 83ms. Found 4 repository interfaces. +00:37:49.874 [main] INFO o.s.c.s.PostProcessorRegistrationDelegate$BeanPostProcessorChecker - Bean 'org.springframework.transaction.annotation.ProxyTransactionManagementConfiguration' of type [org.springframework.transaction.annotation.ProxyTransactionManagementConfiguration$$EnhancerBySpringCGLIB$$4539212d] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying) +00:37:50.142 [main] INFO o.s.b.w.e.tomcat.TomcatWebServer - Tomcat initialized with port(s): 8080 (http) +00:37:50.157 [main] INFO o.a.coyote.http11.Http11NioProtocol - Initializing ProtocolHandler ["http-nio-8080"] +00:37:50.170 [main] INFO o.a.catalina.core.StandardService - Starting service [Tomcat] +00:37:50.170 [main] INFO o.a.catalina.core.StandardEngine - Starting Servlet engine: [Apache Tomcat/9.0.19] +00:37:50.268 [main] INFO o.a.c.c.C.[Tomcat].[localhost].[/] - Initializing Spring embedded WebApplicationContext +00:37:50.268 [main] INFO o.s.web.context.ContextLoader - Root WebApplicationContext: initialization completed in 1419 ms +00:37:50.450 [main] INFO com.zaxxer.hikari.HikariDataSource - HikariPool-1 - Starting... +00:37:50.616 [main] INFO com.zaxxer.hikari.HikariDataSource - HikariPool-1 - Start completed. +00:37:50.711 [main] INFO o.h.jpa.internal.util.LogHelper - HHH000204: Processing PersistenceUnitInfo [ name: default ...] -00:09:05.034 [main] INFO org.hibernate.Version - HHH000412: Hibernate Core {5.3.10.Final} -00:09:05.036 [main] INFO org.hibernate.cfg.Environment - HHH000206: hibernate.properties not found -00:09:05.207 [main] INFO o.h.annotations.common.Version - HCANN000001: Hibernate Commons Annotations {5.0.4.Final} -00:09:05.363 [main] INFO org.hibernate.dialect.Dialect - HHH000400: Using dialect: org.hibernate.dialect.H2Dialect -00:09:06.183 [main] INFO o.s.o.j.LocalContainerEntityManagerFactoryBean - Initialized JPA EntityManagerFactory for persistence unit 'default' -00:09:06.768 [main] WARN o.s.b.a.o.j.JpaBaseConfiguration$JpaWebConfiguration$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 warning -00:09:06.836 [main] INFO o.s.s.web.DefaultSecurityFilterChain - Creating filter chain: any request, [org.springframework.security.web.context.request.async.WebAsyncManagerIntegrationFilter@1820f274, org.springframework.security.web.context.SecurityContextPersistenceFilter@14624acc, org.springframework.security.web.header.HeaderWriterFilter@3e5b2630, org.springframework.web.filter.CorsFilter@221cdd87, org.springframework.security.web.authentication.logout.LogoutFilter@165454f7, com.example.demo.security.JWTAuthenticationFilter@4d66cb, com.example.demo.security.JWTAuthenticationVerficationFilter@7c79f2cf, org.springframework.security.web.savedrequest.RequestCacheAwareFilter@f453129, org.springframework.security.web.servletapi.SecurityContextHolderAwareRequestFilter@2c8f65da, org.springframework.security.web.authentication.AnonymousAuthenticationFilter@63551c66, org.springframework.security.web.session.SessionManagementFilter@75ac326f, org.springframework.security.web.access.ExceptionTranslationFilter@49741274, org.springframework.security.web.access.intercept.FilterSecurityInterceptor@276aa33f] -00:09:06.942 [main] INFO o.s.s.c.ThreadPoolTaskExecutor - Initializing ExecutorService 'applicationTaskExecutor' -00:09:07.127 [main] INFO o.a.coyote.http11.Http11NioProtocol - Starting ProtocolHandler ["http-nio-8080"] -00:09:07.174 [main] INFO o.s.b.w.e.tomcat.TomcatWebServer - Tomcat started on port(s): 8080 (http) with context path '' -00:09:07.177 [main] INFO com.example.demo.SareetaApplication - Started SareetaApplication in 4.972 seconds (JVM running for 5.507) -00:09:18.249 [http-nio-8080-exec-1] INFO o.a.c.c.C.[Tomcat].[localhost].[/] - Initializing Spring DispatcherServlet 'dispatcherServlet' -00:09:18.249 [http-nio-8080-exec-1] INFO o.s.web.servlet.DispatcherServlet - Initializing Servlet 'dispatcherServlet' -00:09:18.264 [http-nio-8080-exec-1] INFO o.s.web.servlet.DispatcherServlet - Completed initialization in 15 ms -00:09:18.523 [http-nio-8080-exec-1] INFO c.e.demo.controllers.UserController - Create user name is : ductt18 success -00:09:49.062 [http-nio-8080-exec-3] INFO c.e.d.s.JWTAuthenticationVerficationFilter - Login success -00:09:49.064 [http-nio-8080-exec-3] INFO c.e.d.s.JWTAuthenticationVerficationFilter - Login success -00:09:49.083 [http-nio-8080-exec-3] INFO o.h.h.i.QueryTranslatorFactoryInitiator - HHH000397: Using ASTQueryTranslatorFactory -00:09:49.169 [http-nio-8080-exec-3] ERROR o.a.c.c.C.[.[.[.[dispatcherServlet] - Servlet.service() for servlet [dispatcherServlet] in context with path [] threw exception [Request processing failed; nested exception is java.lang.NullPointerException: Cannot invoke "com.example.demo.model.persistence.User.getUsername()" because "user" is null] with root cause -java.lang.NullPointerException: Cannot invoke "com.example.demo.model.persistence.User.getUsername()" because "user" is null - at com.example.demo.controllers.OrderController.submit(OrderController.java:38) - at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:104) - at java.base/java.lang.reflect.Method.invoke(Method.java:578) - at org.springframework.web.method.support.InvocableHandlerMethod.doInvoke(InvocableHandlerMethod.java:190) - at org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:138) - at org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:104) - at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandlerMethod(RequestMappingHandlerAdapter.java:892) - at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:797) - at org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:87) - at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:1039) - at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:942) - at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:1005) - at org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:908) - at javax.servlet.http.HttpServlet.service(HttpServlet.java:660) - at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:882) - at javax.servlet.http.HttpServlet.service(HttpServlet.java:741) - at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:231) - at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) - at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:53) - at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) - at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) - at com.example.demo.security.JWTAuthenticationVerficationFilter.doFilterInternal(JWTAuthenticationVerficationFilter.java:45) - at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107) - at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) - at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) - at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:320) - at org.springframework.security.web.access.intercept.FilterSecurityInterceptor.invoke(FilterSecurityInterceptor.java:127) - at org.springframework.security.web.access.intercept.FilterSecurityInterceptor.doFilter(FilterSecurityInterceptor.java:91) - at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:334) - at org.springframework.security.web.access.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:119) - at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:334) - at org.springframework.security.web.session.SessionManagementFilter.doFilter(SessionManagementFilter.java:137) - at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:334) - at org.springframework.security.web.authentication.AnonymousAuthenticationFilter.doFilter(AnonymousAuthenticationFilter.java:111) - at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:334) - at org.springframework.security.web.servletapi.SecurityContextHolderAwareRequestFilter.doFilter(SecurityContextHolderAwareRequestFilter.java:170) - at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:334) - at org.springframework.security.web.savedrequest.RequestCacheAwareFilter.doFilter(RequestCacheAwareFilter.java:63) - at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:334) - at com.example.demo.security.JWTAuthenticationVerficationFilter.doFilterInternal(JWTAuthenticationVerficationFilter.java:45) - at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107) - at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:334) - at org.springframework.security.web.authentication.AbstractAuthenticationProcessingFilter.doFilter(AbstractAuthenticationProcessingFilter.java:200) - at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:334) - at org.springframework.security.web.authentication.logout.LogoutFilter.doFilter(LogoutFilter.java:116) - at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:334) - at org.springframework.web.filter.CorsFilter.doFilterInternal(CorsFilter.java:96) - at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107) - at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:334) - at org.springframework.security.web.header.HeaderWriterFilter.doFilterInternal(HeaderWriterFilter.java:74) - at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107) - at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:334) - at org.springframework.security.web.context.SecurityContextPersistenceFilter.doFilter(SecurityContextPersistenceFilter.java:105) - at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:334) - at org.springframework.security.web.context.request.async.WebAsyncManagerIntegrationFilter.doFilterInternal(WebAsyncManagerIntegrationFilter.java:56) - at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107) - at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:334) - at org.springframework.security.web.FilterChainProxy.doFilterInternal(FilterChainProxy.java:215) - at org.springframework.security.web.FilterChainProxy.doFilter(FilterChainProxy.java:178) - at org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:357) - at org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:270) - at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) - at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) - at org.springframework.web.filter.RequestContextFilter.doFilterInternal(RequestContextFilter.java:99) - at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107) - at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) - at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) - at org.springframework.web.filter.FormContentFilter.doFilterInternal(FormContentFilter.java:92) - at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107) - at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) - at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) - at org.springframework.web.filter.HiddenHttpMethodFilter.doFilterInternal(HiddenHttpMethodFilter.java:93) - at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107) - at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) - at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) - at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:200) - at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107) - at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) - at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) - at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:200) - at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:96) - at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:490) - at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:139) - at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:92) - at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:74) - at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:343) - at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:408) - at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66) - at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:836) - at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1747) - at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49) - at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1144) - at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:642) - at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) - at java.base/java.lang.Thread.run(Thread.java:1623) -00:15:13.493 [http-nio-8080-exec-10] INFO c.e.d.s.JWTAuthenticationVerficationFilter - Login success -00:15:13.494 [http-nio-8080-exec-10] INFO c.e.d.s.JWTAuthenticationVerficationFilter - Login success -00:15:13.515 [http-nio-8080-exec-10] INFO c.e.demo.controllers.OrderController - Order request of ductt18 success -00:28:20.117 [Thread-3] INFO o.s.s.c.ThreadPoolTaskExecutor - Shutting down ExecutorService 'applicationTaskExecutor' -00:28:20.119 [Thread-3] INFO o.s.o.j.LocalContainerEntityManagerFactoryBean - Closing JPA EntityManagerFactory for persistence unit 'default' -00:28:20.121 [Thread-3] INFO com.zaxxer.hikari.HikariDataSource - HikariPool-1 - Shutdown initiated... -00:28:20.123 [Thread-3] INFO com.zaxxer.hikari.HikariDataSource - HikariPool-1 - Shutdown completed. -00:28:22.015 [main] INFO com.example.demo.SareetaApplication - Starting SareetaApplication on Duc-Than-Trong.local with PID 45831 (/Users/mac/Documents/workspace/nd035-c4-Security-and-DevOps/starter_code/target/classes started by mac in /Users/mac/Documents/workspace/nd035-c4-Security-and-DevOps) -00:28:22.019 [main] INFO com.example.demo.SareetaApplication - No active profile set, falling back to default profiles: default -00:28:22.603 [main] INFO o.s.d.r.c.RepositoryConfigurationDelegate - Bootstrapping Spring Data repositories in DEFAULT mode. -00:28:22.677 [main] INFO o.s.d.r.c.RepositoryConfigurationDelegate - Finished Spring Data repository scanning in 63ms. Found 4 repository interfaces. -00:28:23.234 [main] INFO o.s.c.s.PostProcessorRegistrationDelegate$BeanPostProcessorChecker - Bean 'org.springframework.transaction.annotation.ProxyTransactionManagementConfiguration' of type [org.springframework.transaction.annotation.ProxyTransactionManagementConfiguration$$EnhancerBySpringCGLIB$$637374b9] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying) -00:28:23.538 [main] INFO o.s.b.w.e.tomcat.TomcatWebServer - Tomcat initialized with port(s): 8080 (http) -00:28:23.554 [main] INFO o.a.coyote.http11.Http11NioProtocol - Initializing ProtocolHandler ["http-nio-8080"] -00:28:23.572 [main] INFO o.a.catalina.core.StandardService - Starting service [Tomcat] -00:28:23.573 [main] INFO o.a.catalina.core.StandardEngine - Starting Servlet engine: [Apache Tomcat/9.0.19] -00:28:23.674 [main] INFO o.a.c.c.C.[Tomcat].[localhost].[/] - Initializing Spring embedded WebApplicationContext -00:28:23.675 [main] INFO o.s.web.context.ContextLoader - Root WebApplicationContext: initialization completed in 1604 ms -00:28:23.863 [main] INFO com.zaxxer.hikari.HikariDataSource - HikariPool-1 - Starting... -00:28:24.032 [main] INFO com.zaxxer.hikari.HikariDataSource - HikariPool-1 - Start completed. -00:28:24.096 [main] INFO o.h.jpa.internal.util.LogHelper - HHH000204: Processing PersistenceUnitInfo [ - name: default - ...] -00:28:24.163 [main] INFO org.hibernate.Version - HHH000412: Hibernate Core {5.3.10.Final} -00:28:24.165 [main] INFO org.hibernate.cfg.Environment - HHH000206: hibernate.properties not found -00:28:24.328 [main] INFO o.h.annotations.common.Version - HCANN000001: Hibernate Commons Annotations {5.0.4.Final} -00:28:24.478 [main] INFO org.hibernate.dialect.Dialect - HHH000400: Using dialect: org.hibernate.dialect.H2Dialect -00:28:25.250 [main] INFO o.s.o.j.LocalContainerEntityManagerFactoryBean - Initialized JPA EntityManagerFactory for persistence unit 'default' -00:28:25.887 [main] WARN o.s.b.a.o.j.JpaBaseConfiguration$JpaWebConfiguration$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 warning -00:28:25.963 [main] INFO o.s.s.web.DefaultSecurityFilterChain - Creating filter chain: any request, [org.springframework.security.web.context.request.async.WebAsyncManagerIntegrationFilter@7fad28ac, org.springframework.security.web.context.SecurityContextPersistenceFilter@5fd31df7, org.springframework.security.web.header.HeaderWriterFilter@656302c, org.springframework.web.filter.CorsFilter@3450bd13, org.springframework.security.web.authentication.logout.LogoutFilter@66589252, com.example.demo.security.JWTAuthenticationFilter@1bb51492, com.example.demo.security.JWTAuthenticationVerficationFilter@5da1a97f, org.springframework.security.web.savedrequest.RequestCacheAwareFilter@2c8f65da, org.springframework.security.web.servletapi.SecurityContextHolderAwareRequestFilter@5ff29e8b, org.springframework.security.web.authentication.AnonymousAuthenticationFilter@4b5f022f, org.springframework.security.web.session.SessionManagementFilter@49809275, org.springframework.security.web.access.ExceptionTranslationFilter@f453129, org.springframework.security.web.access.intercept.FilterSecurityInterceptor@39c1e7b7] -00:28:26.082 [main] INFO o.s.s.c.ThreadPoolTaskExecutor - Initializing ExecutorService 'applicationTaskExecutor' -00:28:26.262 [main] INFO o.a.coyote.http11.Http11NioProtocol - Starting ProtocolHandler ["http-nio-8080"] -00:28:26.309 [main] INFO o.s.b.w.e.tomcat.TomcatWebServer - Tomcat started on port(s): 8080 (http) with context path '' -00:28:26.313 [main] INFO com.example.demo.SareetaApplication - Started SareetaApplication in 4.846 seconds (JVM running for 5.444) -00:28:43.497 [http-nio-8080-exec-2] INFO o.a.c.c.C.[Tomcat].[localhost].[/] - Initializing Spring DispatcherServlet 'dispatcherServlet' -00:28:43.498 [http-nio-8080-exec-2] INFO o.s.web.servlet.DispatcherServlet - Initializing Servlet 'dispatcherServlet' -00:28:43.506 [http-nio-8080-exec-2] INFO o.s.web.servlet.DispatcherServlet - Completed initialization in 8 ms -00:28:43.736 [http-nio-8080-exec-2] INFO c.e.demo.controllers.UserController - Create user name is : ductt18 success -00:28:53.461 [http-nio-8080-exec-3] INFO c.e.d.s.JWTAuthenticationVerficationFilter - Login success -00:28:53.463 [http-nio-8080-exec-3] INFO c.e.d.s.JWTAuthenticationVerficationFilter - Login success -00:28:53.485 [http-nio-8080-exec-3] INFO o.h.h.i.QueryTranslatorFactoryInitiator - HHH000397: Using ASTQueryTranslatorFactory -00:28:53.569 [http-nio-8080-exec-3] ERROR c.e.demo.controllers.OrderController - Order request of failed. Because user not exists -00:30:52.524 [http-nio-8080-exec-6] ERROR c.e.demo.controllers.UserController - Create user failed -00:31:18.496 [http-nio-8080-exec-8] INFO c.e.d.s.JWTAuthenticationVerficationFilter - Login success -00:31:18.497 [http-nio-8080-exec-8] INFO c.e.d.s.JWTAuthenticationVerficationFilter - Login success -00:31:18.520 [http-nio-8080-exec-8] INFO c.e.demo.controllers.OrderController - Order request of ductt18 success -01:39:17.238 [HikariPool-1 housekeeper] WARN com.zaxxer.hikari.pool.HikariPool - HikariPool-1 - Thread starvation or clock leap detected (housekeeper delta=30m22s311ms). -02:39:34.207 [HikariPool-1 housekeeper] WARN com.zaxxer.hikari.pool.HikariPool - HikariPool-1 - Thread starvation or clock leap detected (housekeeper delta=1h16s971ms). -02:57:24.010 [HikariPool-1 housekeeper] WARN com.zaxxer.hikari.pool.HikariPool - HikariPool-1 - Thread starvation or clock leap detected (housekeeper delta=17m19s792ms). -03:13:21.803 [HikariPool-1 housekeeper] WARN com.zaxxer.hikari.pool.HikariPool - HikariPool-1 - Thread starvation or clock leap detected (housekeeper delta=15m57s793ms). -03:32:06.549 [HikariPool-1 housekeeper] WARN com.zaxxer.hikari.pool.HikariPool - HikariPool-1 - Thread starvation or clock leap detected (housekeeper delta=18m14s744ms). -05:20:22.266 [HikariPool-1 housekeeper] WARN com.zaxxer.hikari.pool.HikariPool - HikariPool-1 - Thread starvation or clock leap detected (housekeeper delta=1h47m45s702ms). -07:08:38.979 [HikariPool-1 housekeeper] WARN com.zaxxer.hikari.pool.HikariPool - HikariPool-1 - Thread starvation or clock leap detected (housekeeper delta=1h47m46s694ms). -07:26:08.664 [HikariPool-1 housekeeper] WARN com.zaxxer.hikari.pool.HikariPool - HikariPool-1 - Thread starvation or clock leap detected (housekeeper delta=17m29s685ms). -07:36:08.599 [HikariPool-1 housekeeper] WARN com.zaxxer.hikari.pool.HikariPool - HikariPool-1 - Thread starvation or clock leap detected (housekeeper delta=9m29s851ms). -11:44:18.185 [HikariPool-1 housekeeper] WARN com.zaxxer.hikari.pool.HikariPool - HikariPool-1 - Thread starvation or clock leap detected (housekeeper delta=4h39s263ms). -13:15:49.175 [HikariPool-1 housekeeper] WARN com.zaxxer.hikari.pool.HikariPool - HikariPool-1 - Retrograde clock change detected (housekeeper delta=28s1ms), soft-evicting connections from pool. -14:16:35.549 [HikariPool-1 housekeeper] WARN com.zaxxer.hikari.pool.HikariPool - HikariPool-1 - Thread starvation or clock leap detected (housekeeper delta=1h16s415ms). -14:33:47.836 [HikariPool-1 housekeeper] WARN com.zaxxer.hikari.pool.HikariPool - HikariPool-1 - Thread starvation or clock leap detected (housekeeper delta=16m42s279ms). -14:54:26.500 [HikariPool-1 housekeeper] WARN com.zaxxer.hikari.pool.HikariPool - HikariPool-1 - Thread starvation or clock leap detected (housekeeper delta=17m8s643ms). -15:12:08.418 [HikariPool-1 housekeeper] WARN com.zaxxer.hikari.pool.HikariPool - HikariPool-1 - Thread starvation or clock leap detected (housekeeper delta=16m11s891ms). -15:30:14.105 [HikariPool-1 housekeeper] WARN com.zaxxer.hikari.pool.HikariPool - HikariPool-1 - Thread starvation or clock leap detected (housekeeper delta=17m4s240ms). -15:55:31.803 [HikariPool-1 housekeeper] WARN com.zaxxer.hikari.pool.HikariPool - HikariPool-1 - Thread starvation or clock leap detected (housekeeper delta=25m17s698ms). -16:23:51.820 [HikariPool-1 housekeeper] WARN com.zaxxer.hikari.pool.HikariPool - HikariPool-1 - Thread starvation or clock leap detected (housekeeper delta=27m49s726ms). +00:37:50.782 [main] INFO org.hibernate.Version - HHH000412: Hibernate Core {5.3.10.Final} +00:37:50.783 [main] INFO org.hibernate.cfg.Environment - HHH000206: hibernate.properties not found +00:37:50.938 [main] INFO o.h.annotations.common.Version - HCANN000001: Hibernate Commons Annotations {5.0.4.Final} +00:37:51.070 [main] INFO org.hibernate.dialect.Dialect - HHH000400: Using dialect: org.hibernate.dialect.H2Dialect +00:37:51.790 [main] INFO o.s.o.j.LocalContainerEntityManagerFactoryBean - Initialized JPA EntityManagerFactory for persistence unit 'default' +00:37:52.372 [main] WARN o.s.b.a.o.j.JpaBaseConfiguration$JpaWebConfiguration$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 warning +00:37:52.446 [main] INFO o.s.s.web.DefaultSecurityFilterChain - Creating filter chain: any request, [org.springframework.security.web.context.request.async.WebAsyncManagerIntegrationFilter@6a97517, org.springframework.security.web.context.SecurityContextPersistenceFilter@42fa5cb, org.springframework.security.web.header.HeaderWriterFilter@56554365, org.springframework.web.filter.CorsFilter@284b487f, org.springframework.security.web.authentication.logout.LogoutFilter@7bc8da3f, com.example.demo.security.JWTAuthenticationFilter@65021bb4, com.example.demo.security.JWTAuthenticationVerficationFilter@630c3af3, org.springframework.security.web.savedrequest.RequestCacheAwareFilter@44e4cf8a, org.springframework.security.web.servletapi.SecurityContextHolderAwareRequestFilter@3ea6faf0, org.springframework.security.web.authentication.AnonymousAuthenticationFilter@2e40ea48, org.springframework.security.web.session.SessionManagementFilter@66130c3b, org.springframework.security.web.access.ExceptionTranslationFilter@51aa2a58, org.springframework.security.web.access.intercept.FilterSecurityInterceptor@61ca5134] +00:37:52.556 [main] INFO o.s.s.c.ThreadPoolTaskExecutor - Initializing ExecutorService 'applicationTaskExecutor' +00:37:52.713 [main] INFO o.a.coyote.http11.Http11NioProtocol - Starting ProtocolHandler ["http-nio-8080"] +00:37:52.721 [main] ERROR o.apache.catalina.util.LifecycleBase - Failed to start component [Connector[HTTP/1.1-8080]] +org.apache.catalina.LifecycleException: Protocol handler start failed + at org.apache.catalina.connector.Connector.startInternal(Connector.java:1008) + at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183) + at org.apache.catalina.core.StandardService.addConnector(StandardService.java:226) + at org.springframework.boot.web.embedded.tomcat.TomcatWebServer.addPreviouslyRemovedConnectors(TomcatWebServer.java:259) + at org.springframework.boot.web.embedded.tomcat.TomcatWebServer.start(TomcatWebServer.java:197) + at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.startWebServer(ServletWebServerApplicationContext.java:311) + at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.finishRefresh(ServletWebServerApplicationContext.java:164) + at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:552) + at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:142) + at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:775) + at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:397) + at org.springframework.boot.SpringApplication.run(SpringApplication.java:316) + at org.springframework.boot.SpringApplication.run(SpringApplication.java:1260) + at org.springframework.boot.SpringApplication.run(SpringApplication.java:1248) + at com.example.demo.SareetaApplication.main(SareetaApplication.java:22) +Caused by: java.net.BindException: Address already in use + at java.base/sun.nio.ch.Net.bind0(Native Method) + at java.base/sun.nio.ch.Net.bind(Net.java:556) + at java.base/sun.nio.ch.ServerSocketChannelImpl.netBind(ServerSocketChannelImpl.java:344) + at java.base/sun.nio.ch.ServerSocketChannelImpl.bind(ServerSocketChannelImpl.java:301) + at java.base/sun.nio.ch.ServerSocketAdaptor.bind(ServerSocketAdaptor.java:89) + at org.apache.tomcat.util.net.NioEndpoint.initServerSocket(NioEndpoint.java:239) + at org.apache.tomcat.util.net.NioEndpoint.bind(NioEndpoint.java:213) + at org.apache.tomcat.util.net.AbstractEndpoint.bindWithCleanup(AbstractEndpoint.java:1116) + at org.apache.tomcat.util.net.AbstractEndpoint.start(AbstractEndpoint.java:1202) + at org.apache.coyote.AbstractProtocol.start(AbstractProtocol.java:568) + at org.apache.catalina.connector.Connector.startInternal(Connector.java:1005) + ... 14 common frames omitted +00:37:52.738 [main] INFO o.a.coyote.http11.Http11NioProtocol - Pausing ProtocolHandler ["http-nio-8080"] +00:37:52.738 [main] INFO o.a.catalina.core.StandardService - Stopping service [Tomcat] +00:37:52.742 [main] WARN o.a.c.loader.WebappClassLoaderBase - The web application [ROOT] appears to have started a thread named [HikariPool-1 housekeeper] but has failed to stop it. This is very likely to create a memory leak. Stack trace of thread: + java.base/jdk.internal.misc.Unsafe.park(Native Method) + java.base/java.util.concurrent.locks.LockSupport.parkNanos(LockSupport.java:269) + java.base/java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.awaitNanos(AbstractQueuedSynchronizer.java:1758) + java.base/java.util.concurrent.ScheduledThreadPoolExecutor$DelayedWorkQueue.take(ScheduledThreadPoolExecutor.java:1182) + java.base/java.util.concurrent.ScheduledThreadPoolExecutor$DelayedWorkQueue.take(ScheduledThreadPoolExecutor.java:899) + java.base/java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:1070) + java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1130) + java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:642) + java.base/java.lang.Thread.run(Thread.java:1623) +00:37:52.742 [main] WARN o.a.c.loader.WebappClassLoaderBase - The web application [ROOT] appears to have started a thread named [HikariPool-1 connection adder] but has failed to stop it. This is very likely to create a memory leak. Stack trace of thread: + java.base/jdk.internal.misc.Unsafe.park(Native Method) + java.base/java.util.concurrent.locks.LockSupport.parkNanos(LockSupport.java:269) + java.base/java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.awaitNanos(AbstractQueuedSynchronizer.java:1758) + java.base/java.util.concurrent.LinkedBlockingQueue.poll(LinkedBlockingQueue.java:460) + java.base/java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:1069) + java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1130) + java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:642) + java.base/java.lang.Thread.run(Thread.java:1623) +00:37:52.743 [main] INFO o.apache.catalina.util.LifecycleBase - The stop() method was called on component [StandardServer[-1]] after stop() had already been called. The second call will be ignored. +00:37:52.744 [main] INFO o.a.coyote.http11.Http11NioProtocol - Stopping ProtocolHandler ["http-nio-8080"] +00:37:52.744 [main] INFO o.a.coyote.http11.Http11NioProtocol - Destroying ProtocolHandler ["http-nio-8080"] +00:37:52.746 [main] INFO o.s.b.a.l.ConditionEvaluationReportLoggingListener - + +Error starting ApplicationContext. To display the conditions report re-run your application with 'debug' enabled. +00:37:52.747 [main] ERROR o.s.b.d.LoggingFailureAnalysisReporter - + +*************************** +APPLICATION FAILED TO START +*************************** + +Description: + +The Tomcat connector configured to listen on port 8080 failed to start. The port may already be in use or the connector may be misconfigured. + +Action: + +Verify the connector's configuration, identify and stop any process that's listening on port 8080, or configure this application to listen on another port. + +00:37:52.749 [main] INFO o.s.s.c.ThreadPoolTaskExecutor - Shutting down ExecutorService 'applicationTaskExecutor' +00:37:52.751 [main] INFO o.s.o.j.LocalContainerEntityManagerFactoryBean - Closing JPA EntityManagerFactory for persistence unit 'default' +00:37:52.752 [main] INFO com.zaxxer.hikari.HikariDataSource - HikariPool-1 - Shutdown initiated... +00:37:52.754 [main] INFO com.zaxxer.hikari.HikariDataSource - HikariPool-1 - Shutdown completed. diff --git a/starter_code/src/main/java/com/example/demo/controllers/TestController.java b/starter_code/src/main/java/com/example/demo/controllers/TestController.java new file mode 100644 index 000000000..bf54d3b63 --- /dev/null +++ b/starter_code/src/main/java/com/example/demo/controllers/TestController.java @@ -0,0 +1,16 @@ +package com.example.demo.controllers; + +import com.example.demo.model.persistence.repositories.OrderRepository; +import com.example.demo.model.persistence.repositories.UserRepository; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.beans.factory.annotation.Autowired; + +public class TestController { + private static final Logger log = LoggerFactory.getLogger(OrderController.class); + @Autowired + private UserRepository userRepository; + + @Autowired + private OrderRepository orderRepository; +}