0

I am actually working on a sprig boot application. I clone the repository of my project in both ubuntu and macos. The code is working fine in ubuntu but it is not working in macos, I get a compilation Error in mac os which is,

org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'clientTypeController' defined in file [/Users/selvan/Projects/cms/cms-spring/target/classes/ken/advocates/cms/controller/ClientTypeController.class]: Instantiation of bean failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [ken.advocates.cms.controller.ClientTypeController]: Constructor threw exception; nested exception is java.lang.Error: Unresolved compilation problems:

The blank final field clientTypeService may not have been initialized

The method builder() is undefined for the type Response

The method builder() is undefined for the type Response

log cannot be resolved

The method builder() is undefined for the type Response

The method builder() is undefined for the type Response

The method builder() is undefined for the type Response

Please let me know what the problem will be?

I expected the spring boot application to work on both ubuntu and macos. But I get a complier error while building the project in macos. The same code is working fine in Ubuntu

  • Can you show the code in question? Are these 'builder' methods Lombok? And are you using the version of Java on both systems? – GreyBeardedGeek Feb 05 '23 at 10:30
  • Ubuntu Javva Version - selvan@Home-Desktop:~$ java --version openjdk 17.0.5 2022-10-18 OpenJDK Runtime Environment (build 17.0.5+8-Ubuntu-2ubuntu122.04) OpenJDK 64-Bit Server VM (build 17.0.5+8-Ubuntu-2ubuntu122.04, mixed mode, sharing) Macos java version - selvan@Selvanbapus-MacBook-Pro cms-angular % java --version java 17.0.5 2022-10-18 LTS Java(TM) SE Runtime Environment (build 17.0.5+9-LTS-191) Java HotSpot(TM) 64-Bit Server VM (build 17.0.5+9-LTS-191, mixed mode, sharing) – Selvan Bapu Feb 05 '23 at 10:35
  • Also, how are you building this - command line maven, command line Gradle, or via an IDE? – GreyBeardedGeek Feb 05 '23 at 10:39
  • I am building this via and IDE. SpringToolSuite4 – Selvan Bapu Feb 05 '23 at 11:02

1 Answers1

1

Lombok is an "annotation processor", and so must participate in the compile process.

Configuration of Lombok as an annotation processor varies according to your build tool. Most IDEs require some sort of plugin for this.

Specific to your environment, take a look at Lombok with Spring Tool Suite 4

GreyBeardedGeek
  • 29,460
  • 2
  • 47
  • 67