I have set the variable in ~/.bashrc
export HADOOP_CLASSPATH=$HADOOP_CLASSPATH:/usr/lcoal/Hbase/lib/hbase-client-1.2.4.jar
but when i compile the code
java -cp $HADOOP_CLASSPATH:/home/hadoopuser/Downloads/myjar.jar com.bigdata.uniquecoder.WordCountClass
It still gives me this error.
Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/hadoop/hbase/HBaseConfiguration
at com.bigdata.uniquecoder.WordCountClass.main(WordCountClass.java:57)
Caused by:java.lang.ClassNotFoundException:org.apache.hadoop.hbase.HBaseConfiguration at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:331)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357) ... 1 more
NOTE: It works fine when i run it in eclipse but when running on top of hadoop gives this error.
Any help will be highly appreciated.
Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/hadoop/hbase/HBaseConfiguration
The missing class will be present in hbase-common-x.y.z.jar
Update the $HADOOP_CLASSPATH with
export HADOOP_CLASSPATH=$HADOOP_CLASSPATH:/usr/local/Hbase/lib/hbase-common-1.2.4.jar
Or,
export HADOOP_CLASSPATH=$HADOOP_CLASSPATH:/usr/local/Hbase/lib/
this will load all the jars under $HBASE_HOME/lib
Make sure $HADOOP_CLASSPATH contains necessary HADOOP libraries. Else, use the below export command in ~/.bashrc
export HADOOP_CLASSPATH=$HADOOP_HOME/share/hadoop/common/:$HADOOP_HOME/share/hadoop/common/lib/:$HADOOP_HOME/share/hadoop/hdfs/:$HADOOP_HOME/share/hadoop/hdfs/lib/:$HADOOP_HOME/share/hadoop/yarn/:$HADOOP_HOME/share/hadoop/yarn/lib/:/usr/local/Hbase/lib/:$CLASSPATH
Related
Unable to execute testNG in CMD prompt.
I'm getting this error:
java.lang.ClassNotFoundException: com.google.gson.JsonObject
I have all the jars in my build path. gson-2.8.2.jar and all the selenium supported jars and even testng jars.
java.lang.NoClassDefFoundError: com/google/gson/JsonObject Caused by:
java.lang.ClassNotFoundException: com.google.gson.JsonObject
Command used to run:
java -cp bin;jarslib/* org.testng.TestNG testng.xml
All the jars in my JarsLib folder
I found the solution, I've added into my resource but not added into my environment variable. Once I added, it's working fine.
Trying to run a simple hdfs query failed with:
[ms#cosmosmaster-gi ~]$ hadoop fs -ls /user/ms/def_serv/def_servpath
Java HotSpot(TM) 64-Bit Server VM warning: Insufficient space for shared memory file:
/tmp/hsperfdata_ms/21066
Try using the -Djava.io.tmpdir= option to select an alternate temp location.
Exception in thread "main" java.lang.NoClassDefFoundError: ___/tmp/hsperfdata_ms/21078
Caused by: java.lang.ClassNotFoundException: ___.tmp.hsperfdata_ms.21078
at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
Could not find the main class: ___/tmp/hsperfdata_ms/21078. Program will exit.
Any idea how to fix that or increase quota?
Thanks!
ms
Your quota has not been exceeded (see command below), but this was a problem with the cluster. It should be fixed now.
$ hadoop fs -dus /user/ms
hdfs://cosmosmaster-gi/user/ms 90731
When I tried to run a simple map reduce program talking to Cassandra, I get the following error. I am using Hadoop 2.2 and Cassandra 2.0.2. Can someone who solved this problem please respond back with the solution?
Exception in thread "main" java.lang.IncompatibleClassChangeError: Found interface org.apache.hadoop.mapreduce.JobContext, but class was expected
at org.apache.cassandra.hadoop.AbstractColumnFamilyInputFormat.getSplits(AbstractColumnFamilyInputFormat.java:116)
at org.apache.hadoop.mapreduce.JobSubmitter.writeNewSplits(JobSubmitter.java:491)
at org.apache.hadoop.mapreduce.JobSubmitter.writeSplits(JobSubmitter.java:508)
at org.apache.hadoop.mapreduce.JobSubmitter.submitJobInternal(JobSubmitter.java:392)
at org.apache.hadoop.mapreduce.Job$10.run(Job.java:1268)
at org.apache.hadoop.mapreduce.Job$10.run(Job.java:1265)
at java.security.AccessController.doPrivileged(Native Method)
at javax.security.auth.Subject.doAs(Subject.java:415)
at org.apache.hadoop.security.UserGroupInformation.doAs(UserGroupInformation.java:1491)
at org.apache.hadoop.mapreduce.Job.submit(Job.java:1265)
at org.apache.hadoop.mapreduce.Job.waitForCompletion(Job.java:1286)
While installing opengts - have been running initdb a java tool. Initially face class not found error for mysql. fixed that and later have been facing "classnotfoundexception" for SQLClientException. I believe it should be part of rt.jar. However by adding above jar in classpath, has not solved the problem. please help with some pointers.
thanks,
C:\workspace_vilas\OpenGTS_2.4.5\OpenGTS_2.4.5>bin\initdb.bat "rootUser=root" "rootPass= "
"c:\program files\java\jdk1.6.0\bin\java" "-Dfile.encoding=UTF-8" -classpath "C:\workspace_vilas\OpenGTS_2.4.5\OpenGTS_2.4.5\build\lib"\gtsdb.jar;"C:\workspace_
vilas\OpenGTS_2.4.5\OpenGTS_2.4.5\build\lib"\gtsutils.jar;"C:\workspace_vilas\OpenGTS_2.4.5\OpenGTS_2.4.5\build\lib"\optdb.jar;"C:\workspace_vilas\OpenGTS_2.4.5\OpenGTS_2.4.5\build\lib"\ruledb.jar;"C:\workspace_vilas\OpenGTS_2.4.5\OpenGTS_24.5\build\lib"\bcrossdb.jar;"C:\workspace_vilas\OpenGTS_2.4.5\OpenGTS_2.4.build\lib"\custom.jar;"C:\workspace_vilas\OpenGTS_2.4.5\OpenGTS_2.4.5\build\lib"\dmtpserv.jar;"C:\workspace_vilas\OpenGTS_2.4.5\OpenGTS_2.4.5\build\lib"\gtsdmtp.jar;C:\workspace_vilas\OpenGTS_2.4.5\OpenGTS_2.4.5\otherlibs\mysql-connector-java-5.1.22-bin.jar;C:\workspace_vilas\OpenGTS_2.4.5\OpenGTS_2.4.5\otherlibs\rt.jar;C:\workspace_vilas\javamail1_4_4\javamail-1.4.4\mail.jar;"C:\Program Files\Java\jdk1.6.0\jre\lib\ext\mysql-connector-java-5.1.22-bin.jar";"C:\Program Files\Java\jdk1.6.0\jre\lib\ext\rt.jar"; org.opengts.db.DBConfig -conf:"C:\workspace_vilas\OpenGTS_2.4.5\OpenGTS_2.4.5\default.conf" -log.file.enable:false -initTables "rootUser=root" "rootPass= "Version: 2.4.5
Exception in thread "main" java.lang.NoClassDefFoundError: java/sql/SQLClientInfoException
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:164)
at com.mysql.jdbc.ConnectionImpl.(ConnectionImpl.java:292)
at com.mysql.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java
:334)
at java.sql.DriverManager.getConnection(DriverManager.java:549)
at java.sql.DriverManager.getConnection(DriverManager.java:181)
at org.opengts.dbtools.DBConnection.getConnection(DBConnection.java:606)
at org.opengts.dbtools.DBConnection.createStatement(DBConnection.java:71
6)
at org.opengts.dbtools.DBConnection.createStatement(DBConnection.java:70
4)
at org.opengts.dbtools.DBConnection._executeUpdate(DBConnection.java:950
)
at org.opengts.dbtools.DBConnection.executeUpdate(DBConnection.java:908)
at org.opengts.dbtools.DBConnection.executeUpdate(DBConnection.java:889)
at org.opengts.dbtools.DBProvider.createDatabase(DBProvider.java:1422)
at org.opengts.dbtools.DBAdmin.execCommands(DBAdmin.java:809)
at org.opengts.db.DBConfig._main(DBConfig.java:1246)
at org.opengts.db.DBConfig.main(DBConfig.java:1361)
I have started to look at Hudson as a replacement for CruiseControl. I would like to use it to monitor external jobs as well. I have tried to follow the advice on this page: Monitoring External Jobs
When I run this command:
java -jar hudson-core-1.309.jar
I get this error:
Exception in thread "main" java.lang.NoClassDefFoundError: javax/servlet/http/HttpServletRequest
at hudson.EnvVars.initMaster(EnvVars.java:197)
at hudson.EnvVars.(EnvVars.java:192)
at hudson.Main.getHudsonHome(Main.java:71)
at hudson.Main.run(Main.java:61)
at hudson.Main.main(Main.java:53)
Caused by: java.lang.ClassNotFoundException: javax.servlet.http.HttpServletRequest
Add servlet.jar to the executing classpath. hudson-core-1.309.jar is built to run in a web container and thus doesn't have that included.