Keycloak quarkus 18.0.0 not starting with postgresql

Keycloak quarkus 18.0.0 on openjdk (i.e. local machine) not starting with postgresql.
Command used to start keycloak:
kc.bat start

keycloak.conf and logs are pasted below-

content of keycloak.conf:

Basic settings for running in production. Change accordingly before deploying the server.

Database

The database vendor.

db=postgres

The username of the database user.

db-username=keycloak

The password of the database user.

db-password=keycloak

The full database JDBC URL. If not provided, a default URL is set based on the selected database vendor.

db-url=jdbc:postgresql://localhost/keycloak

Observability

If the server should expose healthcheck endpoints.

#health-enabled=true

If the server should expose metrics endpoints.

#metrics-enabled=true

HTTP

The file path to a server certificate or certificate chain in PEM format.

#https-certificate-file=${kc.home.dir}conf/server.crt.pem

The file path to a private key in PEM format.

#https-certificate-key-file=${kc.home.dir}conf/server.key.pem

The proxy address forwarding mode if the server is behind a reverse proxy.

#proxy=reencrypt

Do not attach route to cookies and rely on the session affinity capabilities from reverse proxy

#spi-sticky-session-encoder-infinispan-should-attach-route=false

Hostname for the Keycloak server.

hostname=localhost


logs depicting failure:
keycloak-18.0.0\bin> kc.bat start
2022-05-04 15:21:16,064 WARN [io.quarkus.runtime.configuration.ConfigRecorder] (main) Build time property cannot be changed at runtime:

  • quarkus.datasource.jdbc.driver is set to ‘org.h2.jdbcx.JdbcDataSource’ but it is build time fixed to ‘org.postgresql.xa.PGXADataSource’. Did you change the property quarkus.datasource.jdbc.driver after building the application?
    2022-05-04 15:21:16,317 INFO [org.keycloak.quarkus.runtime.hostname.DefaultHostnameProvider] (main) Hostname settings: FrontEnd: localhost, Strict HTTPS: true, Path: , Strict BackChannel: false, Admin: , Port: -1, Proxied: false
    2022-05-04 15:21:16,383 WARN [io.agroal.pool] (agroal-11) Datasource ‘’: No suitable driver found for jdbc:postgresql://localhost:5432/keycloak
    2022-05-04 15:21:16,384 WARN [org.hibernate.engine.jdbc.env.internal.JdbcEnvironmentInitiator] (JPA Startup Thread: keycloak-default) HHH000342: Could not obtain connection to query metadata: java.sql.SQLException: No suitable driver found for jdbc:postgresql://localhost:5432/keycloak
    at org.h2.jdbcx.JdbcDataSource.getJdbcConnection(JdbcDataSource.java:191)
    at org.h2.jdbcx.JdbcDataSource.getXAConnection(JdbcDataSource.java:352)
    at io.agroal.pool.ConnectionFactory.createConnection(ConnectionFactory.java:216)
    at io.agroal.pool.ConnectionPool$CreateConnectionTask.call(ConnectionPool.java:513)
    at io.agroal.pool.ConnectionPool$CreateConnectionTask.call(ConnectionPool.java:494)
    at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
    at io.agroal.pool.util.PriorityScheduledExecutor.beforeExecute(PriorityScheduledExecutor.java:75)
    at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1126)
    at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
    at java.base/java.lang.Thread.run(Thread.java:834)

2022-05-04 15:21:17,116 WARN [org.infinispan.PERSISTENCE] (keycloak-cache-init) ISPN000554: jboss-marshalling is deprecated and planned for removal
2022-05-04 15:21:17,138 WARN [org.infinispan.CONFIG] (keycloak-cache-init) ISPN000569: Unable to persist Infinispan internal caches as no global state enabled
2022-05-04 15:21:17,162 INFO [org.infinispan.CONTAINER] (keycloak-cache-init) ISPN000556: Starting user marshaller ‘org.infinispan.jboss.marshalling.core.JBossUserMarshaller’
2022-05-04 15:21:17,276 INFO [org.infinispan.CONTAINER] (keycloak-cache-init) ISPN000128: Infinispan version: Infinispan ‘Triskaidekaphobia’ 13.0.8.Final
2022-05-04 15:21:17,373 INFO [org.infinispan.CLUSTER] (keycloak-cache-init) ISPN000078: Starting JGroups channel ISPN
2022-05-04 15:21:17,373 INFO [org.infinispan.CLUSTER] (keycloak-cache-init) ISPN000088: Unable to use any JGroups configuration mechanisms provided in properties {}. Using default JGroups configuration!
2022-05-04 15:21:20,802 INFO [org.jgroups.protocols.pbcast.GMS] (keycloak-cache-init) NDA-LL-MSKHATRI-53082: no members discovered after 2013 ms: creating cluster as coordinator
2022-05-04 15:21:20,808 INFO [org.infinispan.CLUSTER] (keycloak-cache-init) ISPN000094: Received new cluster view for channel ISPN: [NDA-LL-MSKHATRI-53082|0] (1) [NDA-LL-MSKHATRI-53082]
2022-05-04 15:21:20,812 INFO [org.infinispan.CLUSTER] (keycloak-cache-init) ISPN000079: Channel ISPN local address is NDA-LL-MSKHATRI-53082, physical addresses are [10.84.63.34:61673]
2022-05-04 15:21:21,166 INFO [org.infinispan.CLUSTER] (main) ISPN000080: Disconnecting JGroups channel ISPN
2022-05-04 15:21:21,314 ERROR [org.keycloak.quarkus.runtime.cli.ExecutionExceptionHandler] (main) ERROR: Failed to start server in (production) mode
2022-05-04 15:21:21,314 ERROR [org.keycloak.quarkus.runtime.cli.ExecutionExceptionHandler] (main) ERROR: Key material not provided to setup HTTPS. Please configure your keys/certificates or start the server in development mode.
2022-05-04 15:21:21,318 ERROR [org.keycloak.quarkus.runtime.cli.ExecutionExceptionHandler] (main) For more details run the same command passing the ‘–verbose’ option. Also you can use ‘–help’ to see the details about the usage of the particular command.