Thursday, October 17, 2019

Thingsboard install_dev_db HSQLDB spring.datasource.hikari.maximumPoolSize problem

Thingsboard is a fantastic open source IoT data gathering and visualization platform. I was trying to setup the local development mode for Thingsboard and always step on the mines, so I just want to document the problem and solution for install_dev_db. When you check out the Thingsboard source from github, you need to build the project on your computer:

  • mvn clean install -DskipTests
Then you try to run the application by using your IDE to run java main file: org.thingsboard.server.ThingsboardServerApplication, you will get the following error:
Schema-validation: missing table [admin_settings]

This is an indication that you don't have the database setup, for running in dev mode, we need to swith the DB to HSQLDB by commenting out the Postgres DB configuration and plug in the HSQLDB configuration found here.

When you try to run the install_dev_db.bat you may run into the following error:

Error creating bean with name 'baseTimeseriesService': Unsatisfied dependency expressed through field 'timeseriesDao'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'jpaTimeseriesDao': Injection of autowired dependencies failed; nested exception is java.lang.IllegalArgumentException: Could not resolve placeholder 'spring.datasource.hikari.maximumPoolSize' in value "${spring.datasource.hikari.maximumPoolSize}"

To solve the aforementioned error, you need add the following configuration in your thingsboard.yml under the spring.datasource:


hikari:
  maximumPoolSize: "${SPRING_DATASOURCE_MAXIMUM_POOL_SIZE:50}"
This will let you successfully setup the dev DB for thingsboard.

1 comment:

juanfe said...

Thank you very much. It helped me a lot.
Attached the full HSQLDB section that worked for me:
# HSQLDB DAO Configuration
spring:
data:
jpa:
repositories:
enabled: "true"
jpa:
hibernate:
ddl-auto: "validate"
database-platform: "org.hibernate.dialect.HSQLDialect"
datasource:
driverClassName: "${SPRING_DRIVER_CLASS_NAME:org.hsqldb.jdbc.JDBCDriver}"
url: "${SPRING_DATASOURCE_URL:jdbc:hsqldb:file:${SQL_DATA_FOLDER:/tmp}/thingsboardDb;sql.enforce_size=false}"
username: "${SPRING_DATASOURCE_USERNAME:sa}"
password: "${SPRING_DATASOURCE_PASSWORD:}"
hikari:
maximumPoolSize: "${SPRING_DATASOURCE_MAXIMUM_POOL_SIZE:50}"

Full Guide for using Bitnami Prometheus Operator Helm Chart with Additional Scrape Configuration

"The Prometheus Operator for Kubernetes provides easy monitoring definitions for Kubernetes services and deployment and management of...