Home > other >  Run the spark program mysql library data obtained through jdbcRDD throw a ClassNotFoundException
Run the spark program mysql library data obtained through jdbcRDD throw a ClassNotFoundException

Time:09-24

Beginners spark, learning to use jdbcRDD retrieve data from a mysql, through maven package uploaded to the cluster, and spark - submit, after the start of the task execution thrown directly after the "Java. Lang. ClassNotFoundException: com. Mysql. JDBC. Exceptions. Jdbc4. MySQLSyntaxErrorException" :
 Java. Lang. ClassNotFoundException: com. Mysql. JDBC. Exceptions. Jdbc4. MySQLSyntaxErrorException 
The at java.net.URLClassLoader.findClass URLClassLoader. Java: (381)
The at Java. Lang. This. LoadClass (424). This Java:
At sun. Misc. The Launcher $AppClassLoader. LoadClass (331). The Launcher Java:
The at Java. Lang. This. LoadClass (357). This Java:
The at Java. Lang. Class. ForName0 (Native Method)
The at Java. Lang. Class.forname (348) Class. Java:
The at org. Apache. Spark. Serializer. JavaDeserializationStream $$$1. -anon resolveClass (JavaSerializer. Scala: 67)
The at Java. IO. ObjectInputStream. ReadNonProxyDesc (ObjectInputStream. Java: 1620)
The at Java. IO. ObjectInputStream. ReadClassDesc (ObjectInputStream. Java: 1521)
The at Java. IO. ObjectInputStream. ReadOrdinaryObject (ObjectInputStream. Java: 1781)
The at Java. IO. ObjectInputStream. ReadObject0 (ObjectInputStream. Java: 1353)
The at Java. IO. ObjectInputStream. ReadObject (ObjectInputStream. Java: 373)
The at org. Apache. Spark. ThrowableSerializationWrapper. ReadObject (TaskEndReason. Scala: 167)
At sun. Reflect. NativeMethodAccessorImpl. Invoke0 (Native Method)
At sun. Reflect. NativeMethodAccessorImpl. Invoke (NativeMethodAccessorImpl. Java: 62)
At sun. Reflect. DelegatingMethodAccessorImpl. Invoke (43) DelegatingMethodAccessorImpl. Java:
The at Java. Lang. Reflect. Method. Invoke (498) Method. The Java:
The at Java. IO. ObjectStreamClass. InvokeReadObject (ObjectStreamClass. Java: 1058)
The at Java. IO. ObjectInputStream. ReadSerialData (ObjectInputStream. Java: 1909)
The at Java. IO. ObjectInputStream. ReadOrdinaryObject (ObjectInputStream. Java: 1808)
The at Java. IO. ObjectInputStream. ReadObject0 (ObjectInputStream. Java: 1353)
The at Java. IO. ObjectInputStream. DefaultReadFields (ObjectInputStream. Java: 2018)
The at Java. IO. ObjectInputStream. ReadSerialData (ObjectInputStream. Java: 1942)
The at Java. IO. ObjectInputStream. ReadOrdinaryObject (ObjectInputStream. Java: 1808)
The at Java. IO. ObjectInputStream. ReadObject0 (ObjectInputStream. Java: 1353)
The at Java. IO. ObjectInputStream. DefaultReadFields (ObjectInputStream. Java: 2018)
The at Java. IO. ObjectInputStream. ReadSerialData (ObjectInputStream. Java: 1942)
The at Java. IO. ObjectInputStream. ReadOrdinaryObject (ObjectInputStream. Java: 1808)
The at Java. IO. ObjectInputStream. ReadObject0 (ObjectInputStream. Java: 1353)
The at Java. IO. ObjectInputStream. ReadObject (ObjectInputStream. Java: 373)
The at org. Apache. Spark. Serializer. JavaDeserializationStream. ReadObject (JavaSerializer. Scala: 72)
The at org. Apache. Spark. Serializer. JavaSerializerInstance. Deserialize (JavaSerializer. Scala: 98)
The at org. Apache. Spark. The scheduler. TaskResultGetter $$-anon $3 $$$run anonfun $2. Apply $MCV $sp (TaskResultGetter. Scala: 108)
The at org. Apache. Spark. The scheduler. TaskResultGetter $$-anon $3 $$$run anonfun $2. Apply (TaskResultGetter. Scala: 105)
The at org. Apache. Spark. The scheduler. TaskResultGetter $$-anon $3 $$$run anonfun $2. Apply (TaskResultGetter. Scala: 105)
The at org. Apache. Spark. Util. Utils $. LogUncaughtExceptions (Utils. Scala: 1698)
At org. Apache. Spark. The scheduler. TaskResultGetter $$$3. -anon run (105). TaskResultGetter scala:
The at Java. Util. Concurrent. ThreadPoolExecutor. RunWorker (ThreadPoolExecutor. Java: 1142)
The at Java. Util. Concurrent. ThreadPoolExecutor $Worker. The run (ThreadPoolExecutor. Java: 617)
The at Java. Lang. Thread. The run (Thread. Java: 745)


Found this MySQLSyntaxErrorException class carefully, and exists in the maven dependence on import package, maven configuration:
 & lt; ? The XML version="1.0" encoding="utf-8"?> 
XMLNS: xsi="http://www.w3.org/2001/XMLSchema-instance"
Xsi: schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" & gt;
4.0.0 & lt;/modelVersion>

Com. Ivifi
MacMatch - spark
1.0 - SNAPSHOT


Org. Apache. Spark
The spark - core_2. 10 & lt;/artifactId>
1.5.0 & lt;/version>
Provided


Com. Alibaba
Fastjson
1.2.9 & lt;/version>


Org. Apache. Hbase
Hbase - client
1.0.0 & lt;/version>


Org. Apache. Hadoop
Hadoop - common


Org. Apache. Hadoop
Hadoop - auth
nullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnull
  • Related