eclipse-rdf4j / rdf4j

Eclipse RDF4J: scalable RDF for Java
https://rdf4j.org/
BSD 3-Clause "New" or "Revised" License
365 stars 163 forks source link

Upgrade to Spring Boot 3.x.x #5063

Open florianchappaz opened 4 months ago

florianchappaz commented 4 months ago

Current Behavior

Running a project relying on Spring Boot v3.0.4, I'm getting this error when the RDF4JConfig attempts to build the RDF4JTemplate:

Caused by: org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type 'org.eclipse.rdf4j.repository.Repository' available: expected at least 1 bean which qualifies as autowire candidate. Dependency annotations: {@org.springframework.beans.factory.annotation.Autowired(required=true)}

rdf4j spring components are built relying on Spring Boot v2.7.16, making them uncompatible with a Spring Boot v3 project.

Expected Behavior

I expected the @Import(RDF4JConfig::class) to automatically build the Repository from my application.properties.

Steps To Reproduce

  1. Setup a Maven project based on

    <parent>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-starter-parent</artifactId>
    <version>3.0.4</version>
    <type>pom</type>
    </parent>
  2. Follow the basic setup presented in rdf4j-spring, especially the setup of the application properties.

Version

5.0.0

Are you interested in contributing a solution yourself?

Perhaps?

Anything else?

It seems like the issue has already been mentioned in this discussion.

hmottestad commented 4 months ago

RDF4J is compatible with spring-boot 2.7.16.

fkleedorfer commented 4 months ago

@florianchappaz this may or may not be a compatibility issue. It may just be a configuration issue.

Have you tried using an inmemory repository? The property to activate that is

rdf4j.spring.repository.inmemory.enabled=true

(and if you want: rdf4j.spring.repository.inmemory.use-shacl-sail=true )

fkleedorfer commented 4 months ago

FYI, I aim to upgrade rdf4j-spring to support to the latest spring boot version in the not so distant future. I haven't looked into compatibility issues with spring boot 3 so far, but I would not expect it to work out of the box.

florianchappaz commented 4 months ago

Issue Investigation

I've investigated the issue further and here are my findings:

  1. Using in-memory repository: Same error persists.

  2. VPN disabled:

    • My GraphDB instance is only accessible through VPN.
    • Disabling VPN resulted in the same error.
    • No connection resolution issues observed, suggesting the connection bean is never created and the config is ignored.
  3. No configuration:

    • Tried without any config, same error occurred.
    • Config appears to be ignored. Double-checked to ensure my config was correct.
  4. Downgrading project:

    • Downgraded to Spring Boot 2.7.16.
    • Result: No error.

Conclusion

The issue seems to be related to incompatibility with the newest Spring version.

If you need any additional information or assistance, please let me know.

fkleedorfer commented 4 months ago

Thanks for your help diagnosing this! I will check back.