Scala Error: java.sql.SQLException: No suitable driver found for jdbc:calcite:












0















I created a jar of a Scala application using maven-assembly-plugin. Now when I execute the jar with java -jar pathtojarmyapp.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.










share|improve this question

























  • Can you open your jar file (it should be possible to open it using any application, that can extract zip files) and check is there is directory org/apache/calcite inside?

    – Krzysztof Atłasik
    Jan 18 at 20:18











  • "The calcite-core jar is present in my classpath." How is it present on the class path according to you? The error indicates it isn't, and because you are using java -jar pathtojarmyapp.jar, the application will only use the classpath defined in META-INF/manifest.mf, not any external methods of defining classpath. For example having it in the environment variable CLASSPATH will not work, because the -jar option doesn't use that.

    – Mark Rotteveel
    Jan 19 at 10:44













  • I checked out the manifest.mf file. You were right. Having it or not having it in the CLASSPATH doesn't matter. But I opened my jar file and checked the org/apache/calcite directory. It is present there. What baffles me is that when I am running it on my IDE it's working and calcite-core is being detected but not when I am packaging it using Maven and running it.

    – rbh-93
    Jan 19 at 21:13
















0















I created a jar of a Scala application using maven-assembly-plugin. Now when I execute the jar with java -jar pathtojarmyapp.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.










share|improve this question

























  • Can you open your jar file (it should be possible to open it using any application, that can extract zip files) and check is there is directory org/apache/calcite inside?

    – Krzysztof Atłasik
    Jan 18 at 20:18











  • "The calcite-core jar is present in my classpath." How is it present on the class path according to you? The error indicates it isn't, and because you are using java -jar pathtojarmyapp.jar, the application will only use the classpath defined in META-INF/manifest.mf, not any external methods of defining classpath. For example having it in the environment variable CLASSPATH will not work, because the -jar option doesn't use that.

    – Mark Rotteveel
    Jan 19 at 10:44













  • I checked out the manifest.mf file. You were right. Having it or not having it in the CLASSPATH doesn't matter. But I opened my jar file and checked the org/apache/calcite directory. It is present there. What baffles me is that when I am running it on my IDE it's working and calcite-core is being detected but not when I am packaging it using Maven and running it.

    – rbh-93
    Jan 19 at 21:13














0












0








0


1






I created a jar of a Scala application using maven-assembly-plugin. Now when I execute the jar with java -jar pathtojarmyapp.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.










share|improve this question
















I created a jar of a Scala application using maven-assembly-plugin. Now when I execute the jar with java -jar pathtojarmyapp.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.







scala jdbc apache-calcite






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited yesterday







rbh-93

















asked Jan 18 at 18:42









rbh-93rbh-93

4110




4110













  • Can you open your jar file (it should be possible to open it using any application, that can extract zip files) and check is there is directory org/apache/calcite inside?

    – Krzysztof Atłasik
    Jan 18 at 20:18











  • "The calcite-core jar is present in my classpath." How is it present on the class path according to you? The error indicates it isn't, and because you are using java -jar pathtojarmyapp.jar, the application will only use the classpath defined in META-INF/manifest.mf, not any external methods of defining classpath. For example having it in the environment variable CLASSPATH will not work, because the -jar option doesn't use that.

    – Mark Rotteveel
    Jan 19 at 10:44













  • I checked out the manifest.mf file. You were right. Having it or not having it in the CLASSPATH doesn't matter. But I opened my jar file and checked the org/apache/calcite directory. It is present there. What baffles me is that when I am running it on my IDE it's working and calcite-core is being detected but not when I am packaging it using Maven and running it.

    – rbh-93
    Jan 19 at 21:13



















  • Can you open your jar file (it should be possible to open it using any application, that can extract zip files) and check is there is directory org/apache/calcite inside?

    – Krzysztof Atłasik
    Jan 18 at 20:18











  • "The calcite-core jar is present in my classpath." How is it present on the class path according to you? The error indicates it isn't, and because you are using java -jar pathtojarmyapp.jar, the application will only use the classpath defined in META-INF/manifest.mf, not any external methods of defining classpath. For example having it in the environment variable CLASSPATH will not work, because the -jar option doesn't use that.

    – Mark Rotteveel
    Jan 19 at 10:44













  • I checked out the manifest.mf file. You were right. Having it or not having it in the CLASSPATH doesn't matter. But I opened my jar file and checked the org/apache/calcite directory. It is present there. What baffles me is that when I am running it on my IDE it's working and calcite-core is being detected but not when I am packaging it using Maven and running it.

    – rbh-93
    Jan 19 at 21:13

















Can you open your jar file (it should be possible to open it using any application, that can extract zip files) and check is there is directory org/apache/calcite inside?

– Krzysztof Atłasik
Jan 18 at 20:18





Can you open your jar file (it should be possible to open it using any application, that can extract zip files) and check is there is directory org/apache/calcite inside?

– Krzysztof Atłasik
Jan 18 at 20:18













"The calcite-core jar is present in my classpath." How is it present on the class path according to you? The error indicates it isn't, and because you are using java -jar pathtojarmyapp.jar, the application will only use the classpath defined in META-INF/manifest.mf, not any external methods of defining classpath. For example having it in the environment variable CLASSPATH will not work, because the -jar option doesn't use that.

– Mark Rotteveel
Jan 19 at 10:44







"The calcite-core jar is present in my classpath." How is it present on the class path according to you? The error indicates it isn't, and because you are using java -jar pathtojarmyapp.jar, the application will only use the classpath defined in META-INF/manifest.mf, not any external methods of defining classpath. For example having it in the environment variable CLASSPATH will not work, because the -jar option doesn't use that.

– Mark Rotteveel
Jan 19 at 10:44















I checked out the manifest.mf file. You were right. Having it or not having it in the CLASSPATH doesn't matter. But I opened my jar file and checked the org/apache/calcite directory. It is present there. What baffles me is that when I am running it on my IDE it's working and calcite-core is being detected but not when I am packaging it using Maven and running it.

– rbh-93
Jan 19 at 21:13





I checked out the manifest.mf file. You were right. Having it or not having it in the CLASSPATH doesn't matter. But I opened my jar file and checked the org/apache/calcite directory. It is present there. What baffles me is that when I am running it on my IDE it's working and calcite-core is being detected but not when I am packaging it using Maven and running it.

– rbh-93
Jan 19 at 21:13












2 Answers
2






active

oldest

votes


















0














Seems there is a bug in the Apache Flink - https://issues.apache.org/jira/browse/FLINK-4581






share|improve this answer
























  • So, is there a workaround this problem?

    – rbh-93
    2 days ago



















0














Although I still haven't found a solution to the calcite-core driver problem, I managed to find another way to execute the jar.



I added the following two plugins to my pom.xml. The maven-dependency-plugincopies all the relevant dependency jars into a lib folder and the maven-jar-plugin makes a single executable jar file.



                <groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<configuration>
<outputDirectory>${project.build.directory}/lib</outputDirectory>
<excludeTransitive>false</excludeTransitive>
<stripVersion>false</stripVersion>
</configuration>
<executions>
<execution>
<id>copy-dependencies</id>
<phase>package</phase>
<goals>
<goal>copy-dependencies</goal>
</goals>
</execution>
</executions>
</plugin>

<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<version>2.4</version>
<configuration>
<archive>
<manifest>
<addClasspath>true</addClasspath>
<classpathPrefix>lib/</classpathPrefix>
<mainClass>com.example.MainClass</mainClass>
</manifest>
</archive>
</configuration>
</plugin>


Note: Adding <mainClass>com.example.MainClass</mainClass> will make manifest.mf aware of what the main class is.






share|improve this answer























    Your Answer






    StackExchange.ifUsing("editor", function () {
    StackExchange.using("externalEditor", function () {
    StackExchange.using("snippets", function () {
    StackExchange.snippets.init();
    });
    });
    }, "code-snippets");

    StackExchange.ready(function() {
    var channelOptions = {
    tags: "".split(" "),
    id: "1"
    };
    initTagRenderer("".split(" "), "".split(" "), channelOptions);

    StackExchange.using("externalEditor", function() {
    // Have to fire editor after snippets, if snippets enabled
    if (StackExchange.settings.snippets.snippetsEnabled) {
    StackExchange.using("snippets", function() {
    createEditor();
    });
    }
    else {
    createEditor();
    }
    });

    function createEditor() {
    StackExchange.prepareEditor({
    heartbeatType: 'answer',
    autoActivateHeartbeat: false,
    convertImagesToLinks: true,
    noModals: true,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: 10,
    bindNavPrevention: true,
    postfix: "",
    imageUploader: {
    brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
    contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
    allowUrls: true
    },
    onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    });


    }
    });














    draft saved

    draft discarded


















    StackExchange.ready(
    function () {
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f54259763%2fscala-error-java-sql-sqlexception-no-suitable-driver-found-for-jdbccalcite%23new-answer', 'question_page');
    }
    );

    Post as a guest















    Required, but never shown

























    2 Answers
    2






    active

    oldest

    votes








    2 Answers
    2






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes









    0














    Seems there is a bug in the Apache Flink - https://issues.apache.org/jira/browse/FLINK-4581






    share|improve this answer
























    • So, is there a workaround this problem?

      – rbh-93
      2 days ago
















    0














    Seems there is a bug in the Apache Flink - https://issues.apache.org/jira/browse/FLINK-4581






    share|improve this answer
























    • So, is there a workaround this problem?

      – rbh-93
      2 days ago














    0












    0








    0







    Seems there is a bug in the Apache Flink - https://issues.apache.org/jira/browse/FLINK-4581






    share|improve this answer













    Seems there is a bug in the Apache Flink - https://issues.apache.org/jira/browse/FLINK-4581







    share|improve this answer












    share|improve this answer



    share|improve this answer










    answered Jan 21 at 12:19









    Ramesh SubramanianRamesh Subramanian

    364118




    364118













    • So, is there a workaround this problem?

      – rbh-93
      2 days ago



















    • So, is there a workaround this problem?

      – rbh-93
      2 days ago

















    So, is there a workaround this problem?

    – rbh-93
    2 days ago





    So, is there a workaround this problem?

    – rbh-93
    2 days ago













    0














    Although I still haven't found a solution to the calcite-core driver problem, I managed to find another way to execute the jar.



    I added the following two plugins to my pom.xml. The maven-dependency-plugincopies all the relevant dependency jars into a lib folder and the maven-jar-plugin makes a single executable jar file.



                    <groupId>org.apache.maven.plugins</groupId>
    <artifactId>maven-dependency-plugin</artifactId>
    <configuration>
    <outputDirectory>${project.build.directory}/lib</outputDirectory>
    <excludeTransitive>false</excludeTransitive>
    <stripVersion>false</stripVersion>
    </configuration>
    <executions>
    <execution>
    <id>copy-dependencies</id>
    <phase>package</phase>
    <goals>
    <goal>copy-dependencies</goal>
    </goals>
    </execution>
    </executions>
    </plugin>

    <plugin>
    <groupId>org.apache.maven.plugins</groupId>
    <artifactId>maven-jar-plugin</artifactId>
    <version>2.4</version>
    <configuration>
    <archive>
    <manifest>
    <addClasspath>true</addClasspath>
    <classpathPrefix>lib/</classpathPrefix>
    <mainClass>com.example.MainClass</mainClass>
    </manifest>
    </archive>
    </configuration>
    </plugin>


    Note: Adding <mainClass>com.example.MainClass</mainClass> will make manifest.mf aware of what the main class is.






    share|improve this answer




























      0














      Although I still haven't found a solution to the calcite-core driver problem, I managed to find another way to execute the jar.



      I added the following two plugins to my pom.xml. The maven-dependency-plugincopies all the relevant dependency jars into a lib folder and the maven-jar-plugin makes a single executable jar file.



                      <groupId>org.apache.maven.plugins</groupId>
      <artifactId>maven-dependency-plugin</artifactId>
      <configuration>
      <outputDirectory>${project.build.directory}/lib</outputDirectory>
      <excludeTransitive>false</excludeTransitive>
      <stripVersion>false</stripVersion>
      </configuration>
      <executions>
      <execution>
      <id>copy-dependencies</id>
      <phase>package</phase>
      <goals>
      <goal>copy-dependencies</goal>
      </goals>
      </execution>
      </executions>
      </plugin>

      <plugin>
      <groupId>org.apache.maven.plugins</groupId>
      <artifactId>maven-jar-plugin</artifactId>
      <version>2.4</version>
      <configuration>
      <archive>
      <manifest>
      <addClasspath>true</addClasspath>
      <classpathPrefix>lib/</classpathPrefix>
      <mainClass>com.example.MainClass</mainClass>
      </manifest>
      </archive>
      </configuration>
      </plugin>


      Note: Adding <mainClass>com.example.MainClass</mainClass> will make manifest.mf aware of what the main class is.






      share|improve this answer


























        0












        0








        0







        Although I still haven't found a solution to the calcite-core driver problem, I managed to find another way to execute the jar.



        I added the following two plugins to my pom.xml. The maven-dependency-plugincopies all the relevant dependency jars into a lib folder and the maven-jar-plugin makes a single executable jar file.



                        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-dependency-plugin</artifactId>
        <configuration>
        <outputDirectory>${project.build.directory}/lib</outputDirectory>
        <excludeTransitive>false</excludeTransitive>
        <stripVersion>false</stripVersion>
        </configuration>
        <executions>
        <execution>
        <id>copy-dependencies</id>
        <phase>package</phase>
        <goals>
        <goal>copy-dependencies</goal>
        </goals>
        </execution>
        </executions>
        </plugin>

        <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-jar-plugin</artifactId>
        <version>2.4</version>
        <configuration>
        <archive>
        <manifest>
        <addClasspath>true</addClasspath>
        <classpathPrefix>lib/</classpathPrefix>
        <mainClass>com.example.MainClass</mainClass>
        </manifest>
        </archive>
        </configuration>
        </plugin>


        Note: Adding <mainClass>com.example.MainClass</mainClass> will make manifest.mf aware of what the main class is.






        share|improve this answer













        Although I still haven't found a solution to the calcite-core driver problem, I managed to find another way to execute the jar.



        I added the following two plugins to my pom.xml. The maven-dependency-plugincopies all the relevant dependency jars into a lib folder and the maven-jar-plugin makes a single executable jar file.



                        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-dependency-plugin</artifactId>
        <configuration>
        <outputDirectory>${project.build.directory}/lib</outputDirectory>
        <excludeTransitive>false</excludeTransitive>
        <stripVersion>false</stripVersion>
        </configuration>
        <executions>
        <execution>
        <id>copy-dependencies</id>
        <phase>package</phase>
        <goals>
        <goal>copy-dependencies</goal>
        </goals>
        </execution>
        </executions>
        </plugin>

        <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-jar-plugin</artifactId>
        <version>2.4</version>
        <configuration>
        <archive>
        <manifest>
        <addClasspath>true</addClasspath>
        <classpathPrefix>lib/</classpathPrefix>
        <mainClass>com.example.MainClass</mainClass>
        </manifest>
        </archive>
        </configuration>
        </plugin>


        Note: Adding <mainClass>com.example.MainClass</mainClass> will make manifest.mf aware of what the main class is.







        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered yesterday









        rbh-93rbh-93

        4110




        4110






























            draft saved

            draft discarded




















































            Thanks for contributing an answer to Stack Overflow!


            • Please be sure to answer the question. Provide details and share your research!

            But avoid



            • Asking for help, clarification, or responding to other answers.

            • Making statements based on opinion; back them up with references or personal experience.


            To learn more, see our tips on writing great answers.




            draft saved


            draft discarded














            StackExchange.ready(
            function () {
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f54259763%2fscala-error-java-sql-sqlexception-no-suitable-driver-found-for-jdbccalcite%23new-answer', 'question_page');
            }
            );

            Post as a guest















            Required, but never shown





















































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown

































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown







            Popular posts from this blog

            Liquibase includeAll doesn't find base path

            How to use setInterval in EJS file?

            Petrus Granier-Deferre