I have written a JSP file that takes the query from user and passes it to a Lucene index searcher. While passing the query it is also passing another parameter city that it has recorded while user was typing the query. The JSP code is as follows:result.jsp\[code\]<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" import="java.util.*,java.io.*,parser.SearchDB,org.apache.lucene.analysis.*" %> <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <%! String myQuery; String city; String latitude; String longitude; %> <% myQuery=request.getParameter("myQuery"); city=request.getParameter("city"); latitude=request.getParameter("latitude"); longitude=request.getParameter("longitude"); Cookie cookies [] = request.getCookies(); Cookie myCity=null; Cookie myLat=null; Cookie myLong=null; if(city!=null) { myCity=new Cookie("city",city); myCity.setMaxAge(365*24*60*60); response.addCookie(myCity); myLat=new Cookie("latitude",latitude); myLat.setMaxAge(365*24*60*60); response.addCookie(myLat); myLong=new Cookie("longitude",longitude); myLong.setMaxAge(365*24*60*60); response.addCookie(myLong); } else { for (int i = 0; i < cookies.length; i++) { if (cookies.getName().equals("city")) { myCity=cookies; city=myCity.getValue(); } else if(cookies.getName().equals("latitude")) { myLat=cookies; latitude=myLat.getValue(); } else if(cookies.getName().equals("longitude")) { myLong=cookies; longitude=myLong.getValue(); } } } SearchDB s = new SearchDB(); System.out.println("Query="+myQuery+" and City="+city); s.searchdb(myQuery, city);%> <form name="frm" method="post" action="result.jsp"> <table width="100%" border="0" cellspacing="0" cellpadding="0"> <tr> <td width="22%"> </td> <td width="78%"> </td> </tr> <tr> <td> </td> <td><input type="text" name="myQuery" placeholder="Type here"></td> </tr> <tr> <td> </td> <td><input type="submit" name="submit" value="http://stackoverflow.com/questions/15737939/Submit"></td> </tr> <tr> <td> </td> <td> </td> </tr> </table> </form> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <title>Insert title here</title> </head> <body> <p>Query phrase is : <%=myQuery%></p> <p>User's city : <%=city%></p> <p>User's latitude : <%=latitude%></p> <p>User's longitude : <%=longitude%></p> </body> </html>\[/code\]Here SearchDB is class that is included in the package named parser that I have imported above. It basically receives the query with parameter city and searches in the Lucene index. The problem is that while running this file result.jsp on server it is repeatedly giving error as follows: an exception occurred in the line where object of class SearchDB is instantiated and among many other things it is showing rootcause as javax.servlet.ServletException: java.lang.NoClassDefFoundError: org/apache/lucene/analysis/Analyzer though I have not used any of the Lucene classes in my JSP code.I have no clue what is causing the error actually. So I am asking if anybody can help me to find the error and fix it. Thank you.