You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Issue Summary
The BPN Discovery application fails to start due to an inability to load the H2 database driver. Steps to Reproduce:
Checked out both the bpndiscovery-0.3.1 (latest) and bpndiscovery-0.2.3 (older) versions of the BPN Discovery repository.
Configured the application.properties file with the following settings:
properties
spring.datasource.url=jdbc:h2:mem:testdb
spring.datasource.driver-class-name=org.h2.Driver
spring.datasource.username=sa
spring.datasource.password=
spring.h2.console.enabled=true
spring.h2.console.path=/h2-console
Rebuilt the project using mvn clean install and java -jar backend/target/bpn-discovery-backend-{current-version}.jar --spring.profiles.active=local.
Actual Results:
The application fails to start, and the following error is logged:
Caused by: java.lang.ClassNotFoundException: org.h2.Driver
at java.base/java.net.URLClassLoader.findClass(URLClassLoader.java:445)
at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:592)
...
Caused by: org.springframework.beans.factory.BeanCreationException:
Error creating bean with name 'dataSource' defined in class path resource
[org/springframework/boot/autoconfigure/jdbc/DataSourceConfiguration$Hikari.class]:
Failed to instantiate [com.zaxxer.hikari.HikariDataSource]: Factory method 'dataSource'
threw exception with message: Cannot load driver class: org.h2.Driver Expected Results:
The application should start successfully using the H2 in-memory database. Attempts to Resolve:
Verified that the H2 dependency is included in the pom.xml file:
xml
com.h2database
h2
2.1.210
runtime
Checked the application.properties file for correct configuration.
Rebuilt the project to ensure dependencies are correctly resolved.
Ran the application with debug enabled to gather more detailed logs.
Environment
Versions Tried: Checked out both thebpndiscovery-0.3.1(latest) andbpndiscovery-0.2.3` (older) versions of the BPN Discovery repository.
Java Version: 17.0.12
Spring Boot Version: 3.3.1
Operating System: Ubuntu 22.04.3 LTS (with Linux kernel 5.15.0-94-generic). Attachments:
All the tests in the project run successfully, indicating that the unit and integration tests are passing. However, when I run the application, I encounter runtime errors related to the H2 database driver, which prevent the application from starting. The detailed error logs are attached below for reference.
The text was updated successfully, but these errors were encountered:
Issue Summary
The BPN Discovery application fails to start due to an inability to load the H2 database driver.
Steps to Reproduce:
Checked out both the
bpndiscovery-0.3.1
(latest) andbpndiscovery-0.2.3
(older) versions of the BPN Discovery repository.Configured the
application.properties
file with the following settings:properties
spring.datasource.url=jdbc:h2:mem:testdb
spring.datasource.driver-class-name=org.h2.Driver
spring.datasource.username=sa
spring.datasource.password=
spring.h2.console.enabled=true
spring.h2.console.path=/h2-console
mvn clean install
andjava -jar backend/target/bpn-discovery-backend-{current-version}.jar --spring.profiles.active=local
.Actual Results:
The application fails to start, and the following error is logged:
Caused by: java.lang.ClassNotFoundException: org.h2.Driver
at java.base/java.net.URLClassLoader.findClass(URLClassLoader.java:445)
at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:592)
...
Caused by: org.springframework.beans.factory.BeanCreationException:
Error creating bean with name 'dataSource' defined in class path resource
[org/springframework/boot/autoconfigure/jdbc/DataSourceConfiguration$Hikari.class]:
Failed to instantiate [com.zaxxer.hikari.HikariDataSource]: Factory method 'dataSource'
threw exception with message: Cannot load driver class: org.h2.Driver
Expected Results:
The application should start successfully using the H2 in-memory database.
Attempts to Resolve:
pom.xml
file:xml
com.h2database
h2
2.1.210
runtime
application.properties
file for correct configuration.Environment
Checked out both the
bpndiscovery-0.3.1(latest) and
bpndiscovery-0.2.3` (older) versions of the BPN Discovery repository.Attachments:
All the tests in the project run successfully, indicating that the unit and integration tests are passing. However, when I run the application, I encounter runtime errors related to the H2 database driver, which prevent the application from starting. The detailed error logs are attached below for reference.
The text was updated successfully, but these errors were encountered: