jsp error "only a type can be imported"

Allgemeines EE: jsp error "only a type can be imported"

Allgemeines EE Forum.
  1. jsp error "only a type can be imported" #1
    Gaston


    jsp error "only a type can be imported" - Standard jsp error "only a type can be imported"
    Hi, also ich habe ein simples Test.jsp Script dass das lucene.jar benötigt.Mein Provider gewährt mir jsp Unterstützung, jedoch werden die Files im public_html ordner gespeichert, sprich es es gibt keinen typischen webapps bzw webapp ordner mit der bekannten struktur (WEB-INF,META-INF etc.). nun liegt das benötigte lucene.jar im selben ordner wie das
    test jsp skript welches dieses lucene.jar benötigt. Nun bekomme ich eine Fehlerlaufzeitmeldung wie:

    org.apache.jasper.JasperException: Unable to compile class for JSP

    Generated servlet error:
    Only a type can be imported. org.apache.lucene.analysis.Analyzer resolves to a package

    Generated servlet error:
    Only a type can be imported. org.apache.lucene.analysis.standard.StandardAnalyzer resolves to a package

    Generated servlet error:
    Only a type can be imported. org.apache.lucene.document.Document resolves to a package

    Generated servlet error:
    Only a type can be imported. org.apache.lucene.document.Field resolves to a package

    Generated servlet error:
    Only a type can be imported. org.apache.lucene.index.IndexWriter resolves to a package

    An error occurred at line: 3 in the jsp file: /serverindex.jsp
    Generated servlet error:
    Analyzer cannot be resolved or is not a type

    An error occurred at line: 3 in the jsp file: /serverindex.jsp
    Generated servlet error:
    StandardAnalyzer cannot be resolved or is not a type

    An error occurred at line: 3 in the jsp file: /serverindex.jsp
    Generated servlet error:
    IndexWriter cannot be resolved or is not a type

    An error occurred at line: 3 in the jsp file: /serverindex.jsp
    Generated servlet error:
    IndexWriter cannot be resolved or is not a type

    An error occurred at line: 3 in the jsp file: /serverindex.jsp
    Generated servlet error:
    Document cannot be resolved or is not a type

    An error occurred at line: 3 in the jsp file: /serverindex.jsp
    Generated servlet error:
    Document cannot be resolved or is not a type

    An error occurred at line: 3 in the jsp file: /serverindex.jsp
    Generated servlet error:
    Field cannot be resolved


    org.apache.jasper.compiler.DefaultErrorHandler.javacError(DefaultErrorHandler.java:84)
    org.apache.jasper.compiler.ErrorDispatcher.javacError(ErrorDispatcher.java:328)
    org.apache.jasper.compiler.JDTCompiler.generateClass(JDTCompiler.java:397)
    org.apache.jasper.compiler.Compiler.compile(Compiler.java:288)
    org.apache.jasper.compiler.Compiler.compile(Compiler.java:267)
    org.apache.jasper.compiler.Compiler.compile(Compiler.java:255)
    org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:556)
    org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:296)
    org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:295)
    org.apache.jasper.servlet.JspServlet.service(JspServlet.java:245)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:802)


    Mein jsp Script

    Code:
    <%@ page import=" javax.servlet.*, javax.servlet.http.*,java.io.*,org.apache.lucene.analysis.Analyzer,org.apache.lucene.analysis.standard.StandardAnalyzer,org.apache.lucene.document.Document,org.apache.lucene.document.Field,org.apache.lucene.index.IndexWriter" %>
    <%
    
    
    
    		try
    		{
    		String[] text = { "Indexierung mit Lucene", "Suche mit Lucene" };
    		String indexDir = "/home/sn/public_html/";
    		Analyzer analyzer = new StandardAnalyzer();
    		boolean create = true;
    
    		IndexWriter writer = new IndexWriter(indexDir, analyzer, create);
    		out.println("hmmmmmmmm.........");
    		for (int i = 0; i < text.length; i++)
    		{
    			Document document = new Document();
    			document.add(Field.Text("textfeld", text[i]));
    			writer.addDocument(document);
    			out.println("Es klappt");
    		}
    		
    		writer.close();
    		
    		}catch(Exception e)
    		{}
    
    %>

    Bin für jeden Tip dankbar wo der Fehler liegen könnte..


    Danke im Vorraus


    Gaston

  2. jsp error "only a type can be imported" #2
    Gast

    Only a type can be imported. org.apache.lucene.analysis.Analyzer resolves to a package
    Sieth so aus als ob das Package org.apache.lucene.analysis.analyzer heist..

  3. jsp error "only a type can be imported" #3
    Gaston


    mein anliegen hat sich erledigt weil mein webprovider mir entsprechende verzeichnisse eingerichtet hat.


    Gruß

    Gaston

Ähnliche Themen zu jsp error "only a type can be imported"
  1. Eclipse "Selection does not contain a main type"
    Von Viewty-Fan im Forum Java Basics - Anfänger-Themen
    Antworten: 13
    Letzter Beitrag: 18.02.2014, 20:28
  2. Kompletter Pfad aus "input type=file" auslesen
    Von chris80 im Forum Allgemeine Java-Themen
    Antworten: 3
    Letzter Beitrag: 28.06.2011, 14:46
  3. enum Fehlermeldung "The public type Day must be defined in its own file"
    Von Xenon im Forum Java Basics - Anfänger-Themen
    Antworten: 8
    Letzter Beitrag: 08.02.2011, 11:07
  4. Eclipse zeigt "undefined type" an, obwohl alles fu
    Von oetzi im Forum IDEs und Tools
    Antworten: 3
    Letzter Beitrag: 18.11.2008, 19:39
  5. <input type="file"> Problem
    Von DayXtry im Forum Allgemeines EE
    Antworten: 6
    Letzter Beitrag: 15.01.2007, 10:14
Sie betrachten gerade jsp error "only a type can be imported"