Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error when access repository: ForwardChainingRDFSInferencerFactory not found #4854

Closed
reckart opened this issue Dec 12, 2023 · 4 comments
Closed
Assignees
Labels
🐞 bug issue is a bug M3
Milestone

Comments

@reckart
Copy link
Contributor

reckart commented Dec 12, 2023

Current Behavior

When trying to create a new repository, I get an error that is ForwardChainingRDFSInferencerFactory not found:

2023-12-12 12:57:43 ERROR SailRegistry - Failed to instantiate service
java.util.ServiceConfigurationError: org.eclipse.rdf4j.sail.config.SailFactory: Provider org.eclipse.rdf4j.sail.inferencer.fc.config.ForwardChainingRDFSInferencerFactory not found
	at java.base/java.util.ServiceLoader.fail(ServiceLoader.java:593) ~[?:?]
	at java.base/java.util.ServiceLoader$LazyClassPathLookupIterator.nextProviderClass(ServiceLoader.java:1219) ~[?:?]
	at java.base/java.util.ServiceLoader$LazyClassPathLookupIterator.hasNextService(ServiceLoader.java:1228) ~[?:?]
	at java.base/java.util.ServiceLoader$LazyClassPathLookupIterator.hasNext(ServiceLoader.java:1273) ~[?:?]
	at java.base/java.util.ServiceLoader$2.hasNext(ServiceLoader.java:1309) ~[?:?]
	at java.base/java.util.ServiceLoader$3.hasNext(ServiceLoader.java:1393) ~[?:?]
	at org.eclipse.rdf4j.common.lang.service.ServiceRegistry.<init>(ServiceRegistry.java:44) ~[rdf4j-common-io-5.0.0-M2.jar:5.0.0-M2]
	at org.eclipse.rdf4j.sail.config.SailRegistry.<init>(SailRegistry.java:40) ~[rdf4j-sail-api-5.0.0-M2.jar:5.0.0-M2]
	at org.eclipse.rdf4j.sail.config.SailRegistry$SailRegistryHolder.<clinit>(SailRegistry.java:27) ~[rdf4j-sail-api-5.0.0-M2.jar:5.0.0-M2]
	at org.eclipse.rdf4j.sail.config.SailRegistry.getInstance(SailRegistry.java:36) ~[rdf4j-sail-api-5.0.0-M2.jar:5.0.0-M2]
	at org.eclipse.rdf4j.repository.sail.config.SailRepositoryConfig.lambda$parse$1(SailRepositoryConfig.java:103) ~[rdf4j-repository-sail-5.0.0-M2.jar:5.0.0-M2]
	at java.base/java.util.Optional.ifPresent(Optional.java:178) ~[?:?]
	at org.eclipse.rdf4j.repository.sail.config.SailRepositoryConfig.parse(SailRepositoryConfig.java:102) ~[rdf4j-repository-sail-5.0.0-M2.jar:5.0.0-M2]
	at org.eclipse.rdf4j.repository.config.AbstractRepositoryImplConfig.create(AbstractRepositoryImplConfig.java:118) ~[rdf4j-repository-api-5.0.0-M2.jar:5.0.0-M2]
	at org.eclipse.rdf4j.repository.config.RepositoryConfig.lambda$parse$2(RepositoryConfig.java:185) ~[rdf4j-repository-api-5.0.0-M2.jar:5.0.0-M2]
	at java.base/java.util.Optional.ifPresent(Optional.java:178) ~[?:?]
	at org.eclipse.rdf4j.repository.config.RepositoryConfig.parse(RepositoryConfig.java:185) ~[rdf4j-repository-api-5.0.0-M2.jar:5.0.0-M2]
	at org.eclipse.rdf4j.repository.config.RepositoryConfig.create(RepositoryConfig.java:201) ~[rdf4j-repository-api-5.0.0-M2.jar:5.0.0-M2]
	at org.eclipse.rdf4j.repository.config.RepositoryConfigUtil.getRepositoryConfig(RepositoryConfigUtil.java:46) ~[rdf4j-repository-api-5.0.0-M2.jar:5.0.0-M2]
	at org.eclipse.rdf4j.repository.manager.LocalRepositoryManager.getRepositoryConfig(LocalRepositoryManager.java:278) ~[rdf4j-repository-manager-5.0.0-M2.jar:5.0.0-M2]
	at org.eclipse.rdf4j.repository.manager.LocalRepositoryManager.createRepository(LocalRepositoryManager.java:207) ~[rdf4j-repository-manager-5.0.0-M2.jar:5.0.0-M2]
	at org.eclipse.rdf4j.repository.manager.RepositoryManager.getRepository(RepositoryManager.java:326) ~[rdf4j-repository-manager-5.0.0-M2.jar:5.0.0-M2]

However, it is referenced in a service loader configuration file located in a dependency that I use rdf4j-sail-inferencer-5.0.0-M2.jar.

It seems this class may have been removed in 5.0.0-M2 because I don't find it in rdf4j-sail-inferencer-5.0.0-M2.jar?

It seems to have been in that module in the past according to code search: https://github.com/search?q=repo%3Aeclipse-rdf4j%2Frdf4j+ForwardChainingRDFSInferencerFactory&type=code

Expected Behavior

Service loaders should not reference non-existing factory classes or classes in other JARs.

Steps To Reproduce

No response

Version

5.0.0-M2

Are you interested in contributing a solution yourself?

None

Anything else?

No response

@reckart reckart added the 🐞 bug issue is a bug label Dec 12, 2023
@hmottestad
Copy link
Contributor

Yes, that's been removed. It's been deprecated for a long time already in favour of the SchemaCachingRDFSInferencer.

Could you try swapping to the SchemaCachingRDFSInferencer and let us know if that works for you?

@reckart
Copy link
Contributor Author

reckart commented Dec 12, 2023

I don't need the class at all.

But because it is referenced in core/sail/inferencer/src/main/resources/META-INF/services/org.eclipse.rdf4j.sail.config.SailFactory the library logs an error when it internally invokes the service loader mechanism. The line must be removed from the service loader config file.

@hmottestad
Copy link
Contributor

Ahh. I see. I guess I didn't do as good of a job of removing the class as I had thought. I'll take another look.

Is it only logging an error, or is it not able to create the repo?

@hmottestad hmottestad added this to the 5.0.0 milestone Dec 12, 2023
@hmottestad hmottestad added the M3 label Dec 12, 2023
@reckart
Copy link
Contributor Author

reckart commented Dec 12, 2023

It happens during a test and my test ends up green, so I guess it's only logging the error but not failing hard.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐞 bug issue is a bug M3
Projects
None yet
Development

No branches or pull requests

2 participants