Only 48 hours left in the trailboss' kickstarter!

New rewards and stretch goals. CLICK HERE!



  • Post Reply Bookmark Topic Watch Topic
  • New Topic

an Exception report  RSS feed

 
Yaren Hearst
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • 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
  • 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");

}
}
 
Muhammad Saifuddin
Ranch Hand
Posts: 1325
Android Java Windows
  • Mark post as helpful
  • send pies
  • 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.
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
  • Mark post as helpful
  • send pies
  • 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
  • Quote
  • Report post to moderator
oh
the jar has removed to another file and I haven't found.
thank you!!
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!