FasterXML/jackson-core

NoSuchMethodError: com.fasterxml.jackson.core.util.BufferRecycler.releaseToPool()

H-Lo opened this issue · 3 comments

H-Lo commented

Upgrade to 2.17.0 is producing exception.
Everything works fine with 2.16.2.

Spring Boot 3.2.4

Java
openjdk version "17.0.7" 2023-04-18
OpenJDK Runtime Environment Temurin-17.0.7+7 (build 17.0.7+7)
OpenJDK 64-Bit Server VM Temurin-17.0.7+7 (build 17.0.7+7, mixed mode, sharing)

Tomcat
Apache Tomcat/10.1.19

Hibernate ORM 6.5.0.CR1

Hibernate Search 7.1.0.Final

[ERROR] (DirectJDKLog.java:175) Servlet.service() for servlet [dispatcherServlet] in context with path [] threw exception [Filter execution threw an exception] with root cause
java.lang.NoSuchMethodError: 'void com.fasterxml.jackson.core.util.BufferRecycler.releaseToPool()'
	at com.fasterxml.jackson.databind.ObjectWriter.writeValueAsString(ObjectWriter.java:1147) ~[jackson-databind-2.17.0.jar:2.17.0]
	at com.thevegcat.app.converter.UserRolesConverter.convertToDatabaseColumn(UserRolesConverter.java:44) ~[classes/:?]
	at com.thevegcat.app.converter.UserRolesConverter.convertToDatabaseColumn(UserRolesConverter.java:1) ~[classes/:?]
	at org.hibernate.type.descriptor.converter.internal.JpaAttributeConverterImpl.toRelationalValue(JpaAttributeConverterImpl.java:100) ~[hibernate-core-6.5.0.CR1.jar:6.5.0.CR1]
	at org.hibernate.type.descriptor.converter.internal.AttributeConverterMutabilityPlanImpl.deepCopyNotNull(AttributeConverterMutabilityPlanImpl.java:62) ~[hibernate-core-6.5.0.CR1.jar:6.5.0.CR1]
	at org.hibernate.type.descriptor.java.MutableMutabilityPlan.deepCopy(MutableMutabilityPlan.java:45) ~[hibernate-core-6.5.0.CR1.jar:6.5.0.CR1]
	at org.hibernate.sql.results.graph.entity.AbstractEntityInitializer.copy(AbstractEntityInitializer.java:233) ~[hibernate-core-6.5.0.CR1.jar:6.5.0.CR1]
	at org.hibernate.sql.results.graph.entity.AbstractEntityInitializer.deepCopy(AbstractEntityInitializer.java:223) ~[hibernate-core-6.5.0.CR1.jar:6.5.0.CR1]
	at org.hibernate.sql.results.graph.entity.AbstractEntityInitializer.takeSnapshot(AbstractEntityInitializer.java:899) ~[hibernate-core-6.5.0.CR1.jar:6.5.0.CR1]
	at org.hibernate.sql.results.graph.entity.AbstractEntityInitializer.initializeEntityInstance(AbstractEntityInitializer.java:840) ~[hibernate-core-6.5.0.CR1.jar:6.5.0.CR1]
	at org.hibernate.sql.results.graph.entity.AbstractEntityInitializer.initializeEntity(AbstractEntityInitializer.java:771) ~[hibernate-core-6.5.0.CR1.jar:6.5.0.CR1]
	at org.hibernate.sql.results.graph.entity.AbstractEntityInitializer.initializeInstance(AbstractEntityInitializer.java:763) ~[hibernate-core-6.5.0.CR1.jar:6.5.0.CR1]
	at org.hibernate.sql.results.internal.InitializersList.initializeInstance(InitializersList.java:73) ~[hibernate-core-6.5.0.CR1.jar:6.5.0.CR1]
	at org.hibernate.sql.results.internal.StandardRowReader.coordinateInitializers(StandardRowReader.java:113) ~[hibernate-core-6.5.0.CR1.jar:6.5.0.CR1]
	at org.hibernate.sql.results.internal.StandardRowReader.readRow(StandardRowReader.java:87) ~[hibernate-core-6.5.0.CR1.jar:6.5.0.CR1]
	at org.hibernate.sql.results.spi.ListResultsConsumer.consume(ListResultsConsumer.java:205) ~[hibernate-core-6.5.0.CR1.jar:6.5.0.CR1]
	at org.hibernate.sql.results.spi.ListResultsConsumer.consume(ListResultsConsumer.java:33) ~[hibernate-core-6.5.0.CR1.jar:6.5.0.CR1]
	at org.hibernate.sql.exec.internal.JdbcSelectExecutorStandardImpl.doExecuteQuery(JdbcSelectExecutorStandardImpl.java:211) ~[hibernate-core-6.5.0.CR1.jar:6.5.0.CR1]
	at org.hibernate.sql.exec.internal.JdbcSelectExecutorStandardImpl.executeQuery(JdbcSelectExecutorStandardImpl.java:83) ~[hibernate-core-6.5.0.CR1.jar:6.5.0.CR1]
	at org.hibernate.sql.exec.spi.JdbcSelectExecutor.list(JdbcSelectExecutor.java:76) ~[hibernate-core-6.5.0.CR1.jar:6.5.0.CR1]
	at org.hibernate.sql.exec.spi.JdbcSelectExecutor.list(JdbcSelectExecutor.java:65) ~[hibernate-core-6.5.0.CR1.jar:6.5.0.CR1]
	at org.hibernate.query.sqm.internal.ConcreteSqmSelectQueryPlan.lambda$new$2(ConcreteSqmSelectQueryPlan.java:139) ~[hibernate-core-6.5.0.CR1.jar:6.5.0.CR1]
	at org.hibernate.query.sqm.internal.ConcreteSqmSelectQueryPlan.withCacheableSqmInterpretation(ConcreteSqmSelectQueryPlan.java:382) ~[hibernate-core-6.5.0.CR1.jar:6.5.0.CR1]
	at org.hibernate.query.sqm.internal.ConcreteSqmSelectQueryPlan.performList(ConcreteSqmSelectQueryPlan.java:302) ~[hibernate-core-6.5.0.CR1.jar:6.5.0.CR1]
	at org.hibernate.query.sqm.internal.QuerySqmImpl.doList(QuerySqmImpl.java:525) ~[hibernate-core-6.5.0.CR1.jar:6.5.0.CR1]
	at org.hibernate.query.spi.AbstractSelectionQuery.list(AbstractSelectionQuery.java:423) ~[hibernate-core-6.5.0.CR1.jar:6.5.0.CR1]
	at org.hibernate.query.spi.AbstractSelectionQuery.getSingleResult(AbstractSelectionQuery.java:555) ~[hibernate-core-6.5.0.CR1.jar:6.5.0.CR1]
	at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:103) ~[?:?]
	at java.base/java.lang.reflect.Method.invoke(Method.java:580) ~[?:?]
	at org.springframework.orm.jpa.SharedEntityManagerCreator$DeferredQueryInvocationHandler.invoke(SharedEntityManagerCreator.java:415) ~[spring-orm-6.1.5.jar:6.1.5]
	at jdk.proxy4/jdk.proxy4.$Proxy248.getSingleResult(Unknown Source) ~[?:?]
	at org.springframework.data.jpa.repository.query.JpaQueryExecution$SingleEntityExecution.doExecute(JpaQueryExecution.java:223) ~[spring-data-jpa-3.2.4.jar:3.2.4]```

You must use jackson-core 2.17.0 with jackson-databind 2.17.0. Check your classpath.

H-Lo commented

@pjfanning I have it, but also there is other one by Spring Boot. Should I exclude it? I mean I think I know the answer, but at least to confirm.

EDIT: uh oh, I don't have jackson core!
xxx

You know the answer. Please sort this out yourself. Read up on classloading please.