It is hard to tell without the rest of your code, but what you have shown
and the way you are explaining it doesn't seem like this error would happen.

I've seen this problem when you do a processSession.write(flowfile,
outputStream -> {}) and you don't capture the returned `flowFile`. Are you
writing to a flowFile anywhere else and not using the returned value?

On Wed, Sep 16, 2015 at 5:22 PM plj <[email protected]> wrote:

> Howdy,
>
>   I'm trying to send JSON to a flow file and I get the error "is not the
> most recent version of this FlowFile within this session".  I'm not sure
> what I'm doing wrong.    Here is a snippet
>                         FlowFile split = processSession.create(original);
>                         split = processSession.write(split, new
> OutputStreamCallback() {
>                             @Override
>                             public void process(OutputStream out) throws
> IOException {
>                                 String content = baos.toString("UTF-8");
>                                 String json = toJSON(content);
>                                 ObjectMapper mapper = new ObjectMapper();
>                                 JsonNode actualObj = mapper.readTree(json);
>                                 logger.info("JSON METADATA \n" +
> mapper.defaultPrettyPrintingWriter().writeValueAsString(actualObj));
>
>
> out.write(mapper.defaultPrettyPrintingWriter().writeValueAsString(actualObj).getBytes(StandardCharsets.UTF_8));
>                             }
>                         });
>
>
> The json is written out to the log
>
> In onTrigger(...) it set "meta" to the flow file "split" above
>
>         processSession.transfer(meta, REL_METADATA);
>
> And it get this error
>
> 2015-09-16 16:36:48,482 ERROR [Timer-Driven Process Thread-9]
> org.mitre.nifi.NiFiNITFReader
> NiFiNITFReader[id=a615ceb9-fa67-4823-9eb0-310ebada5488]
> NiFiNITFReader[id=a615ceb9-fa67-4823-9eb0-310ebada5488] failed to process
> due to org.apache.nifi.processor.exception.FlowFileHandlingException:
>
> StandardFlowFileRecord[uuid=865d7aac-994c-41ac-a34c-599d92df31b9,claim=1442435806141-1,offset=0,name=i_3001a.ntf,size=1049479]
> is not the most recent version of this FlowFile within this session
> (StandardProcessSession[id=2]); rolling back session:
> org.apache.nifi.processor.exception.FlowFileHandlingException:
>
> StandardFlowFileRecord[uuid=865d7aac-994c-41ac-a34c-599d92df31b9,claim=1442435806141-1,offset=0,name=i_3001a.ntf,size=1049479]
> is not the most recent version of this FlowFile within this session
> (StandardProcessSession[id=2])
>
>
>
> thoughts?
>
> thank you
>
>
>
>
> --
> View this message in context:
> http://apache-nifi-developer-list.39713.n7.nabble.com/is-not-the-most-recent-version-of-this-FlowFile-within-this-session-tp2837.html
> Sent from the Apache NiFi Developer List mailing list archive at
> Nabble.com.
>

Reply via email to