SOLVED java lang Exception java lang ClassCastException class com sun jersey core impl provider entity XMLJAXBElementProvider Text
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$Job.run(LocalJobRunner.java:404)
Caused by: java.lang.ClassCastException: class com.sun.jersey.core.impl.provider.entity.XMLJAXBElementProvider$Text
at java.lang.Class.asSubclass(Class.java:3037)
at org.apache.hadoop.mapred.JobConf.getOutputKeyComparator(JobConf.java:819)
at org.apache.hadoop.mapred.MapTask$MapOutputBuffer.init(MapTask.java:836)
at org.apache.hadoop.mapred.MapTask.createSortingCollector(MapTask.java:376)
at org.apache.hadoop.mapred.MapTask.access$100(MapTask.java:85)
at org.apache.hadoop.mapred.MapTask$NewOutputCollector.<init>(MapTask.java:584)
at org.apache.hadoop.mapred.MapTask.runNewMapper(MapTask.java:656)
at org.apache.hadoop.mapred.MapTask.run(MapTask.java:330)
at org.apache.hadoop.mapred.LocalJobRunner$Job$MapTaskRunnable.run(LocalJobRunner.java:266)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334)
at java.util.concurrent.FutureTask.run(FutureTask.java:166)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
at java.lang.Thread.run(Thread.java:722)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
download file now
Comments
Post a Comment