无法访问jhipster中的H2控制台

时间:2019-08-30 12:49:39

标签: java spring-boot jhipster h2 jhipster-registry

我无法在Web浏览器上打开H2控制台。 我的jhipster应用程序正在8088端口上运行。在服务器日志中,我发现H2数据库在端口18088上可用。

尝试以下。 http://localhost:18088/h2-console

得到以下回应。 enter image description here

下面是application-dev.yml中的详细信息。

devtools:
    restart:
      enabled: true
      additional-exclude: .h2.server.properties
    livereload:
      enabled: false # we use Webpack dev server + BrowserSync for livereload
  jackson:
    serialization:
      indent-output: true
  datasource:
    type: com.zaxxer.hikari.HikariDataSource
    url: jdbc:h2:mem:jhipstersampleapplication;DB_CLOSE_DELAY=-1;DB_CLOSE_ON_EXIT=FALSE
    username: jhipsterSampleApplication
    password:
    hikari:
      poolName: Hikari
      auto-commit: false
  h2:
    console:
      enabled: true
  jpa:
    database-platform: io.github.jhipster.domain.util.FixedH2Dialect
    database: H2
    show-sql: true
    properties:
      hibernate.id.new_generator_mappings: true
      hibernate.connection.provider_disables_autocommit: true
      hibernate.cache.use_second_level_cache: true
      hibernate.cache.use_query_cache: false
      hibernate.generate_statistics: false

请帮助我解决这个问题。

3 个答案:

答案 0 :(得分:3)

添加斜线解决了我的问题 http://localhost:8080/h2-consolehttp://localhost:8080/h2-console/

答案 1 :(得分:1)

有2个不同的端口:

  • 用于h2 Web控制台的HTTP端口8088,由您的Web应用程序提供(与REST API相同)
  • TCP端口18088,其他使用JDBC的应用程序可以使用,但不能在浏览器中使用。在您的项目的DatabaseConfiguration.java中打开了此端口

答案 2 :(得分:0)

转到应用程序URL的根目录(在应用程序启动中看到的Access Url) 然后最后键入“ / h2-console”。

localhost:8081 / services // h2-console