Rahul
Rahul

Reputation: 583

Not able to access H2 Console in jhipster

I am not able to open H2 console on the web browser. My jhipster application is running on 8088 port. In server logs I am getting that H2 database is available on port 18088.

Tried below. http://localhost:18088/h2-console

Getting Below response. enter image description here

Below are the details in 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

Please Help me out with this.

Upvotes: 3

Views: 2823

Answers (4)

gachokaeric
gachokaeric

Reputation: 110

Ensure you are accessing the correct port (8088 in your case), and that you do not change jhipster's setting for h2.console.enabled.

http://localhost:8088/h2-console should work.

Upvotes: 0

Alexy
Alexy

Reputation: 359

Adding slash solved my problem http://localhost:8080/h2-console to http://localhost:8080/h2-console/

Upvotes: 7

user2197572
user2197572

Reputation: 1

Go to root of the app url (Access Url that you see in the application start) then type "/h2-console" in the end.

localhost:8081/services//h2-console

Upvotes: -1

Gaël Marziou
Gaël Marziou

Reputation: 16284

There are 2 different ports:

  • HTTP port 8088 for h2 web console, it's served by your web app (same as your REST API)
  • TCP port 18088 that can be used by other applications using JDBC, it can't be used from a browser. This port is opened in DatabaseConfiguration.java in your project

Upvotes: 2

Related Questions