Job Not executing in Linux?

One Star

Job Not executing in Linux?

Hi all,
I created job and Job flow is below.
tFileInputExcel-->> tMap-->>tPostgresqlOutput
Excel File location is D:\File\Rerun.xls and Postgresql DB is located in different host(Ex 10.10.20.20)
Job is running in local machine.
I exported job in Linux and unzip the job.I tried to run shell script, I'm getting error.
Exception in component tFileInputExcel_1
java.lang.IllegalStateException: Zip File is closed
        at org.apache.poi.openxml4j.util.ZipFileZipEntrySource.getEntries(ZipFil                                                                              eZipEntrySource.java:45)
        at org.apache.poi.openxml4j.opc.ZipPackage.getPartsImpl(ZipPackage.java:                                                                              182)
        at org.apache.poi.openxml4j.opc.OPCPackage.getParts(OPCPackage.java:665)
        at org.apache.poi.openxml4j.opc.OPCPackage.open(OPCPackage.java:226)
        at org.apache.poi.openxml4j.opc.OPCPackage.open(OPCPackage.java:186)
        at org.apache.poi.POIXMLDocument.openPackage(POIXMLDocument.java:67)
        at org.apache.poi.xssf.usermodel.XSSFWorkbook.<init>(XSSFWorkbook.java:2                                                                              63)
        at reruns.test_rerun_alert_2014_0_1.Test_Rerun_Alert_2014.tFileInputExce                                                                              l_1Process(Test_Rerun_Alert_2014.java:2871)
        at reruns.test_rerun_alert_2014_0_1.Test_Rerun_Alert_2014.runJobInTOS(Te                                                                              st_Rerun_Alert_2014.java:5076)
        at reruns.test_rerun_alert_2014_0_1.Test_Rerun_Alert_2014.main(Test_Reru  
 Please give your inputs.
Thanks,
Kumar
Four Stars

Re: Job Not executing in Linux?

Hi Kumar,
I hope you have changed the path of the input file to unix path...
Thanks
vaibhav
One Star

Re: Job Not executing in Linux?

Hi vaibhav.
Here Excel file and Postgresql are in different  hosts(locations).
How to change the input file path to unix path?
Thanks,
kumar
Four Stars

Re: Job Not executing in Linux?

Hi Kumar,
If you have used the variable, then default.properties file gets generated and is available inside exported folder...
If you have hard coded input file path, then it can't be converted after export. You will have to change the path and then export..
If the file is in different machine? whether it is accessible to the host machine? can you ping to that location? is it a network drive?
Vaibhav
One Star

Re: Job Not executing in Linux?

Hi Vaibhav,
I hard coded Excel file path in  tFileInputExcel component.
Excel File location is 10.10.10.30( D:\File\Rerun.xls) and Postgresql DB location in Linux (10.10.20.20)
I exported job in Linux and tried to run the job.

Thanks,
kumar
Four Stars

Re: Job Not executing in Linux?

Usually remote machines folders are not shared... can you see the file by some means from the host machine? 
you can access the database because database ports are enabled through firewall... 
The way you are working is not possible...
You have to ask client to provide network drive or cloud location or ftp location from where you can download the file... And once you have right location which could be seen from your host machine, then change the path properties in your talend job and export it again.
Thanks
Vaibhav
One Star

Re: Job Not executing in Linux?

Hi Vaibhav,
I moved Excel file from D drive to Network drive.
Now path is for Excel is "//10.10.10.30/space/Rerun.xls".Exported job into Linux.
Still i'm getting the same error.
Thanks,
Kumar
Four Stars

Re: Job Not executing in Linux?

tfileinput component can't access network drive..., first you will have to get that file to local machine using some network utility and then use it... See how can you get that file into your machine using some scp or similar utility with the help of tsystem component.
vaibhav
One Star

Re: Job Not executing in Linux?

Hi,
We are executing Talend job through Java application same as given above sample.
JCIM_ELink_Reporting_Tab6 eLink_Reporting_Tab6 = new JCIM_ELink_Reporting_Tab6();
String[] args1 = new String[] { "--context_param input1=D:/New/Myfolder/cert.xlsx", 
"--context_param output=D:/
New/Myfolder/out6.xls"};
eLink_Reporting_Tab6.runJob(args1);

 
But we are getting an exception as 
Exception in component tFileInputExcel_1
java.lang.IllegalStateException: Zip File is closed
at org.apache.poi.openxml4j.util.ZipFileZipEntrySource.getEntries(ZipFileZipEntrySource.java:45)
at org.apache.poi.openxml4j.opc.ZipPackage.getPartsImpl(ZipPackage.java:186)
at org.apache.poi.openxml4j.opc.OPCPackage.getParts(OPCPackage.java:673)
at org.apache.poi.openxml4j.opc.OPCPackage.open(OPCPackage.java:226)
at org.apache.poi.openxml4j.opc.OPCPackage.open(OPCPackage.java:186)
at org.apache.poi.POIXMLDocument.openPackage(POIXMLDocument.java:74)
at org.apache.poi.xssf.usermodel.XSSFWorkbook.<init>(XSSFWorkbook.java:296)

Can you please explain where i am going wrong?
 
Moderator

Re: Job Not executing in Linux?

Hi,
We are executing Talend job through Java application same as given above sample.
JCIM_ELink_Reporting_Tab6 eLink_Reporting_Tab6 = new JCIM_ELink_Reporting_Tab6();
String[] args1 = new String[] { "--context_param input1=D:/New/Myfolder/cert.xlsx", 
"--context_param output=D:/
New/Myfolder/out6.xls"};
eLink_Reporting_Tab6.runJob(args1);

What's your Excel? Excel 2003(.xls) or Excel 2007(.xlsx)? We see that there are two types of excel for your input and output.
Best regards
Sabrina
--
Don't forget to give kudos when a reply is helpful and click Accept the solution when you think you're good with it.
One Star

Re: Job Not executing in Linux?

Yes,
we are reading input from Excel(2007).xlsx and output will be in Excel(2003).
Is this wrong?
Seven Stars

Re: Job Not executing in Linux?

Hi Sabrina,
I too am getting a similar kind of error when trying to read an Excel file from a local directory. I have created a job called load_Sheet which reads a sheet from a Excel file (.xlsx) and dumps it into a database table. The path of the Excel file is passed using context parameters (context.file_path+context.mapping_file) that are are populated after querying another database table.
This job executes successfully when executed individually. But when I invoke this job through another job, I see the below exception message in the console:
Exception in component tFileInputExcel_2
java.lang.IllegalStateException: Zip File is closed
at org.apache.poi.openxml4j.util.ZipFileZipEntrySource.getEntries(ZipFileZipEntrySource.java:45)
at org.apache.poi.openxml4j.opc.ZipPackage.getPartsImpl(ZipPackage.java:186)
at org.apache.poi.openxml4j.opc.OPCPackage.getParts(OPCPackage.java:673)
at org.apache.poi.openxml4j.opc.OPCPackage.open(OPCPackage.java:226)
at org.apache.poi.openxml4j.opc.OPCPackage.open(OPCPackage.java:186)
at org.apache.poi.POIXMLDocument.openPackage(POIXMLDocument.java:74)
at org.apache.poi.xssf.usermodel.XSSFWorkbook.<init>(XSSFWorkbook.java:296)
at ...
The only difference between these two executions is that when run as a sub job, the code to set the context parameter's values in invoked in the main job instead of the sub job.
What can be the possible issue with this?