On 06/01/2020 15:28, Mohamed Morsey wrote:
Hi An,
now I did some investigation for the problem and now I get exception
"java.lang.NoSuchMethodError: 'javax.servlet.ServletContext
javax.servlet.http.HttpServletRequest.getServletContext()". This exception
indicates that there is a problem with dependency "*javax.servlet-api*".
This dependency is added to the pom already and it is the same version used
by Fuseki which is "3.1.0".
Do you have a clue on how this problem can be resolved?
What is the stacktrace for this?
javax.servlet.http.HttpServletRequest is an interface - there needs to
be an implementation at runtime. It should come from Eclipse Jetty for
FusekiServer.
NoSuchMethodError means that the runtime does not have the method but
the compile time did.
There are quite a few reasons this java Error is thrown.
It can be because there are multiple jars containing the same classes on
the runtime classpath as well as no suitable jar at runtime.
Andy
Thank you!
Regards,
Mohamed
On Mon, Jan 6, 2020 at 12:22 PM Andy Seaborne <[email protected]> wrote:
Hi there,
Which version are you running?
What does the server log say? It logs all requests - you may need
static { FusekiLogging.setLogging(); }
in your test class and make sure you haven't turned off logginbg by
level with log4j.properties somewhere.
Andy
On 06/01/2020 11:05, Mohamed Morsey wrote:
Hi all,
I have a problem with getting Fuseki server working with unit tests.
What I do is the following:
1- Create and start Fuseki server via the following piece of code:
*fusekiServer = FusekiServer.create().add("/sparql",
DatasetFactory.create(ModelFactory.createDefaultModel())).port(9090).build();fusekiServer.start();*
2- Load data as follows:
*try (RDFConnection conn =
RDFConnectionFactory.connect("http://localhost:9090/sparql
<http://localhost:9090/sparql>")) {*
*conn.load(dataModel);**}*
3- I can then send SPARQL queries to that endpoint.
This works fine in runtime. However, in unit tests mode I get
"org.apache.jena.atlas.web.HttpException" exception with message "500 -
Server Error" when loading the data.
Further, if I try to send a query I get
"org.apache.jena.sparql.engine.http.QueryExceptionHTTP" exception." with
message "HTTP 500 error making the query: Server Error".
Can you please help me out with this?
Thank you!
kind regards,
Mohamed Morsey