org.hibernate.TypeMismatchException: Provided id of the wrong type for class demo.domain.Order. Expected: class java.lang.Long, got class org.hibernate.bytecode.instrumentation.spi.LazyPropertyInitializer$1

Searched on Google with the first line of a JAVA stack trace?

We can recommend more relevant solutions and speed up debugging when you paste your entire stack trace with the exception message. Try a sample exception.

Recommended solutions based on your search

Samebug tips

Do you know how to solve this issue? Write a tip to help other users and build your expert profile.

Solutions on the web

via Hibernate JIRA by Arthur Noseda, 1 year ago
Provided id of the wrong type for class demo.domain.Order. Expected: class java.lang.Long, got class org.hibernate.bytecode.instrumentation.spi.LazyPropertyInitializer$1
via Hibernate JIRA by Arthur Noseda, 1 year ago
Provided id of the wrong type for class demo.domain.Order. Expected: class java.lang.Long, got class org.hibernate.bytecode.instrumentation.spi.LazyPropertyInitializer$1
via Stack Overflow by Bhanu Hugh Noah
, 9 months ago
Provided id of the wrong type for class com.abccompany.ExtendedMovieVO. Expected: class java.lang.Integer, got class java.lang.String
via Stack Overflow by Bhanu Hugh Noah
, 9 months ago
Provided id of the wrong type for class com.abcCompany.AddressVO. Expected: class java.lang.Integer, got class java.lang.String
via Stack Overflow by earnaz
, 2 years ago
Provided id of the wrong type for class es.model.entities.Poa. Expected: class es.model.entities.PoaPK, got class es.model.entities.AutPK
via Stack Overflow by Volodymyr Levytskyi
, 2 years ago
Provided id of the wrong type for class com.home.hostme.entity.Image. Expected: class java.lang.Long, got class java.lang.Integer
org.hibernate.TypeMismatchException: Provided id of the wrong type for class demo.domain.Order. Expected: class java.lang.Long, got class org.hibernate.bytecode.instrumentation.spi.LazyPropertyInitializer$1
at org.hibernate.event.internal.DefaultLoadEventListener.onLoad(DefaultLoadEventListener.java:134)
at org.hibernate.internal.SessionImpl.fireLoad(SessionImpl.java:1070)
at org.hibernate.internal.SessionImpl.internalLoad(SessionImpl.java:989)
at org.hibernate.type.EntityType.resolveIdentifier(EntityType.java:716)
at org.hibernate.type.ManyToOneType.assemble(ManyToOneType.java:282)
at org.hibernate.persister.entity.AbstractEntityPersister.initializeLazyPropertiesFromCache(AbstractEntityPersister.java:1333)
at org.hibernate.persister.entity.AbstractEntityPersister.initializeLazyProperty(AbstractEntityPersister.java:1244)
at org.hibernate.bytecode.instrumentation.spi.AbstractFieldInterceptor.intercept(AbstractFieldInterceptor.java:112)
at demo.domain.OrderLine.$javassist_read_order(OrderLine.java)
at demo.domain.OrderLine.getOrder(OrderLine.java:54)
at demo.AppTest$2.doWithinTransaction(AppTest.java:47)
at demo.utils.HibernateTemplate.execute(HibernateTemplate.java:21)
at demo.AppTest.shouldFailToResolveEntityName(AppTest.java:41)

Users with the same issue

Samebug visitor profile picture
Unknown user
Once, 1 year ago
Samebug visitor profile picture
Unknown user
Once, 1 year ago
Samebug visitor profile picture
Unknown user
Once, 1 year ago

Write tip

Know the solutions? Share your knowledge to help other developers to debug faster.