Details
-
Bug
-
Status: Resolved
-
Minor
-
Resolution: Fixed
-
3.11.0
-
None
-
Unknown
Description
When sending a file payload to google-storage consumer it causes Null Pointer Exception in GoogleCloudStorageProducer.processFile method.
if (obj instanceof File)
else {
is = exchange.getIn().getMandatoryBody(InputStream.class);
baos = determineLengthInputStream(is);
baos is not initialized and causing NPE later on.
Test Case:
<route id="CopyToGoogleCloudStorage" streamCache="true"> <from uri="{{file-fromUri}}"/> <log message="Found file: '${header[CamelFileNameOnly]}'"/> <log message="Uploading to GCS file ${header.CamelFileNameOnly}"/> <!-- google-storage does not know File payload type and throws NPE --> <convertBodyTo type="String"/> <-- comment this out to create NPE <toD uri="google-storage://test?objectName=test.txt&serviceAccountKey=classpath:keys/test.json"/> <log message="Moved file: '${header.CamelFileNameOnly}'"/> </route>
Attachments
Issue Links
- links to