Posts

Showing posts with the label H2-Console

H2-Console is not showing in browser

Image
If you have override configure method of Spring Security and you want to use console of h2 database in browser, and after connect h2-console showing loading error as shown in below image. Then you have to add following line in your overridden configure method. @EnableWebSecurity public class SecurityConfig extends WebSecurityConfigurerAdapter {    Logger logger = LoggerFactory.getLogger(SecurityConfig. class );       //......            @Override    protected void configure(HttpSecurity http) throws Exception {      http.authorizeRequests().antMatchers( "/" ).permitAll();      http.authorizeRequests().antMatchers( "/imgs/**" ).permitAll();      http.authorizeRequests().antMatchers( "/admin/**" ).hasRole( "ADMIN" );      http.authorizeRequests().antMatchers( "/**" ).hasRole( "USER" ).and().formLogin(); ...