Runtime-Exception in Docker Container with PostgreSQL

2,630 views
Skip to first unread message

Matthias Kümmel

unread,
Jan 18, 2022, 3:18:15 AM1/18/22
to inception-users
Hello,


I'm currently trying to set up INCEpTION as a docker container following this guide; https://inception-project.github.io/releases/22.0/docs/admin-guide.html#sect_docker

I'd like to connect it to a PostgreSQL-Server, but after initial startup via

$ docker run -it --name inception --net=host -v /srv/inception:/export inceptionproject/inception:22.0

it crashes due to a Java RuntimeException;

> Factory method 'dataSource' threw exception; nested exception is java.lang.RuntimeException: Failed to load driver class org.postgresql.Driver in either of HikariConfig class loader or Thread context classloader

full output attached.


settings.properties currently contains:

> INCEPTION_DB_URL = jdbc:postgresql://localhost:5432/inception?useUnicode=true&characterEncoding=UTF-8&serverTimezone=UTC
> INCEPTION_DB_USERNAME = inception_db
> INCEPTION_DB_PASSWORD = <PasswordIsHere>


Can anybody see an error I made or has experienced the same?


Best regards

Matthias
error.log

Richard Eckart de Castilho

unread,
Jan 18, 2022, 3:23:01 AM1/18/22
to incepti...@googlegroups.com
Hi,

INCEpTION is compatible with MariaDB (recommended), MySQL and HSQLDB (used in embedded mode by default if no other DB is configured - not recommended). It includes drivers for MariaDB (compatible also with MySQL) and for HSQLDB.

Drivers for PostgreSQL are not included and INCEpTION is not tested against PostgreSQL.
You could try creating a folder "lib" in the INCEpTION home directory and placing your PostgreSQL driver JAR in there. That should allow the driver to be loaded, but there is no guarantee that the application will actually run with it. The last person that tried it gave the feedback it didn't work, but your mileage may vary.

Best,

-- Richard


Matthias Kümmel

unread,
Jan 18, 2022, 3:47:31 AM1/18/22
to inception-users
Hi,

thanks for your reply.

Nothing changed when I placed the Postgres driver in a "lib" directory, so I tried with MySQL which is also running on that server with pretty much the same error:


Factory method 'dataSource' threw exception; nested exception is java.lang.RuntimeException: Failed to load driver class com.mysql.cj.jdbc.Driver in either of HikariConfig class loader or Thread context classloader


Best regards,

Matthias

Richard Eckart de Castilho

unread,
Jan 18, 2022, 3:50:38 AM1/18/22
to incepti...@googlegroups.com
Hi,

> On 18. Jan 2022, at 09:47, Matthias Kümmel <mkuemm...@gmail.com> wrote:
>
> Factory method 'dataSource' threw exception; nested exception is java.lang.RuntimeException: Failed to load driver class com.mysql.cj.jdbc.Driver in either of HikariConfig class loader or Thread context classloader

try not specifying any driver or dialect in the settings.properties file. INCEpTION should be auto-detecting. Cf. INCEpTION 20.0 release notes:

----
⚠️ Database driver changed. The MySQL driver is no longer bundled, only the MariaDB driver is shipped. If you have manually configured a DB driver and dialect in the settings.properties, comment them out. In the JDBC connection string replace mysql with mariadb. The MariaDB driver should also work with a MySQL database. If you use Docker Compose, make sure to remove the INCEPTION_DB_DIALECT and INCEPTION_DB_DRIVER and update the INCEPTION_DB_URL to start with jdbc:mariadb: istead of jdbc:mysql:
----

https://github.com/inception-project/inception/releases/tag/inception-20.0

The documentation since 20.0 should no longer recommend MySQL.

-- Richard

Matthias Kümmel

unread,
Jan 18, 2022, 4:03:15 AM1/18/22
to inception-users
Hi,


I didn't specify a driver or dialect - but switching to mariadb in the jdbc-URL worked.

Thank you very much for your help.
Reply all
Reply to author
Forward
0 new messages