Bug 53167 - HSSFWorkbook.write(FileOutputStream) method Throwing java.lang.NoSuchMethodError: org.apache.poi.util.LittleEndian.putByte([BII)V
Summary: HSSFWorkbook.write(FileOutputStream) method Throwing java.lang.NoSuchMethodEr...
Status: RESOLVED INVALID
Alias: None
Product: POI
Classification: Unclassified
Component: HSSF (show other bugs)
Version: 3.2-FINAL
Hardware: PC All
: P2 normal (vote)
Target Milestone: ---
Assignee: POI Developers List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-05-01 09:20 UTC by Ankur Chauhan
Modified: 2012-05-01 09:29 UTC (History)
0 users



Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Ankur Chauhan 2012-05-01 09:20:15 UTC
code goes somewhat as below:

	HSSFWorkbook workBook = new HSSFWorkbook(); 
	HSSFSheet  sheet = workBook.createSheet("test"); 
	HSSFRow row = sheet.createRow(0);      
	HSSFCellStyle stringCellStyle = workBook.createCellStyle(); 
        stringCellStyle.setDataFormat(HSSFDataFormat.getBuiltinFormat("@")); 
        row.createCell((short) 0).setCellValue(new HSSFRichTextString("hi")); 
        row.getCell((short) 0).setCellType(HSSFCell.CELL_TYPE_STRING); 
        row.getCell((short) 0).setCellStyle(stringCellStyle); 
	    
		 try { 
		     workBook.write(fos); 
		 } catch (IOException ie) { 
		     System.err.println(ie); 
		 } finally { 
		     try { 
         fos.flush(); 
         fos.close(); 
         fos = null; 
     } catch (IOException e) { 

         e.printStackTrace(); 
     } 

Above code works absolutely fine while running from eclipse and poi3.2-final.But when same code is run from jsp it produces following error:
java.lang.NoSuchMethodError: org.apache.poi.util.LittleEndian.putByte([BII)V
Comment 1 Nick Burch 2012-05-01 09:29:28 UTC
You have multiple copies of POI on your classpath, some of which are old. Ensure you only have one set, see the FAQ if you don't know how to check http://poi.apache.org/faq.html