java.lang.ClassNotFoundException: org.apache.xmlbeans.XmlOptions

后端 未结 3 524
無奈伤痛
無奈伤痛 2021-01-28 15:23

I am trying to use POI in a servlet to process an uploaded file as Excel file:

public static String readExcel(InputStream inp) {
    // InputStream inp = null;
          


        
3条回答
  •  谎友^
    谎友^ (楼主)
    2021-01-28 15:59

    As detailed in the Apache POI page on Components and their Dependencies...

    If you want to use Common SS code, such as WorkbookFactory, you need both the poi and poi-ooxml POI jars on your classpath. In addition, you also need their dependencies too. One of the listed dependencies is xmlbeans, which incidentally is where your missing class comes from

    So, you just need to review the Components and Dependencies page, then make sure you include the appropriate jars from the binary package of Apache POI on your classpath. (Or use Maven and let it worry about that for you)

提交回复
热议问题