Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8695479
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T01:02:47+00:00 2026-06-13T01:02:47+00:00

Here is my servlet class package com.zaggle; import java.io.IOException; import javax.servlet.RequestDispatcher; import javax.servlet.ServletException; import

  • 0

Here is my servlet class

package com.zaggle;

import java.io.IOException;

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

/**
 * Servlet implementation class FirstServlet
 */
public class FirstServlet extends HttpServlet {
private static final long serialVersionUID = 1L;

/**
 * @see HttpServlet#HttpServlet()
 */
public FirstServlet() {
    super();
    // TODO Auto-generated constructor stub
}

/**
 * @see HttpServlet#doGet(HttpServletRequest request, HttpServletResponse response)
 */
protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
    // TODO Auto-generated method stub
}

/**
 * @see HttpServlet#doPost(HttpServletRequest request, HttpServletResponse response)
 */
protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
    // TODO Auto-generated method stub
    String[] data;String val=null,name;
    name=request.getParameter("excelsheet");
    System.out.println(name);
        response.setContentType("text/html");
         UploadExcel ex= new UploadExcel();
         data=ex.procedure(name);
     System.out.println(name);

    request.setAttribute("val", data);
    System.out.println(val);

    String destination="/NewFile1.jsp";
    RequestDispatcher rd=getServletContext().getRequestDispatcher(destination);
    //doGet(request, response);
    rd.forward(request, response);


}

}  

Here is my normal java class which I am using in servlet class

package com.zaggle;

import java.io.FileInputStream;
import java.io.IOException;
import java.util.Iterator;
import java.util.Scanner;
import java.util.Vector;
import javax.swing.plaf.basic.BasicInternalFrameTitlePane.RestoreAction;
import org.apache.poi.hssf.record.formula.functions.Goto;
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 UploadExcel {
public String[] procedure(String filename) {
    //  Scanner scanner = new Scanner(System.in);
      //System.out.println("Please enter a filename with extention to upload");

    String fileName = "C:\\"+filename;//+scanner.nextLine();
    String[] dataHolder = ReadCSV(fileName);
   // printCellDataToConsole(dataHolder);
    return dataHolder;
}

public static void printCellDataToConsole(Vector dataHolder) {
    // TODO Auto-generated method stub
    for(int i=0;i<dataHolder.size();i++)
    {
        Vector column=(Vector)dataHolder.elementAt(i);
        for (int j = 0; j < column.size(); j++) {
            HSSFCell myCell = (HSSFCell) column.elementAt(j);
            String stringCellValue = myCell.toString();

            System.out.print(stringCellValue + "\t");
    }
    System.out.println();

    }
}

public static String[] ReadCSV(String fileName) {
    // TODO Auto-generated method stub
     Vector cellVectorHolder = new Vector();
     String[] col = null;
     try {
         FileInputStream myInput = new FileInputStream(fileName);

         POIFSFileSystem myFileSystem = new POIFSFileSystem(myInput);

         HSSFWorkbook myWorkBook = new HSSFWorkbook(myFileSystem);

         HSSFSheet mySheet = myWorkBook.getSheetAt(0);

         Iterator rowIter = mySheet.rowIterator();

         while (rowIter.hasNext()) {
                 HSSFRow myRow = (HSSFRow) rowIter.next();
                 Iterator cellIter = myRow.cellIterator();
                 Vector column = new Vector();
                 while (cellIter.hasNext()) {
                         HSSFCell myCell = (HSSFCell) cellIter.next();
                         column.addElement(myCell);

                 }
                  col=column.toString().split(" ");
                 cellVectorHolder.addElement(column);
         }
 } catch(IOException ie)
 {
     System.err.println("Please enter a valid input");

 }
     catch (Exception e) {
         e.printStackTrace();
 }
 //return cellVectorHolder;
     return col;
}

}

When i run I am getting the error like this

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
com.zaggle.UploadExcel.ReadCSV(UploadExcel.java:52)
com.zaggle.UploadExcel.procedure(UploadExcel.java:24)
com.zaggle.FirstServlet.doPost(FirstServlet.java:42)
javax.servlet.http.HttpServlet.service(HttpServlet.java:637)
javax.servlet.http.HttpServlet.service(HttpServlet.java:717)

Why am I getting this error. Can anyone help me?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-13T01:02:48+00:00Added an answer on June 13, 2026 at 1:02 am

    It looks like you’ve forgotten to include the POI library on the CLASSPATH (e.g. It’s not referenced by your web app). You can include this lib under WEB-INF/lib (in your WAR archive or in the exploded directory format) or it can sit elsewhere in your app server/web server CLASSPATH.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have the following Java class: package web; import javax.servlet.*; import javax.servlet.http.*; import java.io.*;
I am trying to use a RequestDispatcher to send parameters from a servlet. Here
Here's my code in the <head></head> : <link rel=stylesheet href=http://code.jquery.com/mobile/1.1.0/jquery.mobile-1.1.0.min.css /> <script type=text/javascript src=http://code.jquery.com/jquery-1.7.1.min.js></script>
I am attempting to implement logging as described here http://www.vaannila.com/spring/spring-interceptor.html This is the handler
I am trying to complete the tutorial at http://www.ajaxprojects.com/ajax/tutorialdetails.php?itemid=438 It seems that the servlet
Here's the view: @if (stream.StreamSourceId == 1) { <img class=source src=@Url.Content(~/Public/assets/images/own3dlogo.png) alt= /> }
I am stuck on this Spring MVC tutorial for newbies: http://sites.google.com/site/springmvcnetbeans/step-by-step/ I am the
I have a custom EL function defined as follows: <function> ... <function-signature> java.lang.String getAsText(com.test.Outerclass.InnerEnum)
Here is the code in a function I'm trying to revise. This example works
Here is the code: create table `team`.`User`( `UserID` bigint NOT NULL AUTO_INCREMENT , `Username`

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.