nifi-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Douglas Moore (JIRA)" <j...@apache.org>
Subject [jira] [Comment Edited] (NIFI-3927) Extract HL7 Attributes throwing NULLpointerException
Date Tue, 08 Aug 2017 20:38:00 GMT

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

Douglas Moore edited comment on NIFI-3927 at 8/8/17 8:37 PM:
-------------------------------------------------------------

Hopefully this is useful note....sorry if I'm hijacking the wrong JIRA as not sure if this
JIRA is now about CRLF or Z segments...

My findings are: by removing the '\r' characters from the test message in the JUnit test,
I get the same null pointer exception as I've been getting by pulling in messages via the
GetFile processor. As I read above the spec requires the \r.
I found GetFile->PutFile nifi flow does not remove the \r from the output file.

The null pointer exception is due to the code accessing segmentNames[19], one element beyond
the filled in segmentNames. Thus segment.numFields() is > the number of segmentNames. 

Hopefully, we can make the processor more robust to 'dirty data' or real world data.
Suggestions?

I'm on the nifi-1.3 source branch and using the nifi-hl7-nar-1.3.0.nar on a linux VM.
{code:java}
ExtractHL7Attributes.getAllFields(String, Segment, boolean) line: 287	
ExtractHL7Attributes.getAttributes(Group, boolean, boolean) line: 217	
ExtractHL7Attributes.onTrigger(ProcessContext, ProcessSession) line: 199	
ExtractHL7Attributes(AbstractProcessor).onTrigger(ProcessContext, ProcessSessionFactory) line:
27	
StandardProcessorTestRunner$RunProcessor.call() line: 251	
StandardProcessorTestRunner$RunProcessor.call() line: 245	
ScheduledThreadPoolExecutor$ScheduledFutureTask<V>(FutureTask<V>).run() line:
266	
ScheduledThreadPoolExecutor$ScheduledFutureTask<V>.access$201(ScheduledThreadPoolExecutor$ScheduledFutureTask)
line: 180	
ScheduledThreadPoolExecutor$ScheduledFutureTask<V>.run() line: 293	
ScheduledThreadPoolExecutor(ThreadPoolExecutor).runWorker(ThreadPoolExecutor$Worker) line:
1142	
ThreadPoolExecutor$Worker.run() line: 617	
Thread.run() line: 745	
{code}
https://github.com/apache/nifi/blob/rel/nifi-1.3.0/nifi-nar-bundles/nifi-hl7-bundle/nifi-hl7-processors/src/main/java/org/apache/nifi/processors/hl7/ExtractHL7Attributes.java


was (Author: dmoore247):
Hopefully this is useful note....sorry if I'm hijacking the wrong JIRA as not sure if this
JIRA is now about CRLF or Z segments...

My findings are: by removing the '\r' characters from the test message in the JUnit test,
I get the same null pointer exception as I've been getting by pulling in messages via the
GetFile processor. As I read above the spec requires the \r.
I found GetFile->PutFile nifi flow does not remove the \r from the output file.

The null pointer exception is due to the code accessing segmentNames[19], one element beyond
the filled in segmentNames. Thus segment.numFields() is > the number of segmentNames. Can
we at least address protect from this overrun via a bounds check on segment.numFields?

I'm on the nifi-1.3 source branch and using the nifi-hl7-nar-1.3.0.nar on a linux VM.
{code:java}
ExtractHL7Attributes.getAllFields(String, Segment, boolean) line: 287	
ExtractHL7Attributes.getAttributes(Group, boolean, boolean) line: 217	
ExtractHL7Attributes.onTrigger(ProcessContext, ProcessSession) line: 199	
ExtractHL7Attributes(AbstractProcessor).onTrigger(ProcessContext, ProcessSessionFactory) line:
27	
StandardProcessorTestRunner$RunProcessor.call() line: 251	
StandardProcessorTestRunner$RunProcessor.call() line: 245	
ScheduledThreadPoolExecutor$ScheduledFutureTask<V>(FutureTask<V>).run() line:
266	
ScheduledThreadPoolExecutor$ScheduledFutureTask<V>.access$201(ScheduledThreadPoolExecutor$ScheduledFutureTask)
line: 180	
ScheduledThreadPoolExecutor$ScheduledFutureTask<V>.run() line: 293	
ScheduledThreadPoolExecutor(ThreadPoolExecutor).runWorker(ThreadPoolExecutor$Worker) line:
1142	
ThreadPoolExecutor$Worker.run() line: 617	
Thread.run() line: 745	
{code}
https://github.com/apache/nifi/blob/rel/nifi-1.3.0/nifi-nar-bundles/nifi-hl7-bundle/nifi-hl7-processors/src/main/java/org/apache/nifi/processors/hl7/ExtractHL7Attributes.java

> Extract HL7 Attributes throwing NULLpointerException
> ----------------------------------------------------
>
>                 Key: NIFI-3927
>                 URL: https://issues.apache.org/jira/browse/NIFI-3927
>             Project: Apache NiFi
>          Issue Type: Bug
>          Components: Extensions
>    Affects Versions: 1.0.0
>         Environment: NiFi with HortonWorks
>            Reporter: Raj karan
>            Assignee: Joey Frazee
>         Attachments: null pointer.png, pipe_ended_charcter_encoded_ascii.png, resultWithDefault.txt,
source.txt, when not ended with pipe.png
>
>
> I have an HL7 file which I want to put in HBase, So I am parsing this file through ExtractHL7Attributes
processor. With the default value for every property processor works with no error but resultant
attributes file only have one segment. When I sets `Use Segment Names` property true it throws
NULLPointerException.
> Stack trace:
> 2017-05-17 11:11:58,390 INFO [Heartbeat Monitor Thread-1] o.a.n.c.c.h.AbstractHeartbeatMonitor
Finished processing 1 heartbeats in 4756 nanos
> 2017-05-17 11:11:58,847 ERROR [Timer-Driven Process Thread-2] o.a.n.p.hl7.ExtractHL7Attributes
ExtractHL7Attributes[id=bea89fef-86db-1094-ffff-ffff81c2e524] Failed to extract attributes
from StandardFlowFileRecord[uuid=73a649fe-261c-40d2-bad7-b0bc595c0158,claim=StandardContentClaim
[resourceClaim=StandardResourceClaim[id=1495030753601-25550, container=default, section=974],
offset=912561, length=288],offset=0,name=source.txt,size=288] due to ca.uhn.hl7v2.HL7Exception:
The HL7 version 2.3
> EVN is not recognized: ca.uhn.hl7v2.HL7Exception: The HL7 version 2.3
> EVN is not recognized
> 2017-05-17 11:11:58,848 ERROR [Timer-Driven Process Thread-2] o.a.n.p.hl7.ExtractHL7Attributes

> ca.uhn.hl7v2.HL7Exception: The HL7 version 2.3
> EVN is not recognized
> 	at ca.uhn.hl7v2.parser.Parser.assertVersionExists(Parser.java:527) ~[hapi-base-2.2.jar:na]
> 	at ca.uhn.hl7v2.parser.Parser.parse(Parser.java:208) ~[hapi-base-2.2.jar:na]
> 	at ca.uhn.hl7v2.parser.PipeParser.parse(PipeParser.java:1018) ~[hapi-base-2.2.jar:na]
> 	at org.apache.nifi.processors.hl7.ExtractHL7Attributes.onTrigger(ExtractHL7Attributes.java:195)
~[nifi-hl7-processors-1.0.0.2.0.2.0-17.jar:1.0.0.2.0.2.0-17]
> 	at org.apache.nifi.processor.AbstractProcessor.onTrigger(AbstractProcessor.java:27)
[nifi-api-1.0.0.2.0.2.0-17.jar:1.0.0.2.0.2.0-17]
> 	at org.apache.nifi.controller.StandardProcessorNode.onTrigger(StandardProcessorNode.java:1064)
[nifi-framework-core-1.0.0.2.0.2.0-17.jar:1.0.0.2.0.2.0-17]
> 	at org.apache.nifi.controller.tasks.ContinuallyRunProcessorTask.call(ContinuallyRunProcessorTask.java:136)
[nifi-framework-core-1.0.0.2.0.2.0-17.jar:1.0.0.2.0.2.0-17]
> 	at org.apache.nifi.controller.tasks.ContinuallyRunProcessorTask.call(ContinuallyRunProcessorTask.java:47)
[nifi-framework-core-1.0.0.2.0.2.0-17.jar:1.0.0.2.0.2.0-17]
> 	at org.apache.nifi.controller.scheduling.TimerDrivenSchedulingAgent$1.run(TimerDrivenSchedulingAgent.java:132)
[nifi-framework-core-1.0.0.2.0.2.0-17.jar:1.0.0.2.0.2.0-17]
> 	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) [na:1.8.0_77]
> 	at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:308) [na:1.8.0_77]
> 	at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(ScheduledThreadPoolExecutor.java:180)
[na:1.8.0_77]
> 	at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:294)
[na:1.8.0_77]
> 	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) [na:1.8.0_77]
> 	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) [na:1.8.0_77]
> 	at java.lang.Thread.run(Thread.java:745) [na:1.8.0_77]
> 2017-05-17 11:11:58,852 ERROR [Timer-Driven Process Thread-1] o.a.n.p.hl7.ExtractHL7Attributes
ExtractHL7Attributes[id=bea89fef-86db-1094-ffff-ffff81c2e524] ExtractHL7Attributes[id=bea89fef-86db-1094-ffff-ffff81c2e524]
failed to process due to java.lang.NullPointerException; rolling back session: java.lang.NullPointerException
> 2017-05-17 11:11:58,852 ERROR [Timer-Driven Process Thread-1] o.a.n.p.hl7.ExtractHL7Attributes

> java.lang.NullPointerException: null
> 2017-05-17 11:11:58,852 ERROR [Timer-Driven Process Thread-1] o.a.n.p.hl7.ExtractHL7Attributes
ExtractHL7Attributes[id=bea89fef-86db-1094-ffff-ffff81c2e524] ExtractHL7Attributes[id=bea89fef-86db-1094-ffff-ffff81c2e524]
failed to process session due to java.lang.NullPointerException: java.lang.NullPointerException
> 2017-05-17 11:11:58,852 ERROR [Timer-Driven Process Thread-1] o.a.n.p.hl7.ExtractHL7Attributes

> java.lang.NullPointerException: null
> 2017-05-17 11:11:58,852 WARN [Timer-Driven Process Thread-1] o.a.n.p.hl7.ExtractHL7Attributes
ExtractHL7Attributes[id=bea89fef-86db-1094-ffff-ffff81c2e524] Processor Administratively Yielded
for 1 sec due to processing failure
> 2017-05-17 11:11:58,852 WARN [Timer-Driven Process Thread-1] o.a.n.c.t.ContinuallyRunProcessorTask
Administratively Yielding ExtractHL7Attributes[id=bea89fef-86db-1094-ffff-ffff81c2e524] due
to uncaught Exception: java.lang.NullPointerException
> 2017-05-17 11:11:58,852 WARN [Timer-Driven Process Thread-1] o.a.n.c.t.ContinuallyRunProcessorTask

> java.lang.NullPointerException: null



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

Mime
View raw message