h2-console 2

H2-console에서 Localhost에서 연결을 거부했습니다. 오류 발생시 해결법

문제 발생 h2-console로 접속하니 아래처럼 'localhost에서 연결을 거부했습니다'로 콘솔 접속이 거부된다. 해결 방법 1 만약 스프링 시큐리티(Spring security)를 적용했다면 h2-console 경로에서도 접근 가능하도록 설정을 해줘야 한다. antMatchers 메서드에 "/h2-console/**"을 추가해준다. @Override protected void configure(HttpSecurity http) throws Exception { http .authorizeRequests() .antMatchers("/h2-console/**)") .permitAll; } 해결 방법 2 그래도 동작하지 않는다면 X-Frame-Options 기능을 꺼본다. 스프링 시큐리티에서는 기본적..

Computer Science/DB 2023.11.20

H2 console 접속 오류 해결법 : Database "C:/Users/사용자명/test" not found, either pre-creat

문제 발생서버를 실행시키고 http://localhost:8080/h2-console 를 입력하여 H2 콘솔 접속시 다음과 같은 에러가 발생한다. 데이터베이스 "C:/Users/사용자명/test"를 찾을 수 없다고 나온다. 말그대로 C:\Users\사용자명 폴더에 test 파일이 없어서 생긴 문제이므로 직접 만들어주자.Database "C:/Users/사용자명/test" not found, either pre-create it or allow remote database creation (not recommended in secure environments) [90149-214] 90149/90149 (Help)해결 방법C:\Users\사용자명 경로에 빈 텍스트 파일을 생성하고 파일명을 확장자 포함하여 ..

Computer Science/DB 2023.10.14