• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Rob Spoor
  • Tim Cooke
  • Junilu Lacar
Sheriffs:
  • Henry Wong
  • Liutauras Vilda
  • Jeanne Boyarsky
Saloon Keepers:
  • Jesse Silverman
  • Tim Holloway
  • Stephan van Hulst
  • Tim Moores
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Mikalai Zaikin
  • Piet Souris

an Exception report

 
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
what's the problem ?who can tell me how to deal with !


HTTP Status 500 -

--------------------------------------------------------------------------------

type Exception report

message

description The server encountered an internal error () that prevented it from fulfilling this request.

exception

javax.servlet.ServletException: Servlet execution threw an exception


root cause

java.lang.NoClassDefFoundError: org/apache/poi/poifs/filesystem/POIFSFileSystem
poi.GetAttribute.doPost(GetAttribute.java:28)
javax.servlet.http.HttpServlet.service(HttpServlet.java:763)
javax.servlet.http.HttpServlet.service(HttpServlet.java:856)


note The full stack trace of the root cause is available in the Tomcat logs.


--------------------------------------------------------------------------------

Apache Tomcat/5.0.12
 
Yaren Hearst
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
this is the servlet,I haven't change it ,but the error suddenly came .


package poi;

import java.io.FileInputStream;
import java.io.IOException;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.apache.poi.hssf.usermodel.HSSFCell;
import org.apache.poi.hssf.usermodel.HSSFRow;
import org.apache.poi.hssf.usermodel.HSSFSheet;
import org.apache.poi.hssf.usermodel.HSSFWorkbook;
import org.apache.poi.poifs.filesystem.POIFSFileSystem;

public class GetAttribute extends HttpServlet {
public void doGet(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
doPost(request, response);
}

public void doPost(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
try {

FileInputStream fileIn = new FileInputStream("F:\\workspace\\poi\\workbook.xls");
POIFSFileSystem fs = new POIFSFileSystem(fileIn);
HSSFWorkbook wb = new HSSFWorkbook(fs);
HSSFSheet sheet = wb.getSheetAt(0);
int row1 = Integer.parseInt(request.getParameter("row")) - 1;
HSSFRow row = sheet.getRow(row1);
short cell1 = (short) (Integer.parseInt(request.getParameter("cell")) - 1);
HSSFCell cell = row.getCell(cell1);

request.setAttribute("cell", cell);
String att = request.getParameter("att");

if (att.equals("Cell")) {
request.getRequestDispatcher("./CellAtt").forward(request,response);
} else if (att.equals("CellStyle")){
request.getRequestDispatcher("/ShowCellStyle.jsp").forward(request,response);
}else{
request.getRequestDispatcher("./Font").forward(request,response);
}

} catch (Exception e) {
e.printStackTrace();
System.out.println("error in servlet");
}
request.getRequestDispatcher("/error.jsp");

}
}
 
Ranch Hand
Posts: 1325
Android Java Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Yaren Hearst:

java.lang.NoClassDefFoundError:rg/apache/poi/poifs/filesystem/POIFSFileSystem



This occurs because the classpath is not setup or referenced correctly.
 
Sheriff
Posts: 13411
Firefox Browser VI Editor Redhat
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Saif uddin:


This occurs because the classpath is not setup or referenced correctly.



Tomcat ignores your classpath.
Where did you put the jar files for the libraries you're using (Apache POI)?
 
Yaren Hearst
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
oh
the jar has removed to another file and I haven't found.
thank you!!
reply
    Bookmark Topic Watch Topic
  • New Topic