1

I tried to convert a @Entity into a DTO using ModelMapper, so i got this error:

org.modelmapper.MappingException: ModelMapper mapping errors:

1) Converter org.modelmapper.internal.converter.CollectionConverter@f3e6876 failed to convert java.util.List to java.util.List.

1 error

Someone can help me?

2
  • .....so the error you're getting is that you cannot convert from a Data Type to the same Data Type? Commented Oct 5, 2019 at 14:35
  • We will need to see more than the error messages you've provided to be able to tell you what is happening. Where is your source code? Commented Oct 5, 2019 at 14:36

1 Answer 1

5

the real problem was:

Caused by: org.hibernate.LazyInitializationException: failed to lazily initialize a collection of role: com.example.backapi.aviso.domain.Aviso.links, could not initialize proxy - no Session

Resolved with: @ElementCollection(fetch = FetchType.LAZY)

Sign up to request clarification or add additional context in comments.

1 Comment

Got this exception too. And indeed that was the root cause.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.