-5

I'm doing a scala-spark app that gets data from MySQL. If I run from eclipse it works. However, if I create the .jar and execute it with spark-submit does not work, and an error appears:

Exception in thread "main" java.sql.SQLException: No suitable driver

So I think there are not dependencies at the created jar. I think I'm not setting the right plugin to compile with dependencies at pom.xml. Do you know which one is the plugin to do it?

Thank you, regards!

  • you need to create a fat jar, so that all your dependency jars are available while you are running your jar file using spark-submit commands, for more details [check this url](https://stackoverflow.com/a/39089418/1025328) – Prasad Khode Jun 19 '19 at 07:22

1 Answers1

0

u can use "--jars $(echo lib/*.jar | tr ' ' ',')" option in the spark-submit , and put all your dependencies jar in lib folder .

udyan
  • 141
  • 5
  • Hi udyan, I would like to create the jar with all the dependencies directly from eclipse. – jalollo Jun 21 '19 at 12:17
  • Hi jalollo , if u are using maven then u can create a uber jar ,Check the link https://stackoverflow.com/questions/11947037/what-is-an-uber-jar – udyan Jun 24 '19 at 14:59