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
[BUG] Cannot find symbol errors when migrating to Spring Boot 3 due to @ConstrutorBinding changes #3331
Comments
I actually faced this issue too, using lombok 1.8.26, Java 17 and Spring Boot 3.0.4. Lombok just wouldn't work and the compiler just complained "cannot find symbol". |
Same issue here openjdk 17.0.6 2023-01-17 LTS Lombok: |
This is a As an annotation processor lombok can not handle these cases but it is possible for a compiler plugin. I created a PoC yesterday to test if that works and it looks good so far. As this is also useful for other annotation processors I might publish it as standalone plugin too. |
Let me know if you need some beta testers. I'll try getting a few of my colleagues on board then. |
Also seeing this, would love to see it fixed. |
It is still WIP but if you want to try it you can download the current build here and add |
Is there any progress on this? Effectively it blocks us from migrating to SpringBoot 3.0.x, but maybe there is some workaround lombok team can offer? |
Did you try the wip compiler plugin? |
As far as I know lombok works fine with Spring Boot 3, I use it in multiple projects without any problems. The compiler plugin only change how the compiler handles annotation processing if an unrecoverable error occurs. |
were you able to find any fix? |
Try this: find all the not-annotation-related problems (e.g. compilation errors or jakarta/javax dependency names to be updated) and fix them first. It seems lombok just "fails fast" if any issue in your application exists and does not process any annotation until there is a clean compilation can be passed. This is the reason you see a lot of "cannot find symbol" errors. |
@dtsukinovsky First of all thanks for responding, I do agree with you and I know the problem could be somewhere else, and trying to figure it out from all possible perspectives. I'm able to finish all the compilation errors, the only two kinds of problems left, related to "cannot find symbol".
I have been trying log of things, and now my IDEA and mvn are showing different errors. MVN is still showing both errors above but IntelliJ IDEA only complaining about JPA-related stuff
However, unless MVN problem doesn't resolves, I can't move with deployment pipelines etc |
Describe the bug
Lombok breaks silently if annotation without ElementType.TYPE is used on a type.
This results in "cannot find symbol" on every usage of lombok-generated symbols.
It's very hard to find the cause when hit with this bug.
To Reproduce
Spring Boot 3 dropped
ElementType.TYPE
from@ContructorBinding
:spring-projects/spring-boot@44b88cc#diff-b777c5786f45759cb351f1d367175439ee177f65a14bc6677886c1cf93e6e582
It's easy to hit this bug when migrating Spring Boot 2.x codebase that has code like
To fix,
@ConstructorBinding
should be replaced with@RequiredArgsConstructor(onConstructor_={@ConstructorBinding})
or removed altogether.Expected behavior
Lombok should fail fast and log root cause of the problem.
Version info (please complete the following information):
The text was updated successfully, but these errors were encountered: