NoClassDefFoundError:javax/xml/stream/XMLStreamException [英] NoClassDefFoundError: javax/xml/stream/XMLStreamException
本文介绍了NoClassDefFoundError:javax/xml/stream/XMLStreamException的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
尝试编写.xlsx file using Apache POI
NoClassDefFoundError: javax/xml/stream/XMLStreamException
这是代码段:-
XSSFWorkbook wb = new XSSFWorkbook();
Sheet sheet = wb.createSheet();
Row row = sheet.createRow(0);
Cell cell = row.createCell(0);
cell.setCellValue(100);
FileOutputStream fileOut = new FileOutputStream("D:\\workspace\\April\\Excel Test\\workbook.xlsx");
wb.write(fileOut);
fileOut.close();
我包含以下广口瓶
- dom4j-1.6.1
- poi-ooxml-3.5-FINAL
- poi-3.6-20091214
- xmlbeans-2.3.0
- ooxml-schemas-1.0
请让我知道我在这里做错了什么,或者我错过了什么.
Please let me know what i am doing wrong here or i am missing something.
推荐答案
您缺少stax API jar
You're missing the stax API jar
如果查看 POI组件页面,您会看到ooxml-schemas jar取决于STAX API jar(通常由stax-api-1.0.1.jar
提供)
If you look at the POI Components page you'll see that the ooxml-schemas jar depends on a STAX API jar (most typically provided by stax-api-1.0.1.jar
)
查看您的POI二进制文件下载,在ooxml-lib
目录中,您将看到所需的jar.或者,如果您使用Maven,它将为您下载依赖项
Look in your POI binary download, and in the ooxml-lib
directory you'll see the jar you need. Alternately, if you use Maven, it'll download the dependency for you
这篇关于NoClassDefFoundError:javax/xml/stream/XMLStreamException的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文