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
Mappers.getMapper(Class clazz) is throwing a ClassNotFoundException when a mapper is defined with a custom implementation name. #1812
Comments
Thanks @matleclaire for reporting this! When you use the component model
|
As @chris922 said, the It doesn't support mappers with custom name. And it can't read the As @chris922 also said if it can't find a class finishing with I am closing this since this is works as designed. Keep in mind that you can still instantiate the class by calling the |
My comment comes very lately, sorryfor that. Thanks for all your feedbacks and your explanations. That's pretty clear now. |
Is your problem solved? |
Please don't respond to closed issues. Ask questions on stackoverflow |
Hey guys !
I've discovered what it seems to be an issue with
Mappers.getMapper(Class<T> clazz)
when a Mapper is defined this wayAnd when we try to retrieve its implementation using
Mappers.getMapper(CarMapper.class)
.Here is the stacktrace
The issue seems to be located here
mapstruct/core/src/main/java/org/mapstruct/factory/Mappers.java
Line 75 in 0e33ad4
The code is trying to load a mapper according to the default class implementation name. The one defined by
implementationName
in annotation@Mapper
is not considered here.I've created a public repo to reproduce this behaviour.
see https://github.com/matleclaire/mapstruct-sample-error
I hope it might help.
Mapstruct version : 1.3.0-Final
The text was updated successfully, but these errors were encountered: