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
When trying to connect with a faulty driver path, the logged error is confusing by providing too much data.
WARN - Provided -dp(driverPath) '/Users/****/.m2/repository/com/mysql/mysql-connector-java/8.0.28/mysql-connector-java-8.0.28.jar' doesn't exist
WARN - Connection Failure
Failed to connect to database URL [jdbc:mysql://localhost:43057/htmlit] Failed to create driver from driver class. Failed to create any of 'com.mysql.cj.jdbc.Driver, com.mysql.jdbc.Driver' driver from driver path.
We might have grouped too much into the "Connection Failure" category. Since the connection string isn't important.
I think we wrap three different exceptions which is probably unnecessary due to the fact that anything that is related to Connection (actually, connecting) or creating a driver is fatal/unrecoverable. Needs user intervention.
So the assumption would be that it shouldn't be caught either bubble all the way out of the application or it should be caught in SchemaSpyRunner to manage exit code.
WARN - Connection Failure
org.schemaspy.input.dbms.exceptions.ConnectionFailure: Failed to connect to database URL [jdbc:mysql://localhost:43057/htmlit] Failed to create driver from driver class. Failed to create any of 'com.mysql.cj.jdbc.Driver, com.mysql.jdbc.Driver' driver from driver path.
at org.schemaspy.connection.ScExceptionChecked.connection(ScExceptionChecked.java:26)
at org.schemaspy.input.dbms.service.SqlService.connect(SqlService.java:74)
at org.schemaspy.SchemaAnalyzer.analyze(SchemaAnalyzer.java:275)
at org.schemaspy.SchemaAnalyzer.analyze(SchemaAnalyzer.java:159)
at org.schemaspy.cli.SchemaSpyRunner.run(SchemaSpyRunner.java:66)
at org.schemaspy.Main.run(Main.java:145)
at org.schemaspy.Main.main(Main.java:89)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:568)
at org.springframework.boot.loader.MainMethodRunner.run(MainMethodRunner.java:49)
at org.springframework.boot.loader.Launcher.launch(Launcher.java:95)
at org.springframework.boot.loader.Launcher.launch(Launcher.java:58)
at org.springframework.boot.loader.JarLauncher.main(JarLauncher.java:65)
Caused by: org.schemaspy.input.dbms.exceptions.ConnectionFailure: Failed to create driver from driver class. Failed to create any of 'com.mysql.cj.jdbc.Driver, com.mysql.jdbc.Driver' driver from driver path.
at org.schemaspy.input.dbms.driver.DsDriverClass.driver(DsDriverClass.java:25)
at org.schemaspy.input.dbms.driver.DsCached.driver(DsCached.java:24)
at org.schemaspy.input.dbms.DbDriverLoader.driver(DbDriverLoader.java:76)
at org.schemaspy.input.dbms.DriverFromConfig.driver(DriverFromConfig.java:23)
at org.schemaspy.connection.ScSimple.connection(ScSimple.java:50)
at org.schemaspy.connection.ScNullChecked.connection(ScNullChecked.java:21)
at org.schemaspy.connection.ScExceptionChecked.connection(ScExceptionChecked.java:23)
... 14 common frames omitted
Caused by: org.schemaspy.input.dbms.exceptions.ConnectionFailure: Failed to create any of 'com.mysql.cj.jdbc.Driver, com.mysql.jdbc.Driver' driver from driver path.
at org.schemaspy.input.dbms.driverclass.DcFacade.value(DcFacade.java:44)
at org.schemaspy.input.dbms.driver.DsDriverClass.driver(DsDriverClass.java:23)
... 20 common frames omitted
Solutions to to be discussed would be
Don't catch exception, it's too broad.
Check if ConnectionFailure and re-throw it instead of wrapping.
As a side-note, ConnectionFailure should probably be logged as ERROR and not WARN.
The text was updated successfully, but these errors were encountered:
When trying to connect with a faulty driver path, the logged error is confusing by providing too much data.
We might have grouped too much into the "Connection Failure" category. Since the connection string isn't important.
I think we wrap three different exceptions which is probably unnecessary due to the fact that anything that is related to Connection (actually, connecting) or creating a driver is fatal/unrecoverable. Needs user intervention.
So the assumption would be that it shouldn't be caught either bubble all the way out of the application or it should be caught in SchemaSpyRunner to manage exit code.
Solutions to to be discussed would be
As a side-note, ConnectionFailure should probably be logged as ERROR and not WARN.
The text was updated successfully, but these errors were encountered: