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

Hibernate 5 Module Not Ignoring hibernateLazyInitializer #143

Open
EarthCitizen opened this issue Sep 13, 2021 · 1 comment
Open

Hibernate 5 Module Not Ignoring hibernateLazyInitializer #143

EarthCitizen opened this issue Sep 13, 2021 · 1 comment
Labels
need-test-case Needs a test case (unit test or such) to proceed pr-needed Feature request for which PR likely needed (no active development but idea is workable)

Comments

@EarthCitizen
Copy link

The Hibernate 5 Module should ignore hibernateLazyInitializer by default. Jackson is attempting to serialize this, and that results in an error:

com.fasterxml.jackson.databind.exc.InvalidDefinitionException: No serializer found for class org.hibernate.proxy.pojo.bytebuddy.ByteBuddyInterceptor and no properties discovered to create BeanSerializer (to avoid exception, disable SerializationFeature.FAIL_ON_EMPTY_BEANS) (through reference chain: org.springframework.hateoas.EntityModel["content"]->some.package.Pojo$HibernateProxy$rGmV5ok5["hibernateLazyInitializer"])
        at com.fasterxml.jackson.databind.exc.InvalidDefinitionException.from(InvalidDefinitionException.java:77) ~[jackson-databind-2.12.4.jar:2.12.4]
        at com.fasterxml.jackson.databind.SerializerProvider.reportBadDefinition(SerializerProvider.java:1276) ~[jackson-databind-2.12.4.jar:2.12.4]
        at com.fasterxml.jackson.databind.DatabindContext.reportBadDefinition(DatabindContext.java:400) ~[jackson-databind-2.12.4.jar:2.12.4]
        at com.fasterxml.jackson.databind.ser.impl.UnknownSerializer.failForEmpty(UnknownSerializer.java:71) ~[jackson-databind-2.12.4.jar:2.12.4]
        at com.fasterxml.jackson.databind.ser.impl.UnknownSerializer.serialize(UnknownSerializer.java:33) ~[jackson-databind-2.12.4.jar:2.12.4]
@cowtowncoder cowtowncoder added the pr-needed Feature request for which PR likely needed (no active development but idea is workable) label Jan 7, 2023
@cowtowncoder
Copy link
Member

Sounds like it might be relatively simple thing to do.

But one thing that would be super helpful for anyone trying to solve this would be a unit test to reproduce the issue. That'd also work as verification for solution.

@cowtowncoder cowtowncoder added the need-test-case Needs a test case (unit test or such) to proceed label Jan 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
need-test-case Needs a test case (unit test or such) to proceed pr-needed Feature request for which PR likely needed (no active development but idea is workable)
Projects
None yet
Development

No branches or pull requests

2 participants