Spring Boot JPA H2 Console not running, application.properties file ignored
<p>The Spring Boot guide says I can get the H2 console but it's not working for me.</p>

<blockquote>
  <p><a href="http://localhost:8080/h2/" rel="noreferrer">http://localhost:8080/h2/</a> Whitelabel Error Page
  This application has no explicit mapping for /error, so you are seeing this as a fallback.
  Wed Oct 26 12:31:46 BST 2016
  There was an unexpected error (type=Not Found, status=404).
  No message available</p>
</blockquote>

<p>I created an <code>application.properties</code> file as follows</p>

<pre><code>spring.h2.console.enabled=true 
spring.h2.console.path=/h2
</code></pre>

<p>My project is based on <a href="https://github.com/spring-guides/gs-accessing-data-rest/tree/master/initial" rel="noreferrer">this</a></p>

<p>The default path <code>/h2-console</code> doesn't work either. </p>

<p>I found another answer where the problem is solved by adding to <code>Application.java</code>:</p>

<pre><code>    @Bean
public ServletRegistrationBean h2servletRegistration() {
    ServletRegistrationBean registration = new ServletRegistrationBean(new WebServlet());
    registration.addUrlMappings("/h2/*");
    return registration;
}
</code></pre>

<p>Everything in my <code>application.properties</code> file is ignored. I have tried adding:</p>

<pre><code>spring.datasource.url=jdbc:h2:file:~/portal;DB_CLOSE_ON_EXIT=FALSE
spring.datasource.username=sa
spring.datasource.password=
spring.datasource.driverClassName=org.h2.Driver
</code></pre>

<p>But the database is still created in memory only.</p>