eclipse使用lombok的一个坑 无法找到set、get方法

项目在启动时遇到错误,主要问题在于SpringBean的创建过程中,由于依赖注入不满足导致多个Bean无法初始化。具体表现为在创建beanNameHandlerMapping时,遇到了reportOdaService等其他多个服务Bean的依赖问题,这些服务Bean自身的依赖无法解析,例如colorService、productStructureService等。尝试了Lombok.jar、修改eclipse.ini设置以及IDE配置,但只有最后一个选项成功解决问题。
摘要由CSDN通过智能技术生成

一、项目运行会报这个错

Error starting ApplicationContext. To display the auto-configuration report re-run your application with 'debug' enabled.
2023-03-11 11:34:36.931 +0800 [ERROR] [main] [o.springframework.boot.SpringApplication] [-] [-] [] Application startup failed
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'beanNameHandlerMapping' defined in org.springframework.web.servlet.config.annotation.DelegatingWebMvcConfiguration: Initialization of bean failed; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name '/reportOdaService': Cannot resolve reference to bean 'reportOdaService' while setting bean property 'service'; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'reportOdaService': Unsatisfied dependency expressed through field 'reportAdapterList'; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'acoDetailReportService': Unsatisfied dependency expressed through field 'changeService'; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'changeService': Unsatisfied dependency expressed through field 'custEngineerPartDesignService'; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'custEngineerPartDesignService': Unsatisfied dependency expressed through field 'partService'; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'partService': Unsatisfied dependency expressed through field 'colorService'; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'colorService': Unsatisfied dependency expressed through field 'custColorSchemeService'; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'custColorSchemeService': Unsatisfied dependency expressed through field 'colorIECodeService'; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'colorIECodeService': Unsatisfied dependency expressed through field 'colorSchemeService'; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'colorSchemeService': Unsatisfied dependency expressed through field 'partAssemblyService'; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'partAssemblyService': Unsatisfied dependency expressed through field 'productNodeService'; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'productNodeService': Unsatisfied dependency expressed through field 'productTypeService'; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'productTypeService': Unsatisfied dependency expressed through field 'productStructureService'; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'productStructureService': Unsatisfied dependency expressed through field 'changeOperationService'; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'changeOperationService': Unsatisfied dependency expressed through field 'custEngineerChangeOrderService'; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'custEngineerChangeOrderService': Unsatisfied dependency expressed through field 'releaseChangeService'; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'releaseChangeService': Unsatisfied dependency expressed through field 'custChangeActionService'; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'custChangeActionService': Unsatisfied dependency expressed through field 'custPartAssemblyService'; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'custPartAssemblyService': Unsatisfied dependency expressed through field 'attachRecordAdapterService'; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'attachRecordAdapterService': Unsatisfied dependency expressed through field 'plantLayoutService'; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'plantLayoutService': Unsatisfied dependency expressed through field 'plantLayoutService'; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'custPlantLayoutService': Unsatisfied dependency expressed through field 'custSapPlantService'; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'custSapPlantService': Unsatisfied dependency expressed through field 'custReceivedVehicleService'; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'custReceivedVehicleService': Unsatisfied dependency expressed through field 'partAssemblyDrivenService'; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'partAssemblyDrivenService': Unsatisfied dependency expressed through field 'compositePartAdapterService'; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'compositePartAdapterService': Unsatisfied dependency expressed through field 'partSupplyService'; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'partSupplyService': Unsatisfied dependency expressed through field 'custMaterialInfoService'; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'custMaterialInfoService': Unsatisfied dependency expressed through field 'custMaterialBomService'; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'custMaterialBomService': Unsatisfied dependency expressed through field 'colorBomAdapterService'; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'colorBomAdapterService': Unsatisfied dependency expressed through field 'colorBomAdapterService'; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'custColorBomAdapterService': Unsatisfied dependency expressed through field 'engineerPartDesignService'; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'engineerPartDesignService': Unsatisfied dependency expressed through field 'custPartService'; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'custPartService': Unsatisfied dependency expressed through field 'taskService'; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'fwTaskService': Unsatisfied dependency expressed through field 'timingTaskHandleList'; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'custSapTaskQueueTimingTask': Unsatisfied dependency expressed through field 'custSapIntegrationService'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'custSapIntegrationService' defined in file [C:\MyWorksEclipse\workspace\BYD_CAR_PVBOM\prj-cust-app\bin\com\gantang\cust\integration\sap\service\impl\CustSapIntegrationServiceImpl.class]: Instantiation of bean failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [com.gantang.cust.integration.sap.service.impl.CustSapIntegrationServiceImpl]: Constructor threw exception; nested exception is java.lang.Error: Unresolved compilation problems: 
	The method setMasterPartId(Long) is undefined for the type CustSapMasterPartDto
	The method setMaterialNo(String) is undefined for the type CustSapMasterPartDto
	The method getSapMasterPartDto() is undefined for the type CustSapTaskDetailResultDto
	The method getSapEcns() is undefined for the type CustSapTaskDetailResultDto
	The method setSapTaskDetailId(String) is undefined for the type QueryBomJsonRequest
	The method setBomChangeCode(String) is undefined for the type QueryBomJsonRequest
	The method setSapTaskDetailId(String) is undefined for the type CreateBomJsonRequest
	The method setBomChangeCode(String) is undefined for the type CreateBomJsonRequest
	The method getSapEcns() is undefined for the type CustSapTaskDetailResultDto
	The method setSapTaskDetailId(String) is undefined for the type UpdateBomJsonRequest
	The method setBomChangeCode(String) is undefined for the type UpdateBomJsonRequest
	The method setSendResult(boolean) is undefined for the type CustSapTaskDetailResultDto
	The method getSapTaskDetailId() is undefined for the type CustSapTaskDetailResultDto
	The method isSendResult() is undefined for the type CustSapTaskDetailResultDto
	The method getSapMasterPartDto() is undefined for the type CustSapTaskDetailResultDto
	The method getSapEcns() is undefined for the type CustSapTaskDetailResultDto
	The method getMasterPartId() is undefined for the type CustSapMasterPartDto
	The method getMaterialNo() is undefined for the type CustSapMasterPartDto
	The method getMasterPartId() is undefined for the type CustSapMasterPartDto
	The method getMaterialNo() is undefined for the type CustSapMasterPartDto
	The method getFldelete() is undefined for the type UpdateBomStpoDto
	The method map(Function<? super UpdateBomStpoDto,? extends R>) in the type Stream<UpdateBomStpoDto> is not applicable for the arguments (UpdateBomStpoDto::getItemText2)
	The type UpdateBomStpoDto does not define getItemText2(UpdateBomStpoDto) that is applicable here
	The method getItemText2() is undefined for the type UpdateBomStpoDto
	The method getItemText2() is undefined for the type UpdateBomStpoDto
	The method setChangeNo(String) is undefined for the type UpdateBomStpoDto
	The method setChangeNo(String) is undefined for the type UpdateBomStpoDto
	The method setSendResult(boolean) is undefined for the type CustSapTaskDetailResultDto
	The method getSapTaskDetailId() is undefined for the type CustSapTaskDetailResultDto
	The method isSendResult() is undefined for the type CustSapTaskDetailResultDto

	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:564)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:483)
	at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:306)
	at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230)
	at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:302)
	at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:197)
	at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:761)
	at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:866)
	at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:542)
	at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.refresh(EmbeddedWebApplicationContext.java:122)
	at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:762)
	at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:372)
	at org.springframework.boot.SpringApplication.run(SpringApplication.java:316)
	at grails.boot.GrailsApp.run(GrailsApp.groovy:83)
	at grails.boot.GrailsApp.run(GrailsApp.groovy:388)
	at grails.boot.GrailsApp.run(GrailsApp.groovy:375)
	at grails.boot.GrailsApp$run.call(Unknown Source)
	at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:48)
	at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:113)
	at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:133)
	at prj.cust.app.Application.main(Application.groovy:8)

二、尝试解决

尝试一、运行lombok.jar包 --失败
尝试二、eclipse.ini加信息 --失败
尝试三、勾选那两个对勾 --成功
在这里插入图片描述

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值