POI 3.7 java.lang.IncompatibleClassChangeError when instantiating a Font

假如想象 提交于 2020-01-16 11:38:27

问题


I am getting a java.lang.IncompatibleClassChangeError with the following snippet:

Workbook workbook = new HSSFWorkbook();
Font arial = workbook.createFont(); // java.lang.IncompatibleClassChangeError thrown here

I am using POI 3.7 with WebSphere 7 Portal Server. The same code (and as far as I can tell, the same jars) worked with Netbeans console application. It also seems that the 3.7 jar is the only one in the classpath. The project also uses JasperReports 4.1.2. Can I provide more information?


回答1:


I'm almost certain that you have an older version of POI on your classpath

There's a section in the POI FAQ that covers this very case. You'll want to use the code from there to identify where the extra copy of POI is coming from, and zap the old jar



来源:https://stackoverflow.com/questions/7995824/poi-3-7-java-lang-incompatibleclasschangeerror-when-instantiating-a-font

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!