Bug 53167

Summary: HSSFWorkbook.write(FileOutputStream) method Throwing java.lang.NoSuchMethodError: org.apache.poi.util.LittleEndian.putByte([BII)V
Product: POI Reporter: Ankur Chauhan <ankur.bitsian>
Component: HSSFAssignee: POI Developers List <dev>
Status: RESOLVED INVALID    
Severity: normal    
Priority: P2    
Version: 3.2-FINAL   
Target Milestone: ---   
Hardware: PC   
OS: All   

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