facebook

Not able to create XSSFWorkbook object

  1. MyEclipse IDE
  2.  > 
  3. WebSphere Development
Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #316456 Reply

    radwived
    Member

    hi everyone,

    I am using MyEclipse Blue 8.5. I am not able to create a XSSF workbook in my web application. Code compiles just fine, but gives below exception at run time. Any thoughts please? I have checked classpath and lib etc. Also ran a standalone program which creates .xlsx just fine. Thanks.

    [5/2/11 23:03:41:203 GMT] 00000027 SystemErr R org.apache.poi.POIXMLException: java.lang.reflect.InvocationTargetException
    [5/2/11 23:03:41:208 GMT] 00000027 SystemErr R at org.apache.poi.xssf.usermodel.XSSFFactory.createDocumentPart(XSSFFactory.java:61)
    [5/2/11 23:03:41:209 GMT] 00000027 SystemErr R at org.apache.poi.POIXMLDocumentPart.read(POIXMLDocumentPart.java:256)
    [5/2/11 23:03:41:209 GMT] 00000027 SystemErr R at org.apache.poi.POIXMLDocumentPart.read(POIXMLDocumentPart.java:261)
    [5/2/11 23:03:41:209 GMT] 00000027 SystemErr R at org.apache.poi.POIXMLDocument.load(POIXMLDocument.java:196)
    [5/2/11 23:03:41:209 GMT] 00000027 SystemErr R at org.apache.poi.xssf.usermodel.XSSFWorkbook.<init>(XSSFWorkbook.java:179)
    .
    .
    .
    caused by:[5/2/11 23:03:41:216 GMT] 00000027 SystemErr R 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)
    at org.apache.poi.POIXMLDocumentPart.read(POIXMLDocumentPart.java:256)
    at org.apache.poi.POIXMLDocumentPart.read(POIXMLDocumentPart.java:261)
    at org.apache.poi.POIXMLDocument.load(POIXMLDocument.java:196)
    at org.apache.poi.xssf.usermodel.XSSFWorkbook.<init>(XSSFWorkbook.java:179)
    .
    .
    .
    Caused by: java.lang.NoClassDefFoundError: schemasMicrosoftComVml.CTImageData
    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.createTypeStoreUser(SchemaTypeImpl.java:1805)
    at org.apache.xmlbeans.impl.store.Xobj.setStableType(Xobj.java:1390)
    at org.apache.xmlbeans.impl.store.Cur.setType(Cur.java:2497)
    at org.apache.xmlbeans.impl.store.Cur.setType(Cur.java:2482)
    at org.apache.xmlbeans.impl.store.Locale.autoTypeDocument(Locale.java:352)
    at org.apache.xmlbeans.impl.store.Locale.parse(Locale.java:709)
    at org.apache.xmlbeans.impl.store.Locale.parseToXmlObject(Locale.java:690)
    at org.apache.xmlbeans.impl.store.Locale.parseToXmlObject(Locale.java:677)
    at org.apache.xmlbeans.impl.schema.SchemaTypeLoaderBase.parse(SchemaTypeLoaderBase.java:208)
    at schemasMicrosoftComVml.CTShapetype$Factory.parse(Unknown Source)
    at org.apache.poi.xssf.usermodel.XSSFVMLDrawing.read(XSSFVMLDrawing.java:111)
    at org.apache.poi.xssf.usermodel.XSSFVMLDrawing.<init>(XSSFVMLDrawing.java:96)
    … 36 more

    #316457 Reply

    radwived
    Member

    thanks in advance for your help!

    #316460 Reply

    support-swapna
    Moderator

    radwived,

    1) The key line in your stack trace is:

    Caused by: java.lang.NoClassDefFoundError: schemasMicrosoftComVml.CTImageData
    Please ensure you have correctly added all the POI dependencies to your
    classpath – it seems you currently haven’t. Make sure the relevant jars for the class schemasMicrosoftComVml.CTImageData are in place.

    2) Also have a look at this thread :
    https://issues.apache.org/bugzilla/show_bug.cgi?id=48433

    3) Please list out steps in detail right from project creation for me to be able to replicate it at my end.

    #316473 Reply

    radwived
    Member

    Hi Swapna,

    I had followed the thread given by you and added geronimo-stax-api_1.0_spec-1.0.jar as user library. May be I am not including/setting jars as expected. can you please advise the right way? I’ll cross check that.

    here are the steps I am following:
    1. Read xlsx file in a BufferedInputStream from the database
    2. Create a workbook object from this stream as workbook = new XSSFWorkbook(bis);

    this is where it fails and gives the above listed exception.

    #316514 Reply

    support-swapna
    Moderator

    radwived,

    1) You need to add the relevant jars to the project build path.
    2) Can you build a very simple project with minimum files to replicate the issue and
    share your project with us? Zip it and attach it to the post or send an email to support@genuitec.com with Subject ATTN:SWAPNA.

    Here is how you can upload to the forums :
    https://www.genuitec.com/forums/topic/troubleshooting-how-to-upload-attachments-on-forum/

    3) I also suggest you cross post this issue to the POI forums for better support on this error.

Viewing 5 posts - 1 through 5 (of 5 total)
Reply To: Not able to create XSSFWorkbook object

You must be logged in to post in the forum log in