1. No Persistence provider for EntityManager named Hi 부트를 사용하지 않을 때는 META-INF 내부의 persistence.xml 파일의 unit-name과 persistenceUnitName을 서로 매칭 시켜주면 되지만 부트는 persistence.xml 파일 자체가 없습니다.(자동으로 설정) 스프링 부트 없이 다음과 같은 접근으로 EntityManagerFactory를 직접 사용하려고 하면 "Exception in thread "main" jakarta.persistence.PersistenceException: No Persistence provider for EntityManager named Hi" 와 같은 에러가 발생합니다 EntityManagerF..
Spring

CSRF TOKEN문제 스프링 시큐리티는 POST, PUT, DELETE등의 메소드 요청을 할 때 이전 페이지에서 발급된 CSRF토큰 정보를 체크하기 때문에 정보를 헤더로 넘겨줘야한다. 1. CSRF Token발급 설정 @EnableWebSecurity @Configuration public class SecurityConfig extends WebSecurityConfigurerAdapter{ @Override protected void configure(HttpSecurity httpSecurity) throws Exception { httpSecurity .csrf().csrfTokenRepository(CookieCsrfTokenRepository.withHttpOnlyFalse()); } } 2..
1. WebSecurity @Bean public WebSecurityCustomizer webSecurityCustomizer(){ return (web) ->{ web.ignoring().requestMatchers(PathRequest.toStaticResources().atCommonLocations()); web.ignoring().antMatchers("/favicon.ico", "/resources/**", "/error"); }; } antMatchers의 endPoint에 대한 Spring Security Filter Chain을 거치지 않기 때문에 인증과 인가를 거치지 않는다. Security Context를 설정하지 않고, Security Features(Secure headers, ..