1

I want to use Jena TDB in a project. This is what I added in my POM:

<dependency>
    <groupId>org.apache.jena</groupId>
    <artifactId>apache-jena-libs</artifactId>
    <version>3.7.0</version>
    <type>pom</type>
</dependency>

These are my jena-related imports:

import org.apache.jena.query.*;
import org.apache.jena.tdb.TDBFactory;

Interestingly, the code compiles and everything seems to be fine. I can even create a data set and read from it.

Dataset dataset = TDBFactory.createDataset(repoLocation);

As I am writing a multi-thread application, I am calling the begin method as recommended in the documentation:

dataset.begin(ReadWrite.READ);

Which leads to:

Exception in thread "main" java.lang.AbstractMethodError: Class "org.apache.jena.tdb.transaction.DatasetGraphTransaction" does not implement the requested method

I appreciate your help!

Janothan
  • 446
  • 4
  • 16

1 Answers1

1

AbstractMethodError generally means there are mismatched JARs on your class path somehow. See Abstract Method Error for some discussion and related links on this topic.

You need to check your dependencies and your environment to ensure you don't have different versions at compile time versus run-time

mvn dependency:tree run on your project will print out the dependency tree which should show if you somehow have multiple versions of the Jena libraries in your Maven project setup.

Depending upon how you are packaging and invoking your code you will probably also want to check how your class path is constructed for runtime, and how are your application is packaged (particularly if you use Maven Shade plugin or otherwise create an uber-jar). Without any details on this it is hard to provide specific advice.

RobV
  • 28,022
  • 11
  • 77
  • 119