Please take a look at http://poi.apache.org/index.html and find ooxml in the component map on the page. You need to have the poi-ooxml jar in your classpath in order to use XSSF - the project's name for xlsx.

Regards,
Dave

On Jun 26, 2009, at 10:31 AM, Peters, Kurt M. wrote:

I am trying to read a .xlsx file and get this error:


Exception in thread "main" java.lang.NoClassDefFoundError: org/ openxmlformats/schemas/spreadsheetml/x2006/main/CTSheet at org .apache.poi.ss.usermodel.WorkbookFactory.create(WorkbookFactory.java: 63)
        at org.mitre.e500.SatelliteLoader.main(SatelliteLoader.java:69)
Caused by: java.lang.ClassNotFoundException: org.openxmlformats.schemas.spreadsheetml.x2006.main.CTSheet
        at java.net.URLClassLoader$1.run(URLClassLoader.java:200)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
        at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:276)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
        at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319)
        ... 2 more

I'm using poi 3.5 beta 6. I also installed the org.apache.xmlbeans library and eclipse and that didn't help. The same code reads regular .xls files. Any thoughts?
                        inFile = fileChooser.getSelectedFile();
                        InputStream inps = null;
                                try {
                                        inps = new FileInputStream(inFile);
                                } catch (FileNotFoundException e) {
                                        // TODO Auto-generated catch block
                                        e.printStackTrace();
                                }
                        Workbook wb = null; //new XSSFWorkbook();
                                try {
                                        wb = WorkbookFactory.create(inps);
                                } catch (InvalidFormatException e) {
                                        // TODO Auto-generated catch block
                                        e.printStackTrace();
                                } catch (IOException e) {
                                        // TODO Auto-generated catch block
                                        e.printStackTrace();
                                }
Regards,
Kurt


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



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

Reply via email to