Salve a tutti,
sto sviluppando una applicazione web su Eclipse Neon, utilizzando Apache Tomcat 9. Dato il file search.jsp (ne rappresento solo un pezzo):
<%@page import="cercaPattern.*, searchPattern.*, fuzzydl.exception.*,fuzzydl.parser.*"%>
<%
Cerca ricerca = new Cerca();
try
{
ricerca.cercaPattern();
Search cerca = new Search();
cerca.cercaPattrn();
}
catch (InconsistentOntologyException exc)
{
exc.printStackTrace();
}
catch (FuzzyOntologyException exc)
{
exc.printStackTrace();
}
catch (ParseException exc)
{
exc.printStackTrace();
}
quando l' utente, durante l' esecuzione, clicca su un bottone che va a richiamare tale pagina .jsp, mi appare il seguente problema:
HTTP Status 500 - Unable to compile class for JSP:
type Exception report
message Unable to compile class for JSP:
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: 58 in the jsp file: /search.jsp The type
fuzzydl.exception.InconsistentOntologyException cannot be resolved. It
is indirectly referenced from required .class files 55: try 56:
{ 57: 58: ricerca.cercaPattern(); 59: Search cerca = new Search(); 60: cerca.cercaPattrn(); 61: }
An error occurred at line: 58 in the jsp file: /search.jsp The type
fuzzydl.exception.FuzzyOntologyException cannot be resolved. It is
indirectly referenced from required .class files 55: try 56:
{ 57: 58: ricerca.cercaPattern(); 59: Search cerca = new Search(); 60: cerca.cercaPattrn(); 61: }
An error occurred at line: 58 in the jsp file: /search.jsp The type
fuzzydl.parser.ParseException cannot be resolved. It is indirectly
referenced from required .class files 55: try 56: { 57:
58: ricerca.cercaPattern(); 59: Search cerca = new Search(); 60: cerca.cercaPattrn(); 61: }
An error occurred at line: 58 in the jsp file: /search.jsp The method
cercaPattern() from the type Cerca refers to the missing type
ParseException 55: try 56: { 57: 58:
ricerca.cercaPattern(); 59: Search cerca = new Search(); 60: cerca.cercaPattrn(); 61: }
An error occurred at line: 63 in the jsp file: /search.jsp
InconsistentOntologyException cannot be resolved to a type 60:
cerca.cercaPattrn(); 61: } 62: 63: catch (InconsistentOntologyException exc) 64: { 65:
exc.printStackTrace(); 66: }
An error occurred at line: 67 in the jsp file: /search.jsp
FuzzyOntologyException cannot be resolved to a type 64: { 65:
exc.printStackTrace(); 66: } 67: catch (FuzzyOntologyException exc) 68: { 69:
exc.printStackTrace(); 70: }
An error occurred at line: 71 in the jsp file: /search.jsp
ParseException cannot be resolved to a type 68: { 69:
exc.printStackTrace(); 70: } 71: catch (ParseException exc) 72: { 73: exc.printStackTrace(); 74: }
Stacktrace:
org.apache.jasper.compiler.DefaultErrorHandler.javacError(DefaultErrorHandler.java:103)
org.apache.jasper.compiler.ErrorDispatcher.javacError(ErrorDispatcher.java:212)
org.apache.jasper.compiler.JDTCompiler.generateClass(JDTCompiler.java:457)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:377)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:349)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:333)
org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:600)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:368)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:385)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:329)
javax.servlet.http.HttpServlet.service(HttpServlet.java:729)
org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:53)
Da notare che ho aggiunto esternamente il file FuzzyDL.jar che contiene i 2 package che a loro volta contengono i 3 file .class selezionati nell' immagine in allegato.
Il codice di Cerca.java è il seguente:
package searchPattern;
import java.io.*;
import java.util.*;
import fuzzydl.*;
import fuzzydl.exception.*;
import fuzzydl.milp.*;
import fuzzydl.parser.*;
import fuzzydl.util.*;
import org.semanticweb.owlapi.apibinding.OWLManager;
import org.semanticweb.owlapi.model.IRI;
import org.semanticweb.owlapi.model.OWLAnnotation;
import org.semanticweb.owlapi.model.OWLClass;
import org.semanticweb.owlapi.model.OWLDataFactory;
import org.semanticweb.owlapi.model.OWLEntity;
import org.semanticweb.owlapi.model.OWLIndividual;
import org.semanticweb.owlapi.model.OWLLiteral;
import org.semanticweb.owlapi.model.OWLOntology;
import org.semanticweb.owlapi.model.OWLOntologyCreationException;
import org.semanticweb.owlapi.model.OWLOntologyManager;
import org.semanticweb.owlapi.model.PrefixManager;
import org.semanticweb.owlapi.util.DefaultPrefixManager;
public class Cerca
{
public void cercaPattern () throws IOException, OWLOntologyCreationException, ParseException, FuzzyOntologyException, InconsistentOntologyException
{
System.out.println("palo0");
ConfigReader.loadParameters("CONFIG", new String[0]);
System.out.println("palo1");
Parser parser = new Parser(new FileInputStream("C:\\Users\\Salvatore\\workspace\\progetto_per_ISA\\WebContent\\WEB-INF\\architecturalpatterns2.txt"));
System.out.println("palo2");
parser.Start();
System.out.println("palo3");
KnowledgeBase kb = Parser.getKB("C:\\Users\\Salvatore\\workspace\\progetto_per_ISA\\WebContent\\WEB-INF\\architecturalpatterns.owl");
System.out.println("palo4");
kb.saveToFile("C:\\Users\\Salvatore\\workspace\\progetto_per_ISA\\WebContent\\WEB-INF\\ontologyoutput.txt");
System.out.println("palo5");
}
}
Inoltre, la finestra Console in Eclipse, non mostra le stringhe "palo0" e le altre stringhe contenute in Cerca.java.
Allegati: