Skip to main content
Announcements
July 15, NEW Customer Portal: Initial launch will improve how you submit Support Cases. IMPORTANT DETAILS
cancel
Showing results for 
Search instead for 
Did you mean: 
jscher01
Contributor
Contributor

tFileOuputExcel can't write to Linux

Hello, 

 

I have a process that works great locally but breaks when I run it from the Execution server that is a Linux system. 

 

The process breaks when I select the 'Write excel2007 file format(xlsx)' checkbox. I have verified the java version isn't the issue and encoding is set to the UTF-8 default on the server and in the component. Also, all Modules are installed required for the component and are not showing warning/errors.  Here is the error I'm getting:

tFileOutputExcel_1 0
java.lang.ArrayIndexOutOfBoundsException: 0

 

I can write to the location when 'write excel2007' is not checked so it's not a permission or schema issue. I am using Talend 6.4. No issues utilizing dozens of other components in this project.

 

IMO - This is too common of a component to be an issue with Talend and has to be something with my install or setup of the Execution server. What should I try next?

 

Thanks,

James

Labels (3)
8 Replies
Anonymous
Not applicable

Hello,

What does your input excel file look like? Is there any ghost character in it? Does this issue repro on all your excel files or a specific one?

Best regards

Sabrina

jscher01
Contributor
Contributor
Author

Hello Sabrina,

 

The original jobs all write to excel before sending to recipients, the issue has been with anything I publish and run from the job/execution server. To try and find a solution I created a simple job the generates one column with 100 rows using the TalendDataGenerator.getFirstName() function. I have attached a screen shot of the simple job. Again, I am able to create xls extension with the excel component but not 2007. 

 

The OS on the job server is CentOS 7. 


Excel.PNG
Anonymous
Not applicable

Are you writing to CentOS 7 or running the job from a TAC on CentOS 7 and writing the file somewhere else?

Also, can you post a full stack trace? The error indicates the program is trying to access an empty array, which probably mean something went wrong upstream.

I have written .xlsx files on CentOS using the licensed version of Talend Big Data Platform, but that was several months ago: who knows what has changed since then ; )
jscher01
Contributor
Contributor
Author

We are using Talend Data Services Platform 6.4.1

Q: Are you writing to CentOS 7 or running the job from a TAC on CentOS 7 and writing the file somewhere else?
A: Running the job from TAC using an Execution server running on CentOS 7 as a staging location before sending to multiple locations.

Full log from simple job (like I said if I change that 2007 check box everything works fine):
[INFO ]: integrations_2.write_file_using_tac_excel_0_8.write_file_using_tac_excel - TalendJob: 'write_file_using_tac_excel' - Start.
[statistics] connecting to socket on port 10284
[statistics] connected

[FATAL]: integrations_2.write_file_using_tac_excel_0_8.write_file_using_tac_excel - tFileOutputExcel_1 0
java.lang.ArrayIndexOutOfBoundsException: 0
at sun.font.CompositeFont.getSlotFont(CompositeFont.java:375)
at sun.font.CompositeGlyphMapper.initMapper(CompositeGlyphMapper.java:81)
at sun.font.CompositeGlyphMapper.<init>(CompositeGlyphMapper.java:62)
at sun.font.CompositeFont.getMapper(CompositeFont.java:433)
at sun.font.CompositeFont.canDisplay(CompositeFont.java:459)
at java.awt.Font.canDisplayUpTo(Font.java:2063)
at java.awt.font.TextLayout.singleFont(TextLayout.java:470)
at java.awt.font.TextLayout.<init>(TextLayout.java:531)
at org.apache.poi.ss.util.SheetUtil.getDefaultCharWidth(SheetUtil.java:274)
at org.apache.poi.xssf.streaming.AutoSizeColumnTracker.<init>(AutoSizeColumnTracker.java:117)
at org.apache.poi.xssf.streaming.SXSSFSheet.<init>(SXSSFSheet.java:79)
at org.apache.poi.xssf.streaming.SXSSFWorkbook.createAndRegisterSXSSFSheet(SXSSFWorkbook.java:652)
at org.apache.poi.xssf.streaming.SXSSFWorkbook.createSheet(SXSSFWorkbook.java:673)
at org.apache.poi.xssf.streaming.SXSSFWorkbook.createSheet(SXSSFWorkbook.java:89)
at org.talend.ExcelTool.prepareXlsxFile(ExcelTool.java:129)
at integrations_2.write_file_using_tac_excel_0_8.write_file_using_tac_excel.tRowGenerator_1Process(write_file_using_tac_excel.java:690)
at integrations_2.write_file_using_tac_excel_0_8.write_file_using_tac_excel.runJobInTOS(write_file_using_tac_excel.java:1554)
at integrations_2.write_file_using_tac_excel_0_8.write_file_using_tac_excel.main(write_file_using_tac_excel.java:1385)
[statistics] disconnected
Exception in component tFileOutputExcel_1 (write_file_using_tac_excel)
java.lang.ArrayIndexOutOfBoundsException: 0
at sun.font.CompositeFont.getSlotFont(CompositeFont.java:375)
at sun.font.CompositeGlyphMapper.initMapper(CompositeGlyphMapper.java:81)
at sun.font.CompositeGlyphMapper.<init>(CompositeGlyphMapper.java:62)
at sun.font.CompositeFont.getMapper(CompositeFont.java:433)
at sun.font.CompositeFont.canDisplay(CompositeFont.java:459)
at java.awt.Font.canDisplayUpTo(Font.java:2063)
at java.awt.font.TextLayout.singleFont(TextLayout.java:470)
at java.awt.font.TextLayout.<init>(TextLayout.java:531)
at org.apache.poi.ss.util.SheetUtil.getDefaultCharWidth(SheetUtil.java:274)
at org.apache.poi.xssf.streaming.AutoSizeColumnTracker.<init>(AutoSizeColumnTracker.java:117)
at org.apache.poi.xssf.streaming.SXSSFSheet.<init>(SXSSFSheet.java:79)
at org.apache.poi.xssf.streaming.SXSSFWorkbook.createAndRegisterSXSSFSheet(SXSSFWorkbook.java:652)
at org.apache.poi.xssf.streaming.SXSSFWorkbook.createSheet(SXSSFWorkbook.java:673)
at org.apache.poi.xssf.streaming.SXSSFWorkbook.createSheet(SXSSFWorkbook.java:89)
at org.talend.ExcelTool.prepareXlsxFile(ExcelTool.java:129)
at integrations_2.write_file_using_tac_excel_0_8.write_file_using_tac_excel.tRowGenerator_1Process(write_file_using_tac_excel.java:690)
at integrations_2.write_file_using_tac_excel_0_8.write_file_using_tac_excel.runJobInTOS(write_file_using_tac_excel.java:1554)
at integrations_2.write_file_using_tac_excel_0_8.write_file_using_tac_excel.main(write_file_using_tac_excel.java:1385)

Thanks,
James
jscher01
Contributor
Contributor
Author

Full log when running log4j level set to trace:
[INFO ]: integrations_2.write_file_using_tac_excel_0_14.write_file_using_tac_excel - TalendJob: 'write_file_using_tac_excel' - Start.
[statistics] connecting to socket on port 10307
[statistics] connected
1.8.0_171
[DEBUG]: integrations_2.write_file_using_tac_excel_0_14.write_file_using_tac_excel - tFileOutputExcel_1 - Start to work.
[DEBUG]: integrations_2.write_file_using_tac_excel_0_14.write_file_using_tac_excel - tFileOutputExcel_1 - Parameters:VERSION_2007 = true | USESTREAM = false | FILENAME = "/tmp/test.xlsx" | SHEETNAME = "Data" | INCLUDEHEADER = true | APPEND_FILE = false | FIRST_CELL_Y_ABSOLUTE = false | FONT = | IS_ALL_AUTO_SZIE = false | AUTO_SZIE_SETTING = [{IS_AUTO_SIZE=false, SCHEMA_COLUMN=Name}, {IS_AUTO_SIZE=false, SCHEMA_COLUMN=newColumn}] | CREATE = true | FLUSHONROW = false | ADVANCED_SEPARATOR = false | ENCODING = "UTF-8" | DELETE_EMPTYFILE = true |

[FATAL]: integrations_2.write_file_using_tac_excel_0_14.write_file_using_tac_excel - tFileOutputExcel_1 0
java.lang.ArrayIndexOutOfBoundsException: 0
at sun.font.CompositeFont.getSlotFont(CompositeFont.java:375)
at sun.font.CompositeGlyphMapper.initMapper(CompositeGlyphMapper.java:81)
at sun.font.CompositeGlyphMapper.<init>(CompositeGlyphMapper.java:62)
at sun.font.CompositeFont.getMapper(CompositeFont.java:433)
at sun.font.CompositeFont.canDisplay(CompositeFont.java:459)
at java.awt.Font.canDisplayUpTo(Font.java:2063)
at java.awt.font.TextLayout.singleFont(TextLayout.java:470)
at java.awt.font.TextLayout.<init>(TextLayout.java:531)
at org.apache.poi.ss.util.SheetUtil.getDefaultCharWidth(SheetUtil.java:274)
at org.apache.poi.xssf.streaming.AutoSizeColumnTracker.<init>(AutoSizeColumnTracker.java:117)
at org.apache.poi.xssf.streaming.SXSSFSheet.<init>(SXSSFSheet.java:79)
at org.apache.poi.xssf.streaming.SXSSFWorkbook.createAndRegisterSXSSFSheet(SXSSFWorkbook.java:652)
at org.apache.poi.xssf.streaming.SXSSFWorkbook.createSheet(SXSSFWorkbook.java:673)
at org.apache.poi.xssf.streaming.SXSSFWorkbook.createSheet(SXSSFWorkbook.java:89)
at org.talend.ExcelTool.prepareXlsxFile(ExcelTool.java:133)
at integrations_2.write_file_using_tac_excel_0_14.write_file_using_tac_excel.tRowGenerator_1Process(write_file_using_tac_excel.java:909)
at integrations_2.write_file_using_tac_excel_0_14.write_file_using_tac_excel.tJava_1Process(write_file_using_tac_excel.java:406)
at integrations_2.write_file_using_tac_excel_0_14.write_file_using_tac_excel.runJobInTOS(write_file_using_tac_excel.java:1723)
at integrations_2.write_file_using_tac_excel_0_14.write_file_using_tac_excel.main(write_file_using_tac_excel.java:1554)
[statistics] disconnected
Exception in component tFileOutputExcel_1 (write_file_using_tac_excel)
java.lang.ArrayIndexOutOfBoundsException: 0
at sun.font.CompositeFont.getSlotFont(CompositeFont.java:375)
at sun.font.CompositeGlyphMapper.initMapper(CompositeGlyphMapper.java:81)
at sun.font.CompositeGlyphMapper.<init>(CompositeGlyphMapper.java:62)
at sun.font.CompositeFont.getMapper(CompositeFont.java:433)
at sun.font.CompositeFont.canDisplay(CompositeFont.java:459)
at java.awt.Font.canDisplayUpTo(Font.java:2063)
at java.awt.font.TextLayout.singleFont(TextLayout.java:470)
at java.awt.font.TextLayout.<init>(TextLayout.java:531)
at org.apache.poi.ss.util.SheetUtil.getDefaultCharWidth(SheetUtil.java:274)
at org.apache.poi.xssf.streaming.AutoSizeColumnTracker.<init>(AutoSizeColumnTracker.java:117)
at org.apache.poi.xssf.streaming.SXSSFSheet.<init>(SXSSFSheet.java:79)
at org.apache.poi.xssf.streaming.SXSSFWorkbook.createAndRegisterSXSSFSheet(SXSSFWorkbook.java:652)
at org.apache.poi.xssf.streaming.SXSSFWorkbook.createSheet(SXSSFWorkbook.java:673)
at org.apache.poi.xssf.streaming.SXSSFWorkbook.createSheet(SXSSFWorkbook.java:89)
at org.talend.ExcelTool.prepareXlsxFile(ExcelTool.java:133)
at integrations_2.write_file_using_tac_excel_0_14.write_file_using_tac_excel.tRowGenerator_1Process(write_file_using_tac_excel.java:909)
at integrations_2.write_file_using_tac_excel_0_14.write_file_using_tac_excel.tJava_1Process(write_file_using_tac_excel.java:406)
at integrations_2.write_file_using_tac_excel_0_14.write_file_using_tac_excel.runJobInTOS(write_file_using_tac_excel.java:1723)
at integrations_2.write_file_using_tac_excel_0_14.write_file_using_tac_excel.main(write_file_using_tac_excel.java:1554)
Anonymous
Not applicable

According to the stack trace, the method throwing the error is:

 

[FATAL]: integrations_2.write_file_using_tac_excel_0_14.write_file_using_tac_excel - tFileOutputExcel_1 0
java.lang.ArrayIndexOutOfBoundsException: 0
at sun.font.CompositeFont.getSlotFont(CompositeFont.java:375)

 

Looking at the debug trace, the FONT parameter is empty:

 

[DEBUG]: integrations_2.write_file_using_tac_excel_0_14.write_file_using_tac_excel - tFileOutputExcel_1 - Parameters:VERSION_2007 = true | USESTREAM = false | FILENAME = "/tmp/test.xlsx" | SHEETNAME = "Data" | INCLUDEHEADER = true | APPEND_FILE = false | FIRST_CELL_Y_ABSOLUTE = false | FONT = | IS_ALL_AUTO_SZIE = false | AUTO_SZIE_SETTING = [{IS_AUTO_SIZE=false, SCHEMA_COLUMN=Name}, {IS_AUTO_SIZE=false, SCHEMA_COLUMN=newColumn}] | CREATE = true | FLUSHONROW = false | ADVANCED_SEPARATOR = false | ENCODING = "UTF-8" | DELETE_EMPTYFILE = true |

 

So, the sun.font.CompositeFont.getSlotFont method probably expects the FONT parameter to be defined before it is called. I don't have a copy of Talend available at the moment, but are there any parameters under the Advanced tab of the tFileOutputExcel component that might populate that parameter (I can't think of any, but worth a check)?

 

If not, I would consider raising this as a bug report with Talend; someone probably needs to look at the Java code that is generated, because my guess is that the FONT parameter is supposed to be populated by an internal method that the user has no direct control over. For some reason, that's not happening. Unfortunately, you probably won't have access to the internal methods to find the bug yourself, and even if you did, there's not much you can do other than exporting the code outside of Talend, fixing the error, then running it in a Java interpreter.

 

I hope this helps; if there's anything more I can do, please let me know.

jscher01
Contributor
Contributor
Author

Thanks for trying to help! "FONT = " is what shows in the log when default is selected in the font drop down of the excel component. I tried changing the font to Arial and again with Times New Roman. The selected font does end up in the stack trace but I still get the same error when running from job server on CentOS 7.
Anonymous
Not applicable

Well, you can't win them all...

I'd still raise a bug report with Talend; hopefully they can help.

Good luck.