0

I am building a Java Px in Oracle Agile 9.3.0.2.

My Px involves interaction with Excel files of both formats (HSSF and XSSF).

I am using Apache POI library for excel file processing.

But i get "java.lang.IncompatibleClassChangeError" for this line :

Workbook workbook = WorkbookFactory.create(ip);

where ip is the input stream of the excel file.

when i try to access any HSSF spreadsheet file. (.xls)

The Px works fine for XSSF spreadsheet files. (.xlsx)

Please help!!!!

MarcoS
  • 13,386
  • 7
  • 42
  • 63
Raj
  • 255
  • 2
  • 6
  • 17
  • have you looked at this [question](http://stackoverflow.com/questions/1980452/what-causes-java-lang-incompatibleclasschangeerror)? – MarcoS May 19 '11 at 07:54

2 Answers2

2

There's a fairly good chance that you have two different copies of Apache POI on your classpath. You need to ensure that all your POI jars (normal, scratchpad, ooxml etc) are from the same version. See the POI FAQ for how you can check what jar file is actually being used in production.

Gagravarr
  • 47,320
  • 10
  • 111
  • 156
  • I have checked every possibility of that but no result. – Raj May 19 '11 at 12:20
  • Did you try the code that the FAQ suggests? You'd be surprised how many people that solves the issue for - a jar they didn't realise is usually the culprit.. – Gagravarr May 19 '11 at 13:59
0

Could you check if there are any poi-*.jar files bundled in the application server itself? If there are any, it can cause similar problems. Maybe do a search with TotalCommander in compressed files as well for Workbook.class or WorkbookFactory.class to ensure these classes cannot be found in any other jars..

jabal
  • 11,987
  • 12
  • 51
  • 99