epimorphics / elda

Epimorphics implementation of the Linked Data API
Other
53 stars 23 forks source link

Dependency conflict in elda-lda causes "Problem running query for SparqlSource" #209

Open jgrzebyta opened 6 years ago

jgrzebyta commented 6 years ago

Elda: all OS: linux host + docker containers within tomcat:8.5-jre8-alpine triple store: RDF4J war from maven, locally compiled wars. Not affected by stable wars taken from a package .tar.gz or .zip . I have checked and it seems all wars are the same but compiled by different people. RDF4J is not reason of error.

The minimalistic project available at http://github.com/jgrzebyta/elda-mini

Full stacktrace looks like:

adalab-elda_1  | 2018-03-20 14:39:26,871 DEBUG [http-nio-8080-exec-1] (RouterRestlet.java:347) - handling request 'http://adalab-elda:8080/resource/gene'
adalab-elda_1  | 2018-03-20 14:39:27,847 ERROR [http-nio-8080-exec-1] (RouterRestlet.java:472) - Exception: Problem running query for SparqlSource{http://rdf4j:8080/rdf4j-server/repositories/adalab; unauthenticated}: Problems with HTTP response (was it an HTTP server?)
adalab-elda_1  | 2018-03-20 14:39:27,851 DEBUG [http-nio-8080-exec-1] (RouterRestlet.java:473) - com.epimorphics.lda.exceptions.EldaException: Problem running query for SparqlSource{http://rdf4j:8080/rdf4j-server/repositories/adalab; unauthenticated}: Problems with HTTP response (was it an HTTP server?)
adalab-elda_1  |    at com.epimorphics.lda.exceptions.EldaException.ARQ_Exception(EldaException.java:66)
adalab-elda_1  |    at com.epimorphics.lda.query.APIQuery.runQuery(APIQuery.java:907)
adalab-elda_1  |    at com.epimorphics.lda.core.APIEndpointImpl.freshResponse(APIEndpointImpl.java:125)
adalab-elda_1  |    at com.epimorphics.lda.core.APIEndpointImpl.call(APIEndpointImpl.java:111)
adalab-elda_1  |    at com.epimorphics.lda.core.APIEndpointUtil.call(APIEndpointUtil.java:53)
adalab-elda_1  |    at com.epimorphics.lda.restlets.RouterRestlet.runEndpoint(RouterRestlet.java:398)
adalab-elda_1  |    at com.epimorphics.lda.restlets.RouterRestlet.requestHandler(RouterRestlet.java:265)
adalab-elda_1  |    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
adalab-elda_1  |    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
adalab-elda_1  |    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
adalab-elda_1  |    at java.lang.reflect.Method.invoke(Method.java:498)
adalab-elda_1  |    at com.sun.jersey.spi.container.JavaMethodInvokerFactory$1.invoke(JavaMethodInvokerFactory.java:60)
adalab-elda_1  |    at com.sun.jersey.server.impl.model.method.dispatch.AbstractResourceMethodDispatchProvider$ResponseOutInvoker._dispatch(AbstractResourceMethodDispatchProvider.java:205)
adalab-elda_1  |    at com.sun.jersey.server.impl.model.method.dispatch.ResourceJavaMethodDispatcher.dispatch(ResourceJavaMethodDispatcher.java:75)
adalab-elda_1  |    at com.sun.jersey.server.impl.uri.rules.HttpMethodRule.accept(HttpMethodRule.java:302)
adalab-elda_1  |    at com.sun.jersey.server.impl.uri.rules.ResourceClassRule.accept(ResourceClassRule.java:108)
adalab-elda_1  |    at com.sun.jersey.server.impl.uri.rules.RightHandPathRule.accept(RightHandPathRule.java:147)
adalab-elda_1  |    at com.sun.jersey.server.impl.uri.rules.RootResourceClassesRule.accept(RootResourceClassesRule.java:84)
adalab-elda_1  |    at com.sun.jersey.server.impl.application.WebApplicationImpl._handleRequest(WebApplicationImpl.java:1542)
adalab-elda_1  |    at com.sun.jersey.server.impl.application.WebApplicationImpl._handleRequest(WebApplicationImpl.java:1473)
adalab-elda_1  |    at com.sun.jersey.server.impl.application.WebApplicationImpl.handleRequest(WebApplicationImpl.java:1419)
adalab-elda_1  |    at com.sun.jersey.server.impl.application.WebApplicationImpl.handleRequest(WebApplicationImpl.java:1409)
adalab-elda_1  |    at com.sun.jersey.spi.container.servlet.WebComponent.service(WebComponent.java:409)
adalab-elda_1  |    at com.sun.jersey.spi.container.servlet.ServletContainer.service(ServletContainer.java:558)
adalab-elda_1  |    at com.sun.jersey.spi.container.servlet.ServletContainer.doFilter(ServletContainer.java:927)
adalab-elda_1  |    at com.sun.jersey.spi.container.servlet.ServletContainer.doFilter(ServletContainer.java:875)
adalab-elda_1  |    at com.sun.jersey.spi.container.servlet.ServletContainer.doFilter(ServletContainer.java:829)
adalab-elda_1  |    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
adalab-elda_1  |    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
adalab-elda_1  |    at com.epimorphics.lda.support.LogRequestFilter.doFilter(LogRequestFilter.java:103)
adalab-elda_1  |    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
adalab-elda_1  |    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
adalab-elda_1  |    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:198)
adalab-elda_1  |    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:96)
adalab-elda_1  |    at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:496)
adalab-elda_1  |    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:140)
adalab-elda_1  |    at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:81)
adalab-elda_1  |    at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:650)
adalab-elda_1  |    at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:87)
adalab-elda_1  |    at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:342)
adalab-elda_1  |    at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:803)
adalab-elda_1  |    at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66)
adalab-elda_1  |    at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:790)
adalab-elda_1  |    at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1459)
adalab-elda_1  |    at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49)
adalab-elda_1  |    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
adalab-elda_1  |    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
adalab-elda_1  |    at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
adalab-elda_1  |    at java.lang.Thread.run(Thread.java:748)
adalab-elda_1  | Caused by: HttpException: java.lang.NullPointerException: Problems with HTTP response (was it an HTTP server?)
adalab-elda_1  |    at com.hp.hpl.jena.sparql.engine.http.HttpQuery.execCommon(HttpQuery.java:417)
adalab-elda_1  |    at com.hp.hpl.jena.sparql.engine.http.HttpQuery.execGet(HttpQuery.java:289)
adalab-elda_1  |    at com.hp.hpl.jena.sparql.engine.http.HttpQuery.exec(HttpQuery.java:240)
adalab-elda_1  |    at com.hp.hpl.jena.sparql.engine.http.QueryEngineHTTP.execSelect(QueryEngineHTTP.java:302)
adalab-elda_1  |    at com.epimorphics.lda.sources.SourceBase.executeSelect(SourceBase.java:109)
adalab-elda_1  |    at com.epimorphics.lda.query.APIQuery.runGeneralQuery(APIQuery.java:1026)
adalab-elda_1  |    at com.epimorphics.lda.query.APIQuery.selectResources(APIQuery.java:990)
adalab-elda_1  |    at com.epimorphics.lda.query.APIQuery.runQueryWithSource(APIQuery.java:917)
adalab-elda_1  |    at com.epimorphics.lda.query.APIQuery.runQuery(APIQuery.java:905)
adalab-elda_1  |    ... 47 more
adalab-elda_1  | Caused by: java.lang.NullPointerException
adalab-elda_1  |    at java.net.URLDecoder.decode(URLDecoder.java:136)
adalab-elda_1  |    at com.hp.hpl.jena.sparql.util.Convert.decWWWForm(Convert.java:75)
adalab-elda_1  |    at com.hp.hpl.jena.sparql.engine.http.HttpQuery.execCommon(HttpQuery.java:413)
adalab-elda_1  |    ... 55 more
jgrzebyta commented 6 years ago

The problem occurs because ARQ module reads the response message from httpConnection. If there is no value (value = null) then throws error. Currently setting the response message within httpResponse is deprecated: HttpServletResponse#setStatus(int, java.lang.String).

The problem is solved in the latest ARQ (version 3.6.0). The earliest ARQ version without the erroneous code is 2.11.0.

jgrzebyta commented 6 years ago

There is a dependency conflict within elda-lda:

It is directly enforced in pom to use org.apache.jena:jena-tdb:0.10.1 while com.epimorphics:libs enforce to use jena-tdb:1.1.2.

Conflict in jena-tdb causes different java-arq is packed into war file. Epimorphics's download server has wars with jena-arq-2.10.1 but if I compiled myself I had loaded proper version jena-arq-2.11.1

jgrzebyta commented 6 years ago

Problem solved in my branch custom until commit 17adf3cfe47aecc8bee9316b8db189308a91a7bb

rob-metalinkage commented 5 years ago

Thanks for writing this up - was most helpful! 2.11 worked for me , 3.x didnt - would need to add a bunch more files at the very least.

Epimorphics seems to have stopped even minimal support if they haven't fixed this ?

if you dont mind may I ask if 1) you are planning to maintain a build and are willing to share it ? 2) do you know how to separate your own config from elda-assets distribution in any sensible way?

rob-metalinkage commented 5 years ago

just a follow to previous note .. Turns out the separation between your config and elda-assets for velocity templates is quite straightforward but buried a bit deeper in the docs - http://epimorphics.github.io/elda/current/velocity.html#config-use-velocity

jgrzebyta commented 5 years ago

@rob-metalinkage Sorry, I do not know what is current state. I am not in the subject for a wile. I solved this issue in my custom branch.

My implementation is applied as a docker image if you don't mind. I'll email you.