Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: NullPointerException when Enhanced JSON Output receives an empty stream #2927

Closed
bamaer opened this issue May 13, 2023 · 0 comments
Closed
Assignees
Labels
bug P2 Default Priority Transforms
Milestone

Comments

@bamaer
Copy link
Contributor

bamaer commented May 13, 2023

Apache Hop version?

SNAPSHOT-20230513

Java version?

openjdk version "11.0.18" 2023-01-17

Operating system

Linux

What happened?

NPE when Enhanced JSON Output is configured to write to a file and receives an empty stream.
This issue does not occur when only "Output value" is selected.

org.apache.hop.core.exception.HopTransformException: 
Error writing to file!
 at java.lang.Thread.run (Thread.java:829)
 at org.apache.hop.pipeline.transform.RunThread.run (RunThread.java:55)
 at org.apache.hop.pipeline.transforms.jsonoutputenhanced.JsonOutput.processRow (JsonOutput.java:111)
 at org.apache.hop.pipeline.transforms.jsonoutputenhanced.JsonOutput.writeJsonFile (JsonOutput.java:331)
 at java.io.Writer.write (Writer.java:249)

        at org.apache.hop.pipeline.transforms.jsonoutputenhanced.JsonOutput.writeJsonFile(JsonOutput.java:333)
        at org.apache.hop.pipeline.transforms.jsonoutputenhanced.JsonOutput.processRow(JsonOutput.java:111)
        at org.apache.hop.pipeline.transform.RunThread.run(RunThread.java:55)
        at java.base/java.lang.Thread.run(Thread.java:829)
Caused by: java.lang.NullPointerException
        at java.base/java.io.Writer.write(Writer.java:249)
        at org.apache.hop.pipeline.transforms.jsonoutputenhanced.JsonOutput.writeJsonFile(JsonOutput.java:331)
        ... 3 more
2023/05/13 09:05:39 - Enhanced JSON Output.0 - ERROR: Unexpected error
2023/05/13 09:05:39 - Enhanced JSON Output.0 - ERROR: org.apache.hop.core.exception.HopTransformException: 
2023/05/13 09:05:39 - Enhanced JSON Output.0 - Error writing to file!
2023/05/13 09:05:39 - Enhanced JSON Output.0 -  at java.lang.Thread.run (Thread.java:829)
2023/05/13 09:05:39 - Enhanced JSON Output.0 -  at org.apache.hop.pipeline.transform.RunThread.run (RunThread.java:55)
2023/05/13 09:05:39 - Enhanced JSON Output.0 -  at org.apache.hop.pipeline.transforms.jsonoutputenhanced.JsonOutput.processRow (JsonOutput.java:111)
2023/05/13 09:05:39 - Enhanced JSON Output.0 -  at org.apache.hop.pipeline.transforms.jsonoutputenhanced.JsonOutput.writeJsonFile (JsonOutput.java:331)
2023/05/13 09:05:39 - Enhanced JSON Output.0 -  at java.io.Writer.write (Writer.java:249)
2023/05/13 09:05:39 - Enhanced JSON Output.0 - 
2023/05/13 09:05:39 - Enhanced JSON Output.0 -  at org.apache.hop.pipeline.transforms.jsonoutputenhanced.JsonOutput.writeJsonFile(JsonOutput.java:333)
2023/05/13 09:05:39 - Enhanced JSON Output.0 -  at org.apache.hop.pipeline.transforms.jsonoutputenhanced.JsonOutput.processRow(JsonOutput.java:111)
2023/05/13 09:05:39 - Enhanced JSON Output.0 -  at org.apache.hop.pipeline.transform.RunThread.run(RunThread.java:55)
2023/05/13 09:05:39 - Enhanced JSON Output.0 -  at java.base/java.lang.Thread.run(Thread.java:829)
2023/05/13 09:05:39 - Enhanced JSON Output.0 - Caused by: java.lang.NullPointerException
2023/05/13 09:05:39 - Enhanced JSON Output.0 -  at java.base/java.io.Writer.write(Writer.java:249)
2023/05/13 09:05:39 - Enhanced JSON Output.0 -  at org.apache.hop.pipeline.transforms.jsonoutputenhanced.JsonOutput.writeJsonFile(JsonOutput.java:331)
2023/05/13 09:05:39 - Enhanced JSON Output.0 -  ... 3 more
2023/05/13 09:05:39 - Enhanced JSON Output.0 - Finished processing (I=0, O=0, R=0, W=0, U=0, E=1)

Issue Priority

Priority: 2

Issue Component

Component: Transforms

@github-actions github-actions bot added P2 Default Priority Transforms labels May 13, 2023
@bamaer bamaer added this to the 2.5 milestone May 13, 2023
@bamaer bamaer self-assigned this May 13, 2023
bamaer added a commit to bamaer/hop that referenced this issue May 13, 2023
@hansva hansva closed this as completed in 9e3f5fd May 13, 2023
hansva added a commit that referenced this issue May 13, 2023
fix NullPointerException on empty stream in Enhanced JSON Output #2927
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug P2 Default Priority Transforms
Projects
None yet
Development

No branches or pull requests

1 participant