kbss-cvut / jopa

Java OWL Persistence API
https://github.com/kbss-cvut/jopa/wiki
GNU Lesser General Public License v3.0
34 stars 15 forks source link

Ontodriver-sesame module has conflicting dependencies #107

Closed blcham closed 2 years ago

blcham commented 2 years ago

I am getting following error,

java.lang.NoSuchMethodError: 'void org.eclipse.rdf4j.query.algebra.evaluation.EvaluationStrategyFactory.setTrackResultSize(boolean)'

while using dependency:

        <dependency>
            <groupId>cz.cvut.kbss.jopa</groupId>
            <artifactId>ontodriver-sesame</artifactId>
            <version>0.17.2</version>
        </dependency>

The problem seems to be visible in output of mvn dependency:tree: image

My workaround that works:

        <dependency>
            <groupId>cz.cvut.kbss.jopa</groupId>
            <artifactId>ontodriver-sesame</artifactId>
            <exclusions>
                <exclusion>
                    <groupId>org.eclipse.rdf4j</groupId>
                    <artifactId>rdf4j-repository-sail</artifactId>
                </exclusion>
            </exclusions>
        </dependency>
        <dependency>
            <groupId>org.eclipse.rdf4j</groupId>
            <artifactId>rdf4j-repository-sail</artifactId>
            <version>3.7.3</version>
        </dependency>
ledsoft commented 2 years ago
  1. This ticket concerns apparently version 0.17.2, which is outdated, so it cannot be fixed retrospectively.
  2. All RDF4J dependencies are updated at the same time via a Maven property (see pom.xml). Is it possible that your application depends on multiple RDF4J versions and this causes the conflict? I haven't seen this error in any of the systems that use JOPA, which is quite strange and makes me think it is not a JOPA issue. What is your overall dependency tree?
ledsoft commented 2 years ago

For example, you have RDF4J artifacts version 2.5.3 (including the conflicting one you mention above) in dependencyManagement in s-pipes-parent.

blcham commented 2 years ago

You are right. I did not realize that i could change indirect dependency through dependencyManagement section. After changing it there, everything works fine. Thanks @ledsoft.