Aarya
Aarya

Reputation: 13

Spring-boot application failed to start after adding Hibernate Search latest dependency, **CR1**

Error Log from console - Here **Dependency Versions:**

springBootVersion=2.7.3

hibernateVersion=5.6.10.Final

hibernate_search=**6.2.0.CR1**

annotationProcessor "org.hibernate:hibernate-jpamodelgen:${hibernateVersion}"

implementation "org.hibernate.search:hibernate-search-mapper-orm:${hibernate_search}"

implementation "org.hibernate.search:hibernate-search-backend-elasticsearch:${hibernate_search}"

implementation "org.hibernate.search:hibernate-search-mapper-orm-batch-jsr352-core:${hibernate_search}"

implementation "org.hibernate.search:hibernate-search-mapper-orm-batch-jsr352-jberet:${hibernate_search}"

The Error on starting the application, both from IntelliJ and Terminal:

Please note that we observed this on hibernate_search **6.2.0.Beta1** as well , but intermittently.

We tried adding a runtime dependency for snakeyaml to our gradle, but no effect.

Please check the attached imae

Upvotes: 1

Views: 140

Answers (2)

Another Good Guy
Another Good Guy

Reputation: 90

Looks like there is an open issue with Spring: https://github.com/spring-projects/spring-boot/issues/34405; for SnakeYAML 2.0

And adding or forcing this line in gradle dependencies fixes it, Sharing for anyone that may hit the same issue:

implementation('org.yaml:snakeyaml'){
    version{
        strictly "[1.30]"
    }
}

Upvotes: 0

yrodiere
yrodiere

Reputation: 9977

This does not seem related to Hibernate Search at all, since the stacktrace mentions Spring trying to use SnakeYaml and failing, and Hibernate Search doesn't use SnakeYaml (or any YAML parser for that matter), so it couldn't possibly be the culprit.

I've seen similar errors in projects trying to upgrade from SnakeYaml 1.x to 2.0, though, because SnakeYaml seems to have aggressively removed some constructors in 2.0. Maybe you upgraded other dependencies at the same time as Hibernate Search, which led to upgrading SnakeYaml, and that's where your error comes from?

Upvotes: 0

Related Questions