Note that there are some explanatory texts on larger screens.

plurals
  1. PONoClassDefFound Exception
    primarykey
    data
    text
    <p>I am using apache poi to open an existing excel file.</p> <pre><code>public static int generateReport(Calendar csdate,Calendar cedate) throws Exception { FileInputStream fileIn =null; FileOutputStream fileOut = null; int sum=0;//For calculating the total number of tickets final Workbook wb; fileIn =new FileInputStream("d:\\excelfiles\\TicketsReport.xlsm"); wb = org.apache.poi.ss.usermodel.WorkbookFactory.create(fileIn);&lt;-- Exception final Sheet sheet = wb.getSheet("Report"); //rest of stuff } </code></pre> <p>I have a servlet which takes the dates from an html page and call <code>generateReport()</code>. The problem is this program was running previously with same <code>tomcat 6</code> version and <code>servlet2.4</code> version.In eclipse there is no compile time error at the <code>WorkbookFactory.create()</code> line. Here's the stack trace.</p> <pre><code>java.lang.NoClassDefFoundError: org/apache/poi/ss/usermodel/WorkbookFactory at ReportFromJira.generateReport(ReportFromJira.java:59) at JiraReportServlet.doPost(JiraReportServlet.java:52) at JiraReportServlet.doGet(JiraReportServlet.java:36) at javax.servlet.http.HttpServlet.service(HttpServlet.java:617) at javax.servlet.http.HttpServlet.service(HttpServlet.java:717) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:293) at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:849) at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583) at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:454) at java.lang.Thread.run(Unknown Source) </code></pre> <p>When I manually explored the jar files I found out that.</p> <pre><code>poi-3.8-20120326.jar contains org.apache.poi.ss.usermodel-&gt;Workbook.class file and poi-ooxml-3.8-20120326.jar contains org.apache.poi.ss.usermodel-&gt;WorkbookFactory.class file </code></pre> <p>I have both the jar files included in my class path.</p> <p>any idea why the exception?</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload