I created a jar of a Scala application using maven-assembly-plugin
. Now when I execute the jar with java -jar path\to\jar\myapp.jar
it throws the following error:
Exception in thread "main" Exception in thread "Timer-0" java.lang.RuntimeException: java.sql.SQLException: No suitable driver found for jdbc:calcite:
at org.apache.calcite.tools.Frameworks.withPrepare(Frameworks.java:159)
at org.apache.calcite.tools.Frameworks.withPlanner(Frameworks.java:114)
Caused by: java.sql.SQLException: No suitable driver found for jdbc:calcite:
at java.sql.DriverManager.getConnection(Unknown Source)
at java.sql.DriverManager.getConnection(Unknown Source)
at org.apache.calcite.tools.Frameworks.withPrepare(Frameworks.java:153)
... 17 more
java.lang.RuntimeException: java.sql.SQLException: No suitable driver found for jdbc:calcite:
at org.apache.calcite.tools.Frameworks.withPrepare(Frameworks.java:159)
at org.apache.calcite.tools.Frameworks.withPlanner(Frameworks.java:114)
at java.util.TimerThread.mainLoop(Unknown Source)
at java.util.TimerThread.run(Unknown Source)
Caused by: java.sql.SQLException: No suitable driver found for jdbc:calcite:
at java.sql.DriverManager.getConnection(Unknown Source)
at java.sql.DriverManager.getConnection(Unknown Source)
at org.apache.calcite.tools.Frameworks.withPrepare(Frameworks.java:153)
... 8 more
When I run the application through an IDE (IntelliJ) it works fine.
Can anyone tell me why this is happening?
EDIT1: I opened the jar file and saw that the calcite-core
jar is present in org/apache/calcite
jar.
EDIT2: I tried changing the version of calcite-core
. I was using 1.15.0
earlier and now I'm using 1.18.0
but the error is still there.