org.modelmapper.MappingException

ModelMapper mapping errors: 1) Error mapping A to B 1 error

Samebug tips0

We couldn't find tips for this exception.

Don't give up yet. Paste your full stack trace to get a solution.

Solutions on the web1224

Stack trace

  • org.modelmapper.MappingException: ModelMapper mapping errors: 1) Error mapping A to B 1 error at org.modelmapper.internal.Errors.throwMappingExceptionIfErrorsExist(Errors.java:374) at org.modelmapper.internal.MappingEngineImpl.map(MappingEngineImpl.java:69) at org.modelmapper.ModelMapper.mapInternal(ModelMapper.java:497) at org.modelmapper.ModelMapper.map(ModelMapper.java:340) at MapTest.main(MapTest.java:31) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at com.intellij.rt.execution.application.AppMain.main(AppMain.java:147) Caused by: org.modelmapper.MappingException: ModelMapper mapping errors: 1) Failed to get value from A.getTo() 1 error at org.modelmapper.internal.Errors.toMappingException(Errors.java:258) at org.modelmapper.internal.PropertyInfoImpl$MethodAccessor.getValue(PropertyInfoImpl.java:100) at org.modelmapper.internal.MappingEngineImpl.resolveSourceValue(MappingEngineImpl.java:189) at org.modelmapper.internal.MappingEngineImpl.propertyMap(MappingEngineImpl.java:156) at org.modelmapper.internal.MappingEngineImpl.typeMap(MappingEngineImpl.java:131) at org.modelmapper.internal.MappingEngineImpl.map(MappingEngineImpl.java:92) at org.modelmapper.internal.MappingEngineImpl.map(MappingEngineImpl.java:60) ... 8 more Caused by: java.lang.IllegalArgumentException: object is not an instance of declaring class at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at org.modelmapper.internal.PropertyInfoImpl$MethodAccessor.getValue(PropertyInfoImpl.java:95) ... 13 more

Write tip

You have a different solution? A short tip here would help you and many other users who saw this issue last week.

Users with the same issue

PilleoPilleo
Once,
kjhdofjosvskjhdofjosvs
2 times, last one
Unknown visitor
Unknown visitorOnce,
Unknown visitor
Unknown visitorOnce,
tyson925tyson925
2 times, last one
96 more bugmates