简体   繁体   中英

Error after deploying Sesame application into Tomcat

I created an application using sesame dependencies:

<dependency>
            <groupId>org.openrdf.sesame</groupId>
            <artifactId>sesame-runtime</artifactId>
            <version>2.7.5</version>
        </dependency>

        <dependency>
            <groupId>org.openrdf.sesame</groupId>
            <artifactId>sesame-repository-sail</artifactId>
            <version>2.7.5</version>
        </dependency>
        <dependency>
            <groupId>org.openrdf.sesame</groupId>
            <artifactId>sesame-sail-memory</artifactId>
            <version>2.7.5</version>
        </dependency>

It works when running it with the integrated Tomcat in Spring IDE. I deployed it into Tomcat 7 but I get the following error when accessing one of the methods I used in my code: (same thing works in Spring)

java.lang.AbstractMethodError: org.openrdf.repository.sail.SailRepositoryConnection.begin()V at org.openrdf.repository.event.base.NotifyingRepositoryConnectionWrapper.begin(NotifyingRepositoryConnectionWrapper.java:272) at org.openrdf.repository.manager.SystemRepository.initialize(SystemRepository.java:88) at org.openrdf.repository.manager.LocalRepositoryManager.createSystemRepository(LocalRepositoryManager.java:107) at org.openrdf.repository.manager.LocalRepositoryManager.createSystemRepository(LocalRepositoryManager.java:62) at org.openrdf.repository.manager.RepositoryManager.initialize(RepositoryManager.java:104) at com.mvc.API.StorageAPI.createNativeLocalRepository(StorageAPI.java:154)

At line 154 I have: manager.initialize();

which is from:

File dataDir = new File(REPOSITORY_NAME); RepositoryManager manager = new LocalRepositoryManager(dataDir);

RepositoryManager is an abstract class from Sesame which has an implemented method initialize(), LocalRepositoryManger inherits from it, but does not override the method initialize(). I also tried with Tomcat 6.0.37 and changed the sesame dependencies to 2.7.6 Do you have any idea why I get this error?

Thank you!

An AbstractMethodError can only occur at runtime if the compiled code used to run the program is not identical to the code used to actually compile the program.

A common cause for this is that you are using a different version of a jar library to compile against than you are using to actually run the program - perhaps because there are two versions of the same jar on your classpath, or some other inconsistency in your build/run setup.

Check that your build path and/or your runtime classpath do not contain wrong or duplicate jar files. If you've recently changed your maven dependencies, make sure that your compile-time build path is regenerated, for example by using 'mvn eclipse:clean eclipse:eclipse' from the command line, or by using M2E's refresh option (if you're using the Eclipse M2E plugin, that is).

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM