From java-user-return-41053-apmail-lucene-java-user-archive=lucene.apache.org@lucene.apache.org Thu Jul 02 06:31:30 2009 Return-Path: Delivered-To: apmail-lucene-java-user-archive@www.apache.org Received: (qmail 15794 invoked from network); 2 Jul 2009 06:31:30 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 2 Jul 2009 06:31:30 -0000 Received: (qmail 58676 invoked by uid 500); 2 Jul 2009 06:31:38 -0000 Delivered-To: apmail-lucene-java-user-archive@lucene.apache.org Received: (qmail 58600 invoked by uid 500); 2 Jul 2009 06:31:37 -0000 Mailing-List: contact java-user-help@lucene.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: java-user@lucene.apache.org Delivered-To: mailing list java-user@lucene.apache.org Received: (qmail 58590 invoked by uid 99); 2 Jul 2009 06:31:37 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 02 Jul 2009 06:31:37 +0000 X-ASF-Spam-Status: No, hits=2.2 required=10.0 tests=HTML_MESSAGE,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of dioxide.software@gmail.com designates 209.85.222.198 as permitted sender) Received: from [209.85.222.198] (HELO mail-pz0-f198.google.com) (209.85.222.198) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 02 Jul 2009 06:31:27 +0000 Received: by pzk36 with SMTP id 36so1636106pzk.29 for ; Wed, 01 Jul 2009 23:31:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :from:date:message-id:subject:to:content-type; bh=ZFbwa3UOObfOOnrEbjcFBrz9O2QzRO7cvnurm0o5EYU=; b=twmx/6bXjJ9bu44bF5Am+VboIUlZyHti2bhQOhZR0Mv51W8CYAUdBhsqSKp+IuuPPo XZ3323v2NBE67h1ZZ8EahYvETTTC/CtcRhj1QgX9sOiRdMe2ysic8ES1wjyDPmszFz8I gbA+Eor3v6NLk3WIOzBomV6ZMy2pV8qntJThw= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type; b=DJvMqC/gch3BURmxSf0YFMscn7oZagZZ1dYL1lLfZ2KctjRUsurmcZd2akxU4Z1BIq o1OgEBf5EBztYrd84XOg9ngYhtgFYd/kqJxB9dK7Gau+NGyQQsVeHwkwdF/knkTIUWNi eTATfwC9CtPgVELaNzLzLp1pwuYRqoAdqqAvM= MIME-Version: 1.0 Received: by 10.143.17.6 with SMTP id u6mr1741752wfi.341.1246516266080; Wed, 01 Jul 2009 23:31:06 -0700 (PDT) In-Reply-To: References: From: KK Date: Thu, 2 Jul 2009 12:00:46 +0530 Message-ID: <8db6d74a0907012330g59a57767ja33b4f8941700c8b@mail.gmail.com> Subject: Re: Problem in Running the Lucene web application demo To: java-user@lucene.apache.org Content-Type: multipart/alternative; boundary=001636e0b4e43f1b0a046db32fdc X-Virus-Checked: Checked by ClamAV on apache.org --001636e0b4e43f1b0a046db32fdc Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit no idea about the webapp demo app, but are you sure you have all the required files like the jar in the right place? On Sat, Jun 27, 2009 at 9:50 PM, mayank juneja wrote: > Hi > > I am a new user to Lucene. > > I tried running the Lucene web application demo provided with the source. I > am able to index the files but I get the following error when I try to > search a query from the browser. > > HTTP Status 500 - > ------------------------------ > > *type* Exception report > > *message* > > *description* *The server encountered an internal error () that prevented > it > from fulfilling this request.* > > *exception* > > org.apache.jasper.JasperException: Unable to compile class for JSP: > > An error occurred at line: 10 in the generated java file > Only a type can be imported. > org.apache.lucene.analysis.standard.StandardAnalyzer resolves to a > package > > An error occurred at line: 16 in the generated java file > Only a type can be imported. org.apache.lucene.demo.html.Entities > resolves to a package > > An error occurred at line: 32 in the jsp file: /luceneweb/results.jsp > IndexSearcher cannot be resolved to a type > 29: <% > 30: boolean error = false; //used to control > flow for error messages > 31: String indexName = indexLocation; //local copy of > the configuration variable > 32: IndexSearcher searcher = null; //the searcher > used to open/search the index > 33: Query query = null; //the Query > created by the QueryParser > 34: Hits hits = null; //the search results > 35: int startindex = 0; //the first index > displayed on this page > > > An error occurred at line: 33 in the jsp file: /luceneweb/results.jsp > Query cannot be resolved to a type > 30: boolean error = false; //used to control > flow for error messages > 31: String indexName = indexLocation; //local copy of > the configuration variable > 32: IndexSearcher searcher = null; //the searcher > used to open/search the index > 33: Query query = null; //the Query > created by the QueryParser > 34: Hits hits = null; //the search results > 35: int startindex = 0; //the first index > displayed on this page > 36: int maxpage = 50; //the maximum > items displayed on this page > > > An error occurred at line: 34 in the jsp file: /luceneweb/results.jsp > Hits cannot be resolved to a type > 31: String indexName = indexLocation; //local copy of > the configuration variable > 32: IndexSearcher searcher = null; //the searcher > used to open/search the index > 33: Query query = null; //the Query > created by the QueryParser > 34: Hits hits = null; //the search results > 35: int startindex = 0; //the first index > displayed on this page > 36: int maxpage = 50; //the maximum > items displayed on this page > 37: String queryString = null; //the query > entered in the previous page > > > An error occurred at line: 45 in the jsp file: /luceneweb/results.jsp > IndexSearcher cannot be resolved to a type > 42: //less > 43: > 44: try { > 45: searcher = new IndexSearcher(indexName); //create > an indexSearcher for our page > 46: //NOTE: > this operation is slow for large > 47: //indices > (much slower than the search itself) > 48: //so you > might want to keep an IndexSearcher > > > An error occurred at line: 79 in the jsp file: /luceneweb/results.jsp > Analyzer cannot be resolved to a type > 76: > //query string so you get the > 77: > //treatment > 78: > 79: Analyzer analyzer = new StandardAnalyzer(); > //construct our usual analyzer > 80: try { > 81: QueryParser qp = new > QueryParser("contents", analyzer); > 82: query = qp.parse(queryString); //parse the > > > An error occurred at line: 79 in the jsp file: /luceneweb/results.jsp > StandardAnalyzer cannot be resolved to a type > 76: > //query string so you get the > 77: > //treatment > 78: > 79: Analyzer analyzer = new StandardAnalyzer(); > //construct our usual analyzer > 80: try { > 81: QueryParser qp = new > QueryParser("contents", analyzer); > 82: query = qp.parse(queryString); //parse the > > > An error occurred at line: 81 in the jsp file: /luceneweb/results.jsp > QueryParser cannot be resolved to a type > 78: > 79: Analyzer analyzer = new StandardAnalyzer(); > //construct our usual analyzer > 80: try { > 81: QueryParser qp = new > QueryParser("contents", analyzer); > 82: query = qp.parse(queryString); //parse the > 83: } catch (ParseException e) { > //query and construct the Query > 84: > //object > > > An error occurred at line: 81 in the jsp file: /luceneweb/results.jsp > QueryParser cannot be resolved to a type > 78: > 79: Analyzer analyzer = new StandardAnalyzer(); > //construct our usual analyzer > 80: try { > 81: QueryParser qp = new > QueryParser("contents", analyzer); > 82: query = qp.parse(queryString); //parse the > 83: } catch (ParseException e) { > //query and construct the Query > 84: > //object > > > An error occurred at line: 83 in the jsp file: /luceneweb/results.jsp > ParseException cannot be resolved to a type > 80: try { > 81: QueryParser qp = new > QueryParser("contents", analyzer); > 82: query = qp.parse(queryString); //parse the > 83: } catch (ParseException e) { > //query and construct the Query > 84: > //object > 85: > //if it's just "operator error" > 86: > //send them a nice error HTML > > > An error occurred at line: 89 in the jsp file: /luceneweb/results.jsp > e cannot be resolved > 86: > //send them a nice error HTML > 87: > 88: %> > 89:

Error while parsing query: > <%=escapeHTML(e.getMessage())%>

> 90: <% > 91: error = true; > //don't bother with the rest of > 92: > //the page > > > An error occurred at line: 127 in the jsp file: /luceneweb/results.jsp > Document cannot be resolved to a type > 124: %> > 125: > 126: <% > 127: Document doc = hits.doc(i); > //get the next document > 128: String doctitle = doc.get("title"); > //get its title > 129: String url = doc.get("path"); > //get its path field > 130: if (url != null && > url.startsWith("../webapps/")) { // strip off ../webapps prefix if > present > > > Stacktrace: > > org.apache.jasper.compiler.DefaultErrorHandler.javacError(DefaultErrorHandler.java:92) > > org.apache.jasper.compiler.ErrorDispatcher.javacError(ErrorDispatcher.java:330) > > org.apache.jasper.compiler.JDTCompiler.generateClass(JDTCompiler.java:439) > org.apache.jasper.compiler.Compiler.compile(Compiler.java:334) > org.apache.jasper.compiler.Compiler.compile(Compiler.java:312) > org.apache.jasper.compiler.Compiler.compile(Compiler.java:299) > > org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:586) > > org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:317) > > org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:342) > org.apache.jasper.servlet.JspServlet.service(JspServlet.java:267) > javax.servlet.http.HttpServlet.service(HttpServlet.java:717) > > > > Can someone please help me to get through this error. Assistance will be > highly appreciated. > > Thanks > Mayank Juneja > --001636e0b4e43f1b0a046db32fdc--