Bug 52005 - org.openxmlformats.schemas.spreadsheetml.x2006.main.CTSheets.getSheetList()
Summary: org.openxmlformats.schemas.spreadsheetml.x2006.main.CTSheets.getSheetList()
Status: RESOLVED INVALID
Alias: None
Product: POI
Classification: Unclassified
Component: XSSF (show other bugs)
Version: unspecified
Hardware: PC Windows XP
: P2 major (vote)
Target Milestone: ---
Assignee: POI Developers List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-10-10 16:50 UTC by Girish_Kshirsagar
Modified: 2011-10-10 21:47 UTC (History)
0 users



Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Girish_Kshirsagar 2011-10-10 16:50:02 UTC
getSheets method does not exist in the CTSheets.java.  Getting the error

Exception in thread "main" java.lang.NoSuchMethodError: org.openxmlformats.schem
as.spreadsheetml.x2006.main.CTSheets.getSheetList()Ljava/util/List;

Upon compilation of ExampleEventUserModel.java.
Comment 1 Nick Burch 2011-10-10 17:39:53 UTC
Make sure you're using either a recent poi-ooxml-schemas file, or the full ooxml-schemas-1.1. You almost certainly are using an older one. See the website for more details
Comment 2 Girish_Kshirsagar 2011-10-10 21:28:22 UTC
I am using   poi-ooxml-schemas-3.8-beta4-20110826.jar and also tried using ooxml-schemas-1.1.jar.  Here I am reproducing the CTSheets interface file.

When the example file (ExampleEventUserModel.java) the compiler gives the following

Exception in thread "main" java.lang.NoSuchMethodError: org.openxmlformats.schem
as.spreadsheetml.x2006.main.CTSheets.getSheetList()Ljava/util/List;
        at org.apache.poi.xssf.eventusermodel.XSSFReader$SheetIterator.<init>(XS
SFReader.java:191)
        at org.apache.poi.xssf.eventusermodel.XSSFReader$SheetIterator.<init>(XS
SFReader.java:149)
        at org.apache.poi.xssf.eventusermodel.XSSFReader.getSheetsData(XSSFReade
r.java:143)
        at org.apache.poi.xssf.eventusermodel.examples.FromHowTo.processAllSheet
s(FromHowTo.java:60)
        at ExampleEventUserModel.main(ExampleEventUserModel.java:123)

======================================================

Here is the CTSheets.java from the jar file.

// Decompiled by DJ v3.10.10.93 Copyright 2007 Atanas Neshkov  Date: 10/10/2011 2:58:54 PM
// Home Page: http://members.fortunecity.com/neshkov/dj.html  http://www.neshkov.com/dj.html - Check often for new version!
// Decompiler options: packimports(3) 

package org.openxmlformats.schemas.spreadsheetml.x2006.main;

import java.util.List;
import org.apache.xmlbeans.*;

// Referenced classes of package org.openxmlformats.schemas.spreadsheetml.x2006.main:
//            CTSheet

public interface CTSheets
    extends XmlObject
{
    /* member class not found */
    class Factory {}


    public abstract List getSheetList();

    /**
     * @deprecated Method getSheetArray is deprecated
     */

    public abstract CTSheet[] getSheetArray();

    public abstract CTSheet getSheetArray(int i);

    public abstract int sizeOfSheetArray();

    public abstract void setSheetArray(CTSheet actsheet[]);

    public abstract void setSheetArray(int i, CTSheet ctsheet);

    public abstract CTSheet insertNewSheet(int i);

    public abstract CTSheet addNewSheet();

    public abstract void removeSheet(int i);

    public static final SchemaType type = (SchemaType)XmlBeans.typeSystemForClassLoader(org/openxmlformats/schemas/spreadsheetml/x2006/main/CTSheets.getClassLoader(), "schemaorg_apache_xmlbeans.system.sE130CAA0A01A7CDE5A2B4FEB8B311707").resolveHandle("ctsheets49fdtype");

}
Comment 3 Nick Burch 2011-10-10 21:32:31 UTC
That java code you've posted is from ooxml-schemas-1.0 (or an older poi-ooxml-schemas file that was taken from it), so you're really not using the jar you think you are
Comment 4 Girish_Kshirsagar 2011-10-10 21:47:08 UTC
You are correct - I cleaned up my classpath and the error is gone.

Thanks, a lot.