0

I am building the jar and I'm using this jar in one the my .war. When I run the program I am getting the below exception. But in that jar file, that particular class is there.

Error: java.lang.RuntimeException: java.lang.ClassNotFoundException: Class com.itc.zeas.custominputformat.CustomTextInputFormat not found
  at org.apache.hadoop.conf.Configuration.getClass(Configuration.java:2195) 
  at org.apache.hadoop.mapreduce.task.JobContextImpl.getInputFormatClass(JobContextImpl.java:174) 
  at org.apache.hadoop.mapred.MapTask.runNewMapper(MapTask.java:749) 
  at org.apache.hadoop.mapred.MapTask.run(MapTask.java:341) 
  at org.apache.hadoop.mapred.YarnChild$2.run(YarnChild.java:168) 
  at java.security.AccessController.doPrivileged(Native Method) 
  at 
Ole V.V.
  • 81,772
  • 15
  • 137
  • 161
Chaitra Bannihatti
  • 201
  • 1
  • 4
  • 10

1 Answers1

0

A quick search turned this up.

Your classpath is broken (which is a very common problem in the Java world).

Depending on how you start your application, you need to revise the argument to -cp, your Class-Path entry in MANIFEST.MF or your disk layout.

Maybe you should post more information? Which tools are you using to develop the program, which parameters when compiling, etc..

Titulum
  • 9,928
  • 11
  • 41
  • 79
  • in the same jar, the other class file is working that too in the same package. But this CustomTextInputFormat.class is not found – Chaitra Bannihatti Jan 13 '17 at 12:41
  • Are you sure you are correctly referencing the class? Could you check if the class truly resides in `com.itc.zeas.custominputformat.CustomTextInputFormat`? – Titulum Jan 13 '17 at 12:47
  • Yes, the class exactly resides inside the same path. And im using fully qualified class name also. – Chaitra Bannihatti Jan 13 '17 at 12:48
  • Hmmmm... Maybe take a look at [this](https://stackoverflow.com/questions/19757355/classnotfoundexception-upon-running-jar-no-errors-while-running-in-intellij-ide) question. Can you run your program like this: `java -classpath thisJar.jar your.package.Main` – Titulum Jan 13 '17 at 12:54
  • I am building my jar in command prompt with mvn clean install commad, later through winSCP i am placing my jar in tomcat webapps lib folder and i am starting my server – Chaitra Bannihatti Jan 13 '17 at 13:02
  • I'm at a loss here, I hope someone else comes up with a solution. Maybe add the `Maven` and `tomcat` keywords to your question. – Titulum Jan 13 '17 at 13:29