Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

H2 database console spring boot Load denied by X-Frame-Options

I`m building a skeletal project for dev with spring 4 boot security and others. Using H2 while attempting to log into the db console and manage my db i get the following error. The page is blank, with 4 bugs in firebug konsole :

 Load denied by X-Frame-Options: http://localhost:8080/console 

With links to

/header.jsp?jsessionid=f71207a702c9177e57208414721bbe93 does not permit framing. /query.jsp?jsessionid=f71207a702c9177e57208414721bbe93 does not permit framing. /help.jsp?jsessionid=f71207a702c9177e57208414721bbe93 does not permit framing. /tables.do?jsessionid=f71207a702c9177e57208414721bbe93 does not permit framing. 
  1. I can test the connection from console level - its ok.
  2. DB works fine, import.sql works fine, i can create user entities withing spring is starting up.

The configuration i am using is from (and it works on spring 3.2 with xml configuration)

spring boot default H2 jdbc connection (and H2 console)

Using : spring-boot-starter-parent 1.1.4.RELEASE

like image 208
Piotr 'Kowcio' Kowalski Avatar asked Oct 06 '14 15:10

Piotr 'Kowcio' Kowalski


People also ask

How do I access the H2 database console?

You can access the console at the following URL: http://localhost:8080/h2-console/. You need to enter the JDBC URL, and credentials.

How do I access H2 console with Spring Security?

H2 database has an embedded GUI console for browsing the contents of a database and running SQL queries. By default, the H2 console is not enabled in Spring. Then, after starting the application, we can navigate to http://localhost:8080/h2-console, which will present us with a login page.


1 Answers

It's also possible to simplify the answer from @chrosciu with this:

@Configuration public class WebSecurityConfig extends WebSecurityConfigurerAdapter {    @Override   protected void configure(HttpSecurity http) throws Exception {     http.headers().frameOptions().disable();   } } 
like image 109
pVilaca Avatar answered Oct 04 '22 09:10

pVilaca