Take the 2-minute tour ×

I install the scala eclipse plugin, but it make me annoyed

It cannot compile correctly， it indicate compiling error for the following statement

job setMapperClass classOf[ASPMapReduce.Map]

type mismatch; found : java.lang.Classcom.ebay.twitch.ASPMapReduce.Map required: java.lang.Class[_ <: org.apache.hadoop.mapreduce.Mapper]

But actually ASPMapReduce.Map is really a sub class of org.apache.hadoop.mapreeuce.Mapper And I can use maven to compile it succesffuly. but eclipse always tell me the compiling error

What's wrong with the scala eclipse plugin ? BTW I use the Scala IDE 2.0.0-beta4 with Scala 2.9.0.final for Eclipse 3.6

share|improve this question
Such problems are really better discussed on the Scala IDE mailing list, especially considering that the Scala IDE is still in beta. –  Jean-Philippe Pellet May 25 '11 at 7:35
add comment

1 Answer

up vote 0 down vote accepted

Your question appears to have the same root cause as this one. That question spawned this ticket against Scala.

Update: This bug is fixed in Scala 2.9.1 RC2

You can workaround the problem by using Scala 2.8.1 (boo) or, silly as it seems, defining the Mapper before the Job. The following compiles:

import org.apache.hadoop._
import org.apache.hadoop.io._
import org.apache.hadoop.conf._
import org.apache.hadoop.mapreduce._

class MyMapper extends Mapper[LongWritable,Text,Text,Text] {
  override def map(key: LongWritable, value: Text, context: Mapper[LongWritable,Text,Text,Text]#Context) {

object MyJob {
  def main(args:Array[String]) {
    val job = new Job(new Configuration())
share|improve this answer
add comment

Your Answer


