You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@poi.apache.org by bu...@apache.org on 2010/05/20 22:21:42 UTC

DO NOT REPLY [Bug 49325] New: Websphere 6.1: java.lang.NoClassDefFoundError: org.openxmlformats.schemas.spreadsheetml.x2006.main.CTPhoneticRun

https://issues.apache.org/bugzilla/show_bug.cgi?id=49325

           Summary: Websphere 6.1: java.lang.NoClassDefFoundError:
                    org.openxmlformats.schemas.spreadsheetml.x2006.main.CT
                    PhoneticRun
           Product: POI
           Version: 3.6
          Platform: PC
        OS/Version: Windows XP
            Status: NEW
          Severity: normal
          Priority: P2
         Component: XSSF
        AssignedTo: dev@poi.apache.org
        ReportedBy: teds.mailing.lists@gmail.com


Created an attachment (id=25468)
 --> (https://issues.apache.org/bugzilla/attachment.cgi?id=25468)
A simple spreadsheet containing three rows and two columns.

When attempting to open an .xlsx file running on the Websphere 6.1 JDK, the
poi-bin-3.6-20091214 distribution results in the following exception. No
exception is generated when running on jre_1.5.0_11.

As a workaround, replacing poi-ooxml-schemas-3.6-20091214.jar with
ooxml-schemas-1.0.jar downloaded from
http://mirrors.ibiblio.org/pub/mirrors/maven2//org/apache/poi/ooxml-schemas/1.0/
resolved the issue.

It has been suggested by Dave Fisher (per
http://article.gmane.org/gmane.comp.jakarta.poi.user/14509) to include the
org.openxmlformats.schemas.spreadsheetml.x2006.main.CTPhoneticRun in the
poi-ooxml-schemas jar.

Sample .xlsx file is attached.  A sample program follows:


import java.io.File;
import java.io.FileInputStream;

import org.apache.poi.ss.usermodel.WorkbookFactory;

/**
 * Demonstrates a bug using poi-bin-3.6-20091214 with Websphere 6.1 JDK:
 *  java.lang.NoClassDefFoundError:
org.openxmlformats.schemas.spreadsheetml.x2006.main.CTPhoneticRun
 *  
 *  Per Dave Fisher:
(http://article.gmane.org/gmane.comp.jakarta.poi.user/14509)
 *    The poi-ooxml-schemas jar is a cut-down version of ooxml-schemas-1.0.jar
- the full schemas are about 13 MB.
 *    Replace poi-ooxml-schemas in your classpath with ooxml-schemas-1.0.jar. 
 */
public final class Main {
    static final String XLSX_PATH = "C:/simple.xlsx";

    public static void main(String[] args) throws Exception {
        final File xlsx = new File(XLSX_PATH); 
        WorkbookFactory.create(new FileInputStream(xlsx));
        System.out.println("okay!");
    }
}



Exception in thread "main" org.apache.poi.POIXMLException:
java.lang.reflect.InvocationTargetException
    at
org.apache.poi.xssf.usermodel.XSSFFactory.createDocumentPart(XSSFFactory.java:61)
    at org.apache.poi.POIXMLDocumentPart.read(POIXMLDocumentPart.java:256)
    at org.apache.poi.POIXMLDocument.load(POIXMLDocument.java:196)
    at org.apache.poi.xssf.usermodel.XSSFWorkbook.<init>(XSSFWorkbook.java:172)
    at
org.apache.poi.ss.usermodel.WorkbookFactory.create(WorkbookFactory.java:63)
    at Main.main(Main.java:20)
Caused by: java.lang.reflect.InvocationTargetException
    at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
    at
sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:67)
    at
sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
    at java.lang.reflect.Constructor.newInstance(Constructor.java:521)
    at
org.apache.poi.xssf.usermodel.XSSFFactory.createDocumentPart(XSSFFactory.java:59)
    ... 5 more
Caused by: java.lang.NoClassDefFoundError:
org.openxmlformats.schemas.spreadsheetml.x2006.main.CTPhoneticRun
    at java.lang.J9VMInternals.verifyImpl(Native Method)
    at java.lang.J9VMInternals.verify(J9VMInternals.java:59)
    at java.lang.J9VMInternals.initialize(J9VMInternals.java:120)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
    at
sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:67)
    at
sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
    at java.lang.reflect.Constructor.newInstance(Constructor.java:521)
    at
org.apache.xmlbeans.impl.schema.SchemaTypeImpl.createUnattachedNode(SchemaTypeImpl.java:1859)
    at
org.apache.xmlbeans.impl.schema.SchemaTypeImpl.createElementType(SchemaTypeImpl.java:1021)
    at
org.apache.xmlbeans.impl.values.XmlObjectBase.create_element_user(XmlObjectBase.java:893)
    at org.apache.xmlbeans.impl.store.Xobj.getUser(Xobj.java:1657)
    at
org.apache.xmlbeans.impl.store.Xobj.find_all_element_users(Xobj.java:2080)
    at
org.openxmlformats.schemas.spreadsheetml.x2006.main.impl.CTSstImpl.getSiArray(Unknown
Source)
    at
org.apache.poi.xssf.model.SharedStringsTable.readFrom(SharedStringsTable.java:113)
    at
org.apache.poi.xssf.model.SharedStringsTable.<init>(SharedStringsTable.java:97)
    ... 10 more

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org


DO NOT REPLY [Bug 49325] Websphere 6.1: java.lang.NoClassDefFoundError: org.openxmlformats.schemas.spreadsheetml.x2006.main.CTPhoneticRun

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=49325

Yegor Kozlov <ye...@dinom.ru> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |FIXED

--- Comment #1 from Yegor Kozlov <ye...@dinom.ru> 2010-05-22 12:16:03 EDT ---
Fixed in r947312

I included your sample in the POI test suite. It ensures that the build
procedure includes needed classes from the full ooxml-schemas.jar.

Yegor

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org