[ 
https://issues.apache.org/jira/browse/FLUME-1420?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13428226#comment-13428226
 ] 

Brock Noland commented on FLUME-1420:
-------------------------------------

There is actually 4 places that method can return null?  Do you see this 
section:

{code}

    // build the builder
    EventSerializer.Builder builder;
    try {
      builder = builderClass.newInstance();
    } catch (InstantiationException ex) {
      logger.error("Cannot instantiate builder: " + serializerType, ex);
      return null;
    } catch (IllegalAccessException ex) {
      logger.error("Cannot instantiate builder: " + serializerType, ex);
      return null;
    }

    return builder.build(context, out);
{code}
                
> Exception should be thrown if we cannot instaniate an EventSerializer
> ---------------------------------------------------------------------
>
>                 Key: FLUME-1420
>                 URL: https://issues.apache.org/jira/browse/FLUME-1420
>             Project: Flume
>          Issue Type: Bug
>          Components: Sinks+Sources
>    Affects Versions: v1.2.0
>            Reporter: Brock Noland
>            Assignee: Patrick Wendell
>         Attachments: FLUME-1420.patch.v1.txt
>
>
> Currently EventSerailizerFactory returns null if it cannot instantiate the 
> class. Then the caller NPEs because they don't expect null. If we cannot 
> satisfy the caller we should throw an exception
> {noformat}
> 2012-08-02 16:38:26,489 ERROR serialization.EventSerializerFactory: Unable to 
> instantiate Builder from 
> org.apache.flume.serialization.BodyTextEventSerializer
> 2012-08-02 16:38:26,490 WARN hdfs.HDFSEventSink: HDFS IO error
> java.io.IOException: java.lang.NullPointerException
>         at 
> org.apache.flume.sink.hdfs.BucketWriter.doOpen(BucketWriter.java:202)
>         at 
> org.apache.flume.sink.hdfs.BucketWriter.access$000(BucketWriter.java:48)
>         at 
> org.apache.flume.sink.hdfs.BucketWriter$1.run(BucketWriter.java:155)
>         at 
> org.apache.flume.sink.hdfs.BucketWriter$1.run(BucketWriter.java:152)
>         at 
> org.apache.flume.sink.hdfs.BucketWriter.runPrivileged(BucketWriter.java:125)
>         at org.apache.flume.sink.hdfs.BucketWriter.open(BucketWriter.java:152)
>         at 
> org.apache.flume.sink.hdfs.BucketWriter.append(BucketWriter.java:307)
>         at 
> org.apache.flume.sink.hdfs.HDFSEventSink$1.call(HDFSEventSink.java:717)
>         at 
> org.apache.flume.sink.hdfs.HDFSEventSink$1.call(HDFSEventSink.java:714)
>         at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
>         at java.util.concurrent.FutureTask.run(FutureTask.java:138)
>         at 
> java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
>         at 
> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
>         at java.lang.Thread.run(Thread.java:662)
> Caused by: java.lang.NullPointerException
>         at 
> org.apache.flume.sink.hdfs.HDFSDataStream.open(HDFSDataStream.java:75)
>         at 
> org.apache.flume.sink.hdfs.BucketWriter.doOpen(BucketWriter.java:188)
>         ... 13 more
> {noformat}

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: 
https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Reply via email to