Is it exactly the code you are using? We have many unit tests that invoke createSheet on new XSSFWorkbook and all of them pass. I've just tried your code with latest trunk it works just fine.

Try the latest 3.5-beta5. If the problem persists, create an issue in bugzilla and attach sample code to reproduce the trouble.

Yegor

Hi,
I am getting the following run time excception while crting a worksheet
using XSSFWorkbook class:
Exception in thread "main" org.apache.poi.POIXMLException:
org.apache.poi.openxml4j.exceptions.InvalidOperationException: A part with
the name '/xl/worksheets/sheet1.xml' already exists : Packages shall not
contain equivalent part names and package implementers shall neither create
nor recognize packages with equivalent part names. [M1.12]
        at
org.apache.poi.POIXMLDocumentPart.createRelationship(POIXMLDocumentPart.java:216)
        at
org.apache.poi.POIXMLDocumentPart.createRelationship(POIXMLDocumentPart.java:189)
        at
org.apache.poi.xssf.usermodel.XSSFWorkbook.createSheet(XSSFWorkbook.java:467)
        at
org.apache.poi.xssf.usermodel.XSSFWorkbook.createSheet(XSSFWorkbook.java:80)
        at
com.ericsson.ccrtool.excel.impl.write.AbstractXmlToExcelMapper.initialize(AbstractXmlToExcelMapper.java:78)
        at
com.ericsson.ccrtool.excel.impl.write.TableOfContentsMapper.map(TableOfContentsMapper.java:23)
        at
com.ericsson.ccrtool.excel.impl.write.DefaultExcelExporter.exportToExcel(DefaultExcelExporter.java:116)
        at
com.ericsson.ccrtool.excel.ExcelHelper.generateCcrForm(ExcelHelper.java:47)
        at
com.ericsson.ccrtool.excel.ExcelHelper.generateCcrForm(ExcelHelper.java:40)
        at
com.ericsson.ccrtool.excel.ExcelHelper.generateCcrForm(ExcelHelper.java:36)
        at
com.ericsson.ccrtool.excel.impl.write.ExcelSheetComparer.main(ExcelSheetComparer.java:29)
Caused by: org.apache.poi.openxml4j.exceptions.InvalidOperationException: A
part with the name '/xl/worksheets/sheet1.xml' already exists : Packages
shall not contain equivalent part names and package implementers shall
neither create nor recognize packages with equivalent part names. [M1.12]
        at org.apache.poi.openxml4j.opc.Package.createPart(Package.java:692)
        at org.apache.poi.openxml4j.opc.Package.createPart(Package.java:656)
        at
org.apache.poi.POIXMLDocumentPart.createRelationship(POIXMLDocumentPart.java:208)
        ... 10 more



I am not able to unser stand, what went wrong.
I used the following code to create a worksheet :

   Workbook  wb = new XSSFWorkbook();
  Sheet sheet = wb.createSheet("1. Table of Contents");

Please suggest me what i need to do to resolve the error.




---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to