Hibernate Springboot H2休眠错误

Hibernate Springboot H2休眠错误,hibernate,jpa,heroku,spring-boot,h2,Hibernate,Jpa,Heroku,Spring Boot,H2,我正在使用部署在Heroku上的Springboot应用程序,但无法使用H2。我得到了几个关于Url数据源的错误以及错误的密码和用户名。我正在尝试自动创建实体表 Main.java @Controller @EnableScheduling @SpringBootApplication public class Main { public static void main(String[] args) throws Exception { SpringApplication.run

我正在使用部署在Heroku上的Springboot应用程序,但无法使用H2。我得到了几个关于Url数据源的错误以及错误的密码和用户名。我正在尝试自动创建实体表

Main.java

@Controller
@EnableScheduling
@SpringBootApplication
public class Main {

  public static void main(String[] args) throws Exception {
    SpringApplication.run(Main.class, args);
  }

 }
@Entity
@Table(name = "UserConfiguration")
public class UserConfiguration {

    @Id
    private Long id;
    private float btcValue;
    private boolean sell;

    protected UserConfiguration() {}

    public UserConfiguration(Long id, float btcValue, boolean sell) {
        this.id = id;
        this.btcValue = btcValue;
        this.sell = sell;
    }
 ...
}
UserConfiguration.java

@Controller
@EnableScheduling
@SpringBootApplication
public class Main {

  public static void main(String[] args) throws Exception {
    SpringApplication.run(Main.class, args);
  }

 }
@Entity
@Table(name = "UserConfiguration")
public class UserConfiguration {

    @Id
    private Long id;
    private float btcValue;
    private boolean sell;

    protected UserConfiguration() {}

    public UserConfiguration(Long id, float btcValue, boolean sell) {
        this.id = id;
        this.btcValue = btcValue;
        this.sell = sell;
    }
 ...
}
应用程序属性

# H2
spring.h2.console.enabled=true
spring.h2.console.path=/h2

# Datasource
spring.datasource.url=jdbc:h2:~/database
spring.datasource.driver-class-name=org.h2.Driver
spring.datasource.username=
spring.datasource.password=


###
#   Hibernate Settings
###
spring.jpa.hibernate.ddl-auto = create
spring.jpa.properties.hibernate.show_sql=false
spring.jpa.properties.hibernate.use_sql_comments=false
spring.jpa.properties.hibernate.format_sql=false
spring.jpa.database-platform=org.hibernate.dialect.H2Dialect
Heroku本地Web执行日志

11:50:48网络1 | 2017-09-19 11:50:48.872信息12876---[
main]com.example.main:以下内容 配置文件处于活动状态:生产11:50:49 web.1 | 2017-09-19 11:50:49.078信息12876---[主要] ationConfigEmbeddedWebApplicationContext:刷新 org.springframework.boot.context.embedded。AnnotationConfigEmbeddedWebApplicationContext@7e32c033: 启动日期[2017年9月19日星期二11:50:49 CEST];语境的根源 层次结构11:50:50网络1 | 2017-09-19 11:50:50.612信息12876--- [main]o.s.b.f.s.DefaultListableBean工厂: 使用不同的 定义:替换[Root bean:class[null];范围=; abstract=false;lazyInit=false;autowireMode=3;dependencyCheck=0; autowireCandidate=true;primary=false; factoryBeanName=org.springframework.boot.autoconfigure.jdbc.DataSourceConfiguration$Hikari; factoryMethodName=dataSource;initMethodName=null; destroyMethodName=(推断)11:50:50 web.1 |>;在类中定义 路径资源 [org/springframework/boot/autoconfigure/jdbc/DataSourceConfiguration$Hikari.class]] 使用[Root bean:class[null];scope=;abstract=false;lazyInit=false; autowireMode=3;dependencyCheck=0;autowireCandidate=true; 主=假; factoryBeanName=org.springframework.boot.autoconfigure.jdbc.DataSourceConfiguration$Tomcat; factoryMethodName=dataSource;initMethodName=null; destroyMethodName=(推断);在类路径资源中定义 [org/springframework/boot/autoconf 11:50:50web.1 |> igure/jdbc/DataSourceConfiguration$Tomcat.class]]11:50:51 web.1 2017-09-19 11:50:51.346信息12876---[main] f、 a.AutowiredNotationBeanPostProcessor:JSR-330 找到并支持自动连线的“javax.inject.inject”批注 11:50:51网络1 | 2017-09-19 11:50:51.858信息12876---[
main]trationLegate$BeanPostProcessorChecker:Bean 'org.springframework.transaction.annotation.ProxyTransactionManagementConfiguration' 类型 [org.springframework.transaction.annotation.ProxyTransactionManagementConfiguration$$EnhancerBySpringCGLIB$$338a41d7] 不符合由所有BeanPostProcessor处理的条件(对于 示例:不符合自动代理的条件)11:50:52 web.1| 2017-09-19 11:50:52.373信息12876---[main] s、 b.c.e.t.TomcatEmbeddedServletContainer:Tomcat初始化为 端口:5000(http)11:50:52 web.1 | 2017-09-19 11:50:52.425信息 12876---[main]o.apache.catalina.core.StandardService: 启动服务Tomcat 11:50:52 web.1 | 2017-09-19 11:50:52.427 信息12876---[main] org.apache.catalina.core.StandardEngine:启动Servlet引擎: ApacheTomcat/8.5.11 11:50:52 web.1 | 2017-09-19 11:50:52.650信息 12876---[ost-startStop-1]o.a.c.c.[Tomcat].[localhost].[/]: 初始化Spring嵌入式WebApplicationContext 11:50:52 web.1| 2017-09-19 11:50:52.650信息12876---[ost-startStop-1] o、 s.web.context.ContextLoader:根WebApplicationContext: 初始化在3575毫秒11:50:53网页中完成。1 | 2017-09-19 11:50:53.228信息12876---[ost-startStop-1] o、 s.b.w.servlet.ServletRegistrationBean:映射servlet: “dispatcherServlet”至[/]11:50:53网页1 | 2017-09-19 11:50:53.234 信息12876---[ost-startStop-1] o、 s.b.w.servlet.ServletRegistrationBean:映射servlet: “webServlet”到[/h2/]11:50:53 web.1 | 2017-09-19 11:50:53.256 信息12876---[ost-startStop-1] o、 s.b.w.servlet.FilterRegistrationBean:映射筛选器: “metricsFilter”收件人:[/]11:50:53 web.1 | 2017-09-19 11:50:53.257 信息12876---[ost-startStop-1] o、 s.b.w.servlet.FilterRegistrationBean:映射筛选器: “characterEncodingFilter”收件人:[/]11:50:53 web.1 | 2017-09-19 11:50:53.257信息12876---[ost-startStop-1] o、 s.b.w.servlet.FilterRegistrationBean:映射筛选器: “hiddenHttpMethodFilter”收件人:[/]11:50:53 web.1 | 2017-09-19 11:50:53.257信息12876---[ost-startStop-1] o、 s.b.w.servlet.FilterRegistrationBean:映射筛选器: “httpPutFormContentFilter”收件人:[/]11:50:53 web.1 | 2017-09-19 11:50:53.257信息12876---[ost-startStop-1] o、 s.b.w.servlet.FilterRegistrationBean:映射筛选器: “requestContextFilter”收件人:[/]11:50:53 web.1 | 2017-09-19 11:50:53.258信息12876---[ost-startStop-1] o、 s.b.w.servlet.FilterRegistrationBean:映射筛选器: “webRequestLoggingFilter”收件人:[/]11:50:53 web.1 | 2017-09-19 11:50:53.271信息12876---[ost-startStop-1] o、 s.b.w.servlet.FilterRegistrationBean:映射筛选器: “applicationContextIdFilter”收件人:[/]11:50:53 web.1 | 2017-09-19 11:50:53.273信息12876---[ost-startStop-1] o、 s.b.w.servlet.FilterRegistrationBean:映射筛选器: “ResourceUrEncodingFilter”收件人:[/*]11:50:54 web.1 | 2017-09-19 11:50:54.251错误12876---[main] o、 a.tomcat.jdbc.pool.ConnectionPool:无法创建初始 连接池。11:50:54 web.1 | org.h2.jdbc.jdbcsql异常: 错误的用户名或密码[28000-193]11:50:54 web.1 | at org.h2.message.DbException.getJdbcSQLException(DbException.java:345) ~[h2-1.4.193.jar!/:na]11:50:54 web.1 | at org.h2.message.DbException.get(DbException.java:179) ~[h2-1.4.193.jar!/:na]11:50:54 web.1 | at org.h2.message.DbException.get(DbException.java:155) ~[h2-1.4.193.jar!/:na]11:50:54 web.1 | at org.h2.message.DbException.get(DbEx