Monday, 21 April 2014

[SOLVED] java.lang.Exception: java.lang.ClassCastException: class com.sun.jersey.core.impl.provider.entity.XMLJAXBElementProvider$Text

It is quite natural seeing ClassCastException in Hadoop MR Jobs like these for Hadoop beginers.

java.lang.Exception: java.lang.ClassCastException: class com.sun.jersey.core.impl.provider.entity.XMLJAXBElementProvider$Text
 at org.apache.hadoop.mapred.LocalJobRunner$
Caused by: java.lang.ClassCastException: class com.sun.jersey.core.impl.provider.entity.XMLJAXBElementProvider$Text
 at java.lang.Class.asSubclass(
 at org.apache.hadoop.mapred.JobConf.getOutputKeyComparator(
 at org.apache.hadoop.mapred.MapTask$MapOutputBuffer.init(
 at org.apache.hadoop.mapred.MapTask.createSortingCollector(
 at org.apache.hadoop.mapred.MapTask.access$100(
 at org.apache.hadoop.mapred.MapTask$NewOutputCollector.<init>(
 at org.apache.hadoop.mapred.MapTask.runNewMapper(
 at org.apache.hadoop.mapred.LocalJobRunner$Job$
 at java.util.concurrent.Executors$
 at java.util.concurrent.FutureTask$Sync.innerRun(
 at java.util.concurrent.ThreadPoolExecutor.runWorker(
 at java.util.concurrent.ThreadPoolExecutor$

While checking MR code we will not find any errors,but causes a ClassCastException

When Eclipse detects a problem in your code, it will display an error or warning icon along the left edge - known as gutter. Hover over the icon, a description of the problem pops up.  And imports the wrong statement and runs the job.

It is because we are importing the wrong import statement by mistake.

 Correct import statement is 

Now MR job executes with no exception

Happy Hadooping 


  1. Thank you so much for sharing this worthwhile to spent time on. You are running a really awesome blog. Keep up this good work

    Hadoop training velachery
    Hadoop training in velachery
    Big data training in velachery

  2. Learning new technology would give oneself a true confidence in the current emerging Information Technology domain. With the knowledge of big data the most magnificent cloud computing technology one can go the peek of data processing. As there is a drastic improvement in this field everyone are showing much interest in pursuing this technology. Your content tells the same about evolving technology. Thanks for sharing this.

    Hadoop Training in Chennai | Best hadoop training institute in chennai | Big Data Hadoop Training in Chennai | Hadoop Course in Chennai

  3. I have finally found a Worth able content to read. The way you have presented information here is quite impressive. I have bookmarked this page for future use. Thanks for sharing content like this once again. Keep sharing content like this.

    Software testing training in chennai | Software testing training institutes in chennai | Manual testing training in Chennai

  4. There is a huge demand for professional big data analysts who are able to use the software which is used to process the big data in order to get accurate results. MNC's are looking for professionals who can process their data so that they can get into a accurate business decision which would eventually help them to earn more profits, they can serve their customers better, and their risk is lowered.
    big data training in chennai|big data training|big data course in chennai|big data training chennai|big data hadoop training in chennai


  5. Thanks for sharing, I will bookmark and be back again

    Hadoop Certification in Chennai

  6. Thank you so much for sharing this worthwhile to spent time on. You are running a really awesome blog. Keep up this good work

  7. This is excellent information. It is amazing and wonderful to visit your site.Thanks for sharing this information&its very useful to me...
    Android training in chennai
    Ios training in chennai

  8. I believe there are many more pleasurable opportunities ahead for individuals that looked at your site. Best Java Training Institute in chennai