简体   繁体   English

lombok - 找不到符号 getId()

[英]lombok - cannot find symbol getId()

Hi I am doing simple application on Spring boot MongoDB example.嗨,我正在 Spring 启动 MongoDB 示例上做简单的应用程序。

I am getting this error while I run my sprint boot main class:我在运行 sprint boot main class 时收到此错误:

BookController.java
Error:(26, 54) java: cannot find symbol
  symbol:   method getId()
  location: variable book of type com.javatechie.spring.mongo.api.model.Book

I found some solution on stack overflow, I changed我找到了一些关于堆栈溢出的解决方案,我改变了

  1. Installed Lomboc plugin.安装 Lomboc 插件。

  2. Enabled Settings ->... Compiler -> Annotation Processors启用设置 ->... 编译器 -> 注释处理器

  3. Enabled Other Settings ->... Compiler -> Annotation Processors启用其他设置->...编译器->注释处理器

    Still I am facing same issue.我仍然面临同样的问题。 I am using IDEA 2019.3.4 Community Version in Windows 10.我在 Windows 10 中使用 IDEA 2019.3.4 社区版。

It was solved.解决了。 But the exact reason I don't know.但具体原因我不知道。 I changed to Spring boot 2.2.0 to 2.2.6.我改为 Spring 引导 2.2.0 到 2.2.6。 And deleted the target folder and did maven clean compile.并删除目标文件夹并进行 maven 干净编译。 And started the application as usual.并像往常一样启动应用程序。 Now it working fine.现在它工作正常。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM