简体   繁体   English

即使在类路径中包含jar,也找不到Eclipse Class异常

[英]Eclipse Class not found Exception even when jars are included in classpath

Running java mapreduce program on Biginsights server from Eclipse gives com.mysql.jdbc.Driver ClassNotFoundException even though jars are included in classpath 即使在类路径中包含jar,从Eclipse在Biginsights服务器上运行Java mapreduce程序也会产生com.mysql.jdbc.Driver ClassNotFoundException

Error : 错误:

The system encountered the following error while it was submitting the job:
15/03/26 18:59:29 WARN mapred.JobClient: Use GenericOptionsParser for parsing the arguments. Applications should implement Tool for the same.
15/03/26 18:59:29 INFO mapred.JobClient: Cleaning up the staging area hdfs://biginsights-node:9000/user/biadmin/.staging/job_201503261700_0014
Exception in thread "main" java.lang.RuntimeException: java.lang.RuntimeException: java.lang.ClassNotFoundException: com.mysql.jdbc.Driver
    at org.apache.hadoop.mapreduce.lib.db.DBInputFormat.setConf(DBInputFormat.java:164)
    at org.apache.hadoop.util.ReflectionUtils.setConf(ReflectionUtils.java:73)
    at org.apache.hadoop.util.ReflectionUtils.newInstance(ReflectionUtils.java:133)
    at org.apache.hadoop.mapred.JobClient.writeNewSplits(JobClient.java:1079)
    at org.apache.hadoop.mapred.JobClient.writeSplits(JobClient.java:1099)
    at org.apache.hadoop.mapred.JobClient.access$700(JobClient.java:188)
    at org.apache.hadoop.mapred.JobClient$2.run(JobClient.java:1010)
    at org.apache.hadoop.mapred.JobClient$2.run(JobClient.java:963)
    at java.security.AccessController.doPrivileged(AccessController.java:366)
    at javax.security.auth.Subject.doAs(Subject.java:572)
    at org.apache.hadoop.security.UserGroupInformation.doAs(UserGroupInformation.java:1502)
    at org.apache.hadoop.mapred.JobClient.submitJobInternal(JobClient.java:963)
    at org.apache.hadoop.mapreduce.Job.submit(Job.java:616)
    at org.apache.hadoop.mapreduce.Job.waitForCompletion(Job.java:646)
    at example.DbExportMainClass.main(DbExportMainClass.java:51)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:94)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:55)
    at java.lang.reflect.Method.invoke(Method.java:619)
    at org.apache.hadoop.util.RunJar.main(RunJar.java:212)
Caused by: java.lang.RuntimeException: java.lang.ClassNotFoundException: com.mysql.jdbc.Driver
    at org.apache.hadoop.mapreduce.lib.db.DBInputFormat.getConnection(DBInputFormat.java:190)
    at org.apache.hadoop.mapreduce.lib.db.DBInputFormat.setConf(DBInputFormat.java:158)
    ... 19 more
Caused by: java.lang.ClassNotFoundException: com.mysql.jdbc.Driver
    at java.lang.Class.forNameImpl(Native Method)
    at java.lang.Class.forName(Class.java:199)
    at org.apache.hadoop.mapreduce.lib.db.DBConfiguration.getConnection(DBConfiguration.java:148)
    at org.apache.hadoop.mapreduce.lib.db.DBInputFormat.getConnection(DBInputFormat.java:184)
    ... 20 more

Tried almost all suggestions for similar issues available in stackoverflow. 尝试了关于stackoverflow中类似问题的几乎所有建议。

Any suggestion will be helpful. 任何建议都会有所帮助。

You need to include jar in Biginsight lib folder to run it as Biginsights Application. 您需要在Biginsight lib文件夹中包含jar才能将其作为Biginsights应用程序运行。 Also add path to biginsights-env file. 还将路径添加到biginsights-env文件。

default location : /opt/ibm/biginsights/IHC/lib 默认位置: / opt / ibm / biginsights / IHC / lib

To run as java application should be added to classpath. 要作为Java应用程序运行,应将其添加到classpath中。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 找不到MySQL驱动程序类,即使包含在classpath中 - MySQL driver class not found, even when included in classpath 即使jar在classpath上,也无法找到类异常/调试classpath问题 - Class not found exception even if the jar is on the classpath / debugging classpath problems "即使在类路径中的 Jar 中也找不到类" - Class not found even when in Jar in the classpath 我在Netbeans的类路径中包含的许多jar的获取“找不到类”错误 - Gettting “Class not found” error for many jars that I have included in classpath in Netbeans hadoop类未找到异常,即使它在hadoop类路径中 - hadoop class not found exception even though its there in hadoop classpath Maven已下载到我的本地存储库中的JAR包含在classpath中,但是找不到吗? - JARs that Maven have downloaded to my local repository is included in classpath but not found? “找不到类:JDBC 驱动程序 org.apache.derby.jdbc.EmbeddedDriver 无法加载”尽管已在类路径中包含所需的 JARs - "Class Not Found: JDBC driver org.apache.derby.jdbc.EmbeddedDriver could not be loaded" despite having included required JARs in classpath 当eclipse中包含foc jar时,图标消失 - When foc jars included in eclipse, the icons disapeared 找不到类在eclipse中运行时出现异常 - Getting class not found Exception when running in eclipse 当WEB-INF / lib和CLASSPATH中包含同一Jar时,类强制转换异常 - Class Cast Exception When Same Jar is Included in WEB-INF/lib and CLASSPATH
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM