Results 1 to 3 of 3
  1. #1
    sathishvegeta is offline Member
    Join Date
    Feb 2013
    Posts
    20
    Rep Power
    0

    Default ERROE in apache Poi.jar pls help me

    This is code
    XML Code:
    import java.io.FileInputStream;
    import org.apache.poi.xssf.usermodel.XSSFCell;
    import org.apache.poi.xssf.usermodel.XSSFRow;
    import org.apache.poi.xssf.usermodel.XSSFSheet;
    import org.apache.poi.xssf.usermodel.XSSFWorkbook;
     
    public class PS
    {
    public static void main(Strings args[])
    { 
    InputStream filename = new FileInputStream("D:/sathish/Example.xlsx");
    XSSFWorkbook wb= new XSSFWorkbook(filename);
    XSSFSheet sheet = wb.getSheetAt(0);
    XSSFRow row1 = sheet.getRow(0);
    XSSFCell a1= row1.getCell(0);
    		String a1val= a1.getStringCellValue();
    		XSSFCell a2= row1.getCell(1);
    		String a2val=a2.getStringCellValue();
    		XSSFCell a3= row1.getCell(2);
    		String a3val=a3.getStringCellValue();
    		System.out.println("A1: " + a1val);
    		System.out.println("B1: " + a2val);
    		System.out.println("C1: " + a3val);
    	}
     }
    This is my error:
    Exception in thread "main" org.apache.poi.poifs .filesystem.officeXmlFileException:The supplied data appears to be Office 2007+Xml Your are calling the part of Poi that deals with ole2 office Documents. You need to call a different part of POI to process this data (Eg XSSF insted of HSSF)
    at org.apache.poi.poifs.storage.headerBlock.<init><He aderBlock,java:131>

    and Iam using 3.8 beta4 version of jar file

  2. #2
    DarrylBurke's Avatar
    DarrylBurke is offline Member
    Join Date
    Sep 2008
    Location
    Madgaon, Goa, India
    Posts
    11,184
    Rep Power
    19

    Default Re: ERROE in apache Poi.jar pls help me

    Moved from New to Java

    db
    If you're forever cleaning cobwebs, it's time to get rid of the spiders.

  3. #3
    Tolls is online now Moderator
    Join Date
    Apr 2009
    Posts
    11,853
    Rep Power
    19

    Default Re: ERROE in apache Poi.jar pls help me

    Please post the full stack trace, not just part of it, and highlight the line in your code on which it is thrown.
    Please do not ask for code as refusal often offends.

    ** This space for rent **

Similar Threads

  1. Apache Ant 1.9.1
    By java software in forum Java Software
    Replies: 0
    Last Post: 05-26-2013, 09:11 AM
  2. Apache Ant 1.8.3
    By java software in forum Java Software
    Replies: 0
    Last Post: 03-16-2012, 04:36 PM
  3. org.apache.cxf
    By madhu_sushmi in forum Advanced Java
    Replies: 0
    Last Post: 03-05-2010, 06:00 PM
  4. Replies: 0
    Last Post: 11-15-2008, 07:29 AM
  5. Apache Ant 1.7.1
    By Java Tip in forum Java Software
    Replies: 0
    Last Post: 07-11-2008, 02:45 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •