hadoop-mapreduce-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Johannes.Lichtenberger" <Johannes.Lichtenber...@uni-konstanz.de>
Subject NullPointerException
Date Fri, 08 Oct 2010 12:01:36 GMT
Hello,

I'm currently getting a NullPointerException:

java.lang.NullPointerException
	at
org.apache.hadoop.io.serializer.SerializationFactory.getSerializer(SerializationFactory.java:73)
	at
org.apache.hadoop.mapred.MapTask$MapOutputBuffer.<init>(MapTask.java:797)
	at
org.apache.hadoop.mapred.MapTask$NewOutputCollector.<init>(MapTask.java:524)
	at org.apache.hadoop.mapred.MapTask.runNewMapper(MapTask.java:613)
	at org.apache.hadoop.mapred.MapTask.run(MapTask.java:305)
	at org.apache.hadoop.mapred.LocalJobRunner$Job.run(LocalJobRunner.java:177)

I've read it has something to do with the InputSplit (that doesn't
implement Writable), but I want to use FileSplit, which implements Writable.

public final class XMLInputFormat extends FileInputFormat<DateWritable,
Text> {

    static {
        System.setProperty("javax.xml.parsers.DocumentBuilderFactory",

"com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderFactoryImpl");
    }

    /**
     * Empty constructor.
     */
    public XMLInputFormat() {
        // Default constructor.
    }

    @Override
    public RecordReader<DateWritable, Text> createRecordReader(final
InputSplit paramSplit,
        final TaskAttemptContext paramContext) throws IOException,
InterruptedException {
       return new XMLRecordReader();
//        reader.initialize(paramSplit, paramContext);
//        return reader;
    }
}

In XMLRecordReader:

    @Override
    public void initialize(final InputSplit paramGenericSplit, final
TaskAttemptContext paramContext)
        throws IOException {
        final FileSplit split = (FileSplit)paramGenericSplit;
        final Configuration conf = paramContext.getConfiguration();
        ...

Do you have any advice?

My DateWritable which is the key implements WritableComparable and my
value is Text, which also implements Writable.

regards,
Johannes


Mime
View raw message