You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have a domain maven module that holds all my business logic (entities are defined by records) and another maven module for all stuff about infrastructure where I use mapstruct to map record to DTO classes.
Problem:
When I clean compile mapstruct processor throw an NPE (cf. the full stacktrace). After some investigations I found the problem location. It's due to RECORD_COMPONENT_ACCESSOR_METHOD.invoke statement above that returns a null value. This method is supposed to return the related accessor of the given record field.
After some tests, mappers compilation succeed (no problem to retrieve accessor for record field) when records belong to the same maven module but, when they belong to another installed maven module in my local repo it's failed as I described.
Environment:
OS: macOs v11.2.3
Java: openjdk version "16.0.1" 2021-04-20
OpenJDK Runtime Environment AdoptOpenJDK-16.0.1+9 (build 16.0.1+9)
OpenJDK 64-Bit Server VM AdoptOpenJDK-16.0.1+9 (build 16.0.1+9, mixed mode, sharing)
Please have a look at #2375 and #2374. This was caused due to a bug in Java 15 and 16. This bug has been fixed in Java 17. Please use Java 17 if you want to use records cross modules.
I have a domain maven module that holds all my business logic (entities are defined by records) and another maven module for all stuff about infrastructure where I use mapstruct to map record to DTO classes.
When I clean compile mapstruct processor throw an NPE (cf. the full stacktrace). After some investigations I found the problem location. It's due to
RECORD_COMPONENT_ACCESSOR_METHOD.invoke
statement above that returns a null value. This method is supposed to return the related accessor of the given record field.After some tests, mappers compilation succeed (no problem to retrieve accessor for record field) when records belong to the same maven module but, when they belong to another installed maven module in my local repo it's failed as I described.
OS: macOs v11.2.3
Java: openjdk version "16.0.1" 2021-04-20
OpenJDK Runtime Environment AdoptOpenJDK-16.0.1+9 (build 16.0.1+9)
OpenJDK 64-Bit Server VM AdoptOpenJDK-16.0.1+9 (build 16.0.1+9, mixed mode, sharing)
Mapstruct: tested for v1.5.0.Beta1 & v1.4.2.Final
The text was updated successfully, but these errors were encountered: