Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
jgrzebyta opened this issue Mar 20, 2018 · 6 comments

Comments

@jgrzebyta
Copy link

jgrzebyta commented Mar 20, 2018

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
Copy link
Author

jgrzebyta commented Mar 21, 2018

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 jgrzebyta changed the title Exception: Problem running query for SparqlSource ... Problems with HTTP response (was it an HTTP server?) Exception: Problems with HTTP response (was it an HTTP server?) Mar 21, 2018
@jgrzebyta
Copy link
Author

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 jgrzebyta changed the title Exception: Problems with HTTP response (was it an HTTP server?) Dependency conflict in elda-lda : different versions of jena-tdb Mar 21, 2018
@jgrzebyta jgrzebyta changed the title Dependency conflict in elda-lda : different versions of jena-tdb Dependency conflict in elda-lda causes "Problem running query for SparqlSource" Mar 21, 2018
@jgrzebyta
Copy link
Author

Problem solved in my branch custom until commit 17adf3c

@rob-metalinkage
Copy link

rob-metalinkage commented Feb 18, 2019

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
Copy link

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
Copy link
Author

@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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants