Skip to content
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

incompatible types: com.exadel.frs.core.trainservice.dto.FindFacesResultDto cannot be converted to com.exadel.frs.core.trainservice.dto.FacePredictionResultDto #828

Closed
leccyril opened this issue Jul 12, 2022 · 9 comments

Comments

@leccyril
Copy link

leccyril commented Jul 12, 2022

Describe the bug
incompatible types: com.exadel.frs.core.trainservice.dto.FindFacesResultDto cannot be converted to com.exadel.frs.core.trainservice.dto.FacePredictionResultDto

error occurs when we want to build the java project on this class : FacesMapperImpl

[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.8.1:compile (default-compile) on project frs-core-app: Compilation failure
[ERROR] /workspace/compreface/api/target/generated-sources/annotations/com/exadel/frs/core/trainservice/mapper/FacesMapperImpl.java:[250,45] incompatible types: com.exadel.frs.core.trainservice.dto.FindFacesResultDto cannot be converted to com.exadel.frs.core.trainservice.dto.FacePredictionResultDto

it seems the map structur automatic mapper is not working

To Reproduce
Steps to reproduce the behavior:

clone master branch and try to build java project

java 11 or java 18

Expected behavior
Build works

@VolodymyrBushko
Copy link
Collaborator

Are you sure that versions of your dependencies are the same as on the master branch?

There could be non-compatibilities between dependencies.

For example, late versions of Lombok might be non-compatible with old versions of Mapstruct.

@leccyril
Copy link
Author

i took master branch , then build with java 11 , api not building

/home/cyril.xxxx/.jdks/liberica-11.0.15.1/bin/java -Dmaven.multiModuleProjectDirectory=/home/cyril.xxxx/dev/projects/facial recognition/source/CompreFace/java/api -Dmaven.home=/home/cyril.xxxx/dev/environment/idea-IU-213.7172.25/plugins/maven/lib/maven3 -Dclassworlds.conf=/home/cyril.xxxx/dev/environment/idea-IU-213.7172.25/plugins/maven/lib/maven3/bin/m2.conf -Dmaven.ext.class.path=/home/cyril.xxx/dev/environment/idea-IU-213.7172.25/plugins/maven/lib/maven-event-listener.jar -javaagent:/home/cyril.xxxx/dev/environment/idea-IU-213.7172.25/lib/idea_rt.jar=38841:/home/cyril.xxx/dev/environment/idea-IU-213.7172.25/bin -Dfile.encoding=UTF-8 -classpath /home/cyril.xxxx/dev/environment/idea-IU-213.7172.25/plugins/maven/lib/maven3/boot/plexus-classworlds-2.6.0.jar:/home/cyril.xxxx/dev/environment/idea-IU-213.7172.25/plugins/maven/lib/maven3/boot/plexus-classworlds.license org.codehaus.classworlds.Launcher -Didea.version=2021.3.3 install [INFO] Scanning for projects... [WARNING] [WARNING] Some problems were encountered while building the effective model for com.exadel:frs-core-app:jar:0.0.1-SNAPSHOT [WARNING] The expression ${parent.version} is deprecated. Please use ${project.parent.version} instead. [WARNING] [WARNING] It is highly recommended to fix these problems because they threaten the stability of your build. [WARNING] [WARNING] For this reason, future Maven versions might no longer support building such malformed projects. [WARNING] [INFO] [INFO] ----------------------< com.exadel:frs-core-app >----------------------- [INFO] Building frs-core-app 0.0.1-SNAPSHOT [INFO] --------------------------------[ jar ]--------------------------------- [INFO] [INFO] --- maven-resources-plugin:3.2.0:resources (default-resources) @ frs-core-app --- [INFO] Using 'UTF-8' encoding to copy filtered resources. [INFO] Using 'UTF-8' encoding to copy filtered properties files. [INFO] Copying 1 resource [INFO] Copying 4 resources [INFO] [INFO] --- maven-compiler-plugin:3.8.1:compile (default-compile) @ frs-core-app --- [INFO] Changes detected - recompiling the module! [INFO] Compiling 71 source files to /home/cyril.xxxx/dev/projects/facial recognition/source/CompreFace/java/api/target/classes [INFO] /home/cyril.xxxx/dev/projects/facial recognition/source/CompreFace/java/api/src/main/java/com/exadel/frs/core/trainservice/system/swagger/SwaggerInfoProperties.java: Some input files use or override a deprecated API. [INFO] /home/cyril.xxxx/dev/projects/facial recognition/source/CompreFace/java/api/src/main/java/com/exadel/frs/core/trainservice/system/swagger/SwaggerInfoProperties.java: Recompile with -Xlint:deprecation for details. [INFO] ------------------------------------------------------------- [ERROR] COMPILATION ERROR : [INFO] ------------------------------------------------------------- [ERROR] /home/cyril.xxx/dev/projects/facial recognition/source/CompreFace/java/api/target/generated-sources/annotations/com/exadel/frs/core/trainservice/mapper/FacesMapperImpl.java:[245,45] incompatible types: com.exadel.frs.core.trainservice.dto.FindFacesResultDto cannot be converted to com.exadel.frs.core.trainservice.dto.FacePredictionResultDto [INFO] 1 error [INFO] ------------------------------------------------------------- [INFO] ------------------------------------------------------------------------ [INFO] BUILD FAILURE [INFO] ------------------------------------------------------------------------ [INFO] Total time: 12.359 s [INFO] Finished at: 2022-07-13T13:10:06+04:00

@leccyril
Copy link
Author

for information for admin project i updated all depenencies with last version and project is working "just to test"

@VolodymyrBushko
Copy link
Collaborator

Have you built the project from the ./CompreFace/java folder through the following command: mvn clean install?

@leccyril
Copy link
Author

i launched from intellij java folder or api folder it is the same error, i have java18 installed and only on intellij i can switch easily java version.

I f i launch on terminal command directly it is java 18 used

@VolodymyrBushko
Copy link
Collaborator

You can try to reimport all dependencies and try to build the project again.

@VolodymyrBushko
Copy link
Collaborator

I can reproduce the problem. It occurs for me when I change the Lombok version from 1.18.12 to 1.18.22 in root pom.xml (I'm using java 11).

@pospielov
Copy link
Collaborator

I tried to build the project with the same Java and it works too.
Here is the log: log.txt
It looks like you are trying to build the project from java/api folder.
You need to build it from java folder

@leccyril
Copy link
Author

it seems to be this, first java11 was not yet installed when i done test

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants