Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi
I am trying to send the CSV file from my local machine via email using cMail component. The code in my cProcessor is below is :
import java.io.File;
String path = "C:\\Users\\Talend\\Downloads\\Report_20190226.csv";
exchange.getIn().addAttachment(path.substring(path.lastIndexOf("\\")+1), new javax.activation.DataHandler(new javax.activation.FileDataSource(path)));
exchange.getIn().setBody("Hello");
System.out.println(path);but it gives the following exception:
java.lang.NullPointerException
Please help me where my exchange is getting null.
The flow is shown in the image attached.
Thanks
Hi,
Before doing the processing, could you please print and verify whether the file names are parsed in the right way?
Please assign the data to a variable and print the steps like last index parse. It should give you a clue.
Warm Regards,
Nikhil Thampi
Please appreciate our Talend community members by giving Kudos for sharing their time for your query. If your query is answered, please mark the topic as resolved 🙂
Hi Ameen,
Could you please provide the component screenshots also for the problematic components?
Warm Regards,
Nikhil Thampi
Please appreciate our Talend community members by giving Kudos for sharing their time for your query. If your query is answered, please mark the topic as resolved 🙂