On 07/01/2020 10:09, Mohamed Morsey wrote:
Hi,

Yes sure.
The conflicting dependencies were in my own project not in Fuseki.

Following dependencies were conflicting:

    1.



*<dependency>       <groupId>org.mortbay.jetty</groupId>
    <artifactId>servlet-api</artifactId>       <version>2.5-20081211</version>


Thanks for the background.

Fuseki is compiled against 9.4.12.v20180830.

https://github.com/apache/jena/blob/master/jena-fuseki2/pom.xml

     </dependency>*
    2.




*<dependency>         <groupId>javax.servlet</groupId>
    <artifactId>javax.servlet-api</artifactId>         <version>3.1.0</version>
    </dependency> *

Both of the then provide interface *javax.servlet.http.HttpServletRequest*
but with different versions, and the older version does not have method
*getServletContext*. Thus, I had to move the second dependency to appear
first in the pom file. Later, I totally removed the other dependency, and
the application worked fine.

The thing that makes me puzzled is that the correct dependency was picked
up correctly at runtime but not in test.

Regards,
Mohamed


On Tue, Jan 7, 2020 at 10:57 AM Andy Seaborne <[email protected]> wrote:



On 07/01/2020 08:35, Mohamed Morsey wrote:
Hi Andy,

thank you for help.

I got it working now. It was a dependency problem. The order of
dependencies in POM file caused that problem.

Could you say some more about the details in case something similar
happens to someone else?

What things were in the wrong order? For fuseki-server there is only one
provider of each dependency/interface. Was it something else included
for another part of your project?

      Andy


Regards,
Mohamed

On Mon, Jan 6, 2020 at 6:08 PM Andy Seaborne <[email protected]> wrote:

I ran Fuseki and put a break point on the filter call - I get the same
stacktrace.

So something in the test setup is interfering - "mvn dependency:tree"
may show something if it's a maven project.

Is this openjdk for the Java JVM?

As it works one way but not in "test" it does rather look like some
other code is providing the implementation of "HttpServletRequest"
somehow but from the information on the thread, I can't see how.

       Andy




Reply via email to