Created attachment 25507 [details] xlsx that shows the issue. Similar to ticket 48494 Given the following snippet in a J2EE app, using POI 3.6 20091214: String realPath = getServletContext().getRealPath("/WEB-INF/Book1.xlsx"); InputStream inp = new FileInputStream(realPath); Workbook wb = WorkbookFactory.create(inp); wb.createSheet("new sheet"); // Write the output to a file realPath = getServletContext().getRealPath("/WEB-INF/Book1_out.xlsx"); FileOutputStream fileOut = new FileOutputStream(realPath); wb.write(fileOut); fileOut.close(); this dies on the .write() call with: javax.servlet.ServletException: java.lang.NoClassDefFoundError: org/openxmlformats/schemas/spreadsheetml/x2006/main/CTDxfs$1 org.apache.jasper.runtime.PageContextImpl.doHandlePageException(PageContextImpl.java:855) org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:784) org.apache.jsp.About_jsp._jspService(About_jsp.java:112) org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70) javax.servlet.http.HttpServlet.service(HttpServlet.java:803) org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:387) org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:320) org.apache.jasper.servlet.JspServlet.service(JspServlet.java:266) javax.servlet.http.HttpServlet.service(HttpServlet.java:803) org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96) commenting out the .createSheet() avoids the error, avoiding conditional formatting avoids the error. (Cell E1 contains the conditional formatting in the attachment.)
This sort of issue has been discussed a large number of times in bugs and on the mailing lists.... Short term, you'll need to use the full ooxml schemas jar, not the minimal one Longer term, please submit a new unit test that uses the extra ooxml classes that you need, so that our build script which identifies only the bits of the full ooxml jar that are routinely used can pick it up and include it in the next version
(In reply to comment #1) > This sort of issue has been discussed a large number of times in bugs and on > the mailing lists.... For those who end up finding /this/ bug when searching ... > Short term, you'll need to use the full ooxml schemas jar, not the minimal one And this is described here: https://issues.apache.org/bugzilla/show_bug.cgi?id=49325 specifically: >> As a workaround, replacing poi-ooxml-schemas-3.6-20091214.jar with >> ooxml-schemas-1.0.jar downloaded from >> http://mirrors.ibiblio.org/pub/mirrors/maven2//org/apache/poi/ooxml-schemas/1.0/ >> resolved the issue. > Longer term, please submit a new unit test that uses the extra ooxml classes > that you need, so that our build script which identifies only the bits of the > full ooxml jar that are routinely used can pick it up and include it in the > next version
http://poi.apache.org/faq.html#faq-N10025 also covers this too