klab-ilc-cnr / Maia

0 stars 1 forks source link

Error feature of form type #155

Open MPapini91 opened 2 months ago

MPapini91 commented 2 months ago

Sembra esserci un problema nel recupero delle opzioni per le feature di tipo Form, un errore 500 del tipo:

POST /maia/lexo/data/filteredForms

{"text":"a","searchMode":"startsWith","representationType":"writtenRep","author":"","offset":0,"limit":500}

{
    "timestamp": "2024-08-06T10:23:56.745+00:00",
    "status": 500,
    "error": "Internal Server Error",
    "message": "500 : \"<!doctype html><html lang=\"en\"><head><title>HTTP Status 500 – Internal Server Error</title><style type=\"text/css\">body {font-family:Tahoma,Arial,sans-serif;} h1, h2, h3, b {color:white;background-color:#525D76;} h1 {font-size:22px;} h2 {font-size:16px;} h3 {font-size:14px;} p {font-size:12px;} a {color:black;} .line {height:1px;background-color:#525D76;border:none;}</style></head><body><h1>HTTP Status 500 – Internal Server Error</h1><hr class=\"line\" /><p><b>Type</b> Exception Report</p><p><b>Message</b> java.lang.NullPointerException: Cannot invoke &quot;org.eclipse.rdf4j.query.TupleQueryResult.stream()&quot; because &quot;res&quot; is null</p><p><b>Description</b> The server encountered an unexpected condition that prevented it from fulfilling the request.</p><p><b>Exception</b></p><pre>javax.servlet.ServletException: java.lang.NullPointerException: Cannot invoke &quot;org.eclipse.rdf4j.query.TupleQueryResult.stream()&quot; because &quot;res&quot; is null<EOL>?org.glassfish.jersey.servlet.WebComponent.serviceImpl(WebComponent.java:410)<EOL>?org.glassfish.jersey.servlet.WebComponent.service(WebComponent.java:346)<EOL>?org.glassfish.jersey.servlet.ServletContainer.service(ServletContainer.java:366)<EOL>?org.glassfish.jersey.servlet.ServletContainer.service(ServletContainer.java:319)<EOL>?org.glassfish.jersey.servlet.ServletContainer.service(ServletContainer.java:205)<EOL>?org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:51)<EOL>?it.cnr.ilc.lexo.LexOFilter.doFilter(LexOFilter.java:98)<EOL></pre><p><b>Root Cause</b></p><pre>java.lang.NullPointerException: Cannot invoke &quot;org.eclipse.rdf4j.query.TupleQueryResult.stream()&quot; because &quot;res&quot; is null<EOL>?it.cnr.ilc.lexo.service.helper.TripleStoreDataHelper.newDataList(TripleStoreDataHelper.java:42)<EOL>?it.cnr.ilc.lexo.service.LexiconData.forms(LexiconData.java:864)<EOL>?java.base&#47;jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:103)<EOL>?java.base&#47;java.lang.reflect.Method.invoke(Method.java:580)<EOL>?org.glassfish.jersey.server.model.internal.ResourceMethodInvocationHandlerFactory.lambda$static$0(ResourceMethodInvocationHandlerFactory.java:52)<EOL>?org.glassfish.jersey.server.model.internal.AbstractJavaResourceMethodDispatcher$1.run(AbstractJavaResourceMethodDispatcher.java:124)<EOL>?org.glassfish.jersey.server.model.internal.AbstractJavaResourceMethodDispatcher.invoke(AbstractJavaResourceMethodDispatcher.java:167)<EOL>?org.glassfish.jersey.server.model.internal.JavaResourceMethodDispatcherProvider$ResponseOutInvoker.doDispatch(JavaResourceMethodDispatcherProvider.java:176)<EOL>?org.glassfish.jersey.server.model.internal.AbstractJavaResourceMethodDispatcher.dispatch(AbstractJavaResourceMethodDispatcher.java:79)<EOL>?org.glassfish.jersey.server.model.ResourceMethodInvoker.invoke(ResourceMethodInvoker.java:475)<EOL>?org.glassfish.jersey.server.model.ResourceMethodInvoker.apply(ResourceMethodInvoker.java:397)<EOL>?org.glassfish.jersey.server.model.ResourceMethodInvoker.apply(ResourceMethodInvoker.java:81)<EOL>?org.glassfish.jersey.server.ServerRuntime$1.run(ServerRuntime.java:255)<EOL>?org.glassfish.jersey.internal.Errors$1.call(Errors.java:248)<EOL>?org.glassfish.jersey.internal.Errors$1.call(Errors.java:244)<EOL>?org.glassfish.jersey.internal.Errors.process(Errors.java:292)<EOL>?org.glassfish.jersey.internal.Errors.process(Errors.java:274)<EOL>?org.glassfish.jersey.internal.Errors.process(Errors.java:244)<EOL>?org.glassfish.jersey.process.internal.RequestScope.runInScope(RequestScope.java:265)<EOL>?org.glassfish.jersey.server.ServerRuntime.process(ServerRuntime.java:234)<EOL>?org.glassfish.jersey.server.ApplicationHandler.handle(ApplicationHandler.java:680)<EOL>?org.glassfish.jersey.servlet.WebComponent.serviceImpl(WebComponent.java:394)<EOL>?org.glassfish.jersey.servlet.WebComponent.service(WebComponent.java:346)<EOL>?org.glassfish.jersey.servlet.ServletContainer.service(ServletContainer.java:366)<EOL>?org.glassfish.jersey.servlet.ServletContainer.service(ServletContainer.java:319)<EOL>?org.glassfish.jersey.servlet.ServletContainer.service(ServletContainer.java:205)<EOL>?org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:51)<EOL>?it.cnr.ilc.lexo.LexOFilter.doFilter(LexOFilter.java:98)<EOL></pre><p><b>Note</b> The full stack trace of the root cause is available in the server logs.</p><hr class=\"line\" /><h3>Apache Tomcat/9.0.86</h3></body></html>\"",
    "path": "/maia/lexo/data/filteredForms"
}

Sembra non sia passato il valore della stringa di filtro

MPapini91 commented 2 months ago

@andreabellandi il problema sembra essere a livello di LexO, anche se ovviamente saranno necessarie delle verifiche coordinate. In particolare sembra non riuscire a trovare risultati anche per forme esatte esistenti

magoafono commented 2 months ago

image

Il problema era causato dalla non rigenerazione degli indici di Lucene dopo l'aggiornamento del repo in graphdb. Rimangono, comunque, da gestire le situazioni per le quali si genera una eccezioni nella query SPARQL (come nel caso di problemi negli indici) altrimenti al frontend arriva un error 500 che non sa gestire.