问题如下
[2023-02-14 09:37:30.379] [ERROR] [main] [org.springframework.boot.SpringApplication:837] - Application run failed
org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'afterUpdateShipperJobHandler': Unsatisfied dependency expressed through field 'defaultConsumerProp'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'mqConsumerConfig': Injection of resource dependencies failed; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'marsWebConfigurer': Unsatisfied dependency expressed through field 'loginHandler'; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'adminLoginHandler': Unsatisfied dependency expressed through field 'adminUserService'; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'adminUserService': Unsatisfied dependency expressed through field 'userCommonService'; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'userCommonService': Unsatisfied dependency expressed through field 'userService'; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'userService': Unsatisfied dependency expressed through field 'userOrgService'; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'userOrgService': Unsatisfied dependency expressed through field 'stockComponent'; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'stockComponent': Unsatisfied dependency expressed through field 'stockProxyComponent'; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'stockProxyComponent': Unsatisfied dependency expressed through field 'orderService'; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'orderService': Unsatisfied dependency expressed through field 'orderComponent'; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'orderComponent': Unsatisfied dependency expressed through field 'giftItemComponent'; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'giftItemComponent': Unsatisfied dependency expressed through field 'giftRecordComponent'; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'giftRecordComponent': Unsatisfied dependency expressed through field 'giftRecordDeliveryExtendComponent'; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'giftRecordDeliveryExtendComponent': Unsatisfied dependency expressed through field 'deliveryOrderMarsService'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'deliveryOrderMarsService': Injection of resource dependencies failed; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'refundInnerReadService': Unsatisfied dependency expressed through field 'cityPartnerProxyService'; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'cityPartnerProxyService': Unsatisfied dependency expressed through field 'cityPartnerExamineService'; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'cityPartnerExamineServiceImpl': Unsatisfied dependency expressed through field 'paymentOrderInnerService'; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'paymentOrderInnerService': Unsatisfied dependency expressed through field 'payService'; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'payService': Unsatisfied dependency expressed through field 'tradeRecordService'; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'tradeRecordService': Unsatisfied dependency expressed through field 'payBizService'; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'payBizService': Unsatisfied dependency expressed through field 'dataConvertComponent'; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'dataConvertComponent': Unsatisfied dependency expressed through field 'lianLianPayAdminService'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'lianLianPayAdminServiceImpl' defined in URL [jar:file:/usr/local/yunji/core/marsplan.jar!/BOOT-INF/classes!/com/marsplan/service/lianlian/impl/LianLianPayAdminServiceImpl.class]: Initialization of bean failed; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'ServiceBean:com.marsplan.job.course.ILianLianJobDubboService:1.0.0': Cannot resolve reference to bean 'lianLianJobDubboServiceImpl' while setting bean property 'ref'; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'lianLianJobDubboServiceImpl': Unsatisfied dependency expressed through field 'itemAdminService'; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'itemAdminServiceImpl': Unsatisfied dependency expressed through field 'itemElasticComponent'; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'itemElasticComponent': Unsatisfied dependency expressed through field 'restHighLevelClient';
nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'restHighLevelClient' defined in class path resource [com/marsplan/config/config/ElasticSearchConfig.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.elasticsearch.client.RestHighLevelClient]: Factory method 'restHighLevelClient' threw exception;
nested exception is java.lang.StackOverflowError
at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:643)
at org.springframework.beans.factory.annotation.InjectionMetadata.inject(InjectionMetadata.java:130)
at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessProperties(AutowiredAnnotationBeanPostProcessor.java:399)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1422)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:594)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:517)
at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:323)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:226)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:321)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:202)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:895)
at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:878)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:550)
at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:143)
at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:758)
at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:750)
at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:397)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:315)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1237)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1226)
at com.marsplan.MarsPlanApplication.main(MarsPlanApplication.java:23)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.springframework.boot.loader.MainMethodRunner.run(MainMethodRunner.java:49)
at org.springframework.boot.loader.Launcher.launch(Launcher.java:109)
at org.springframework.boot.loader.Launcher.launch(Launcher.java:58)
at org.springframework.boot.loader.JarLauncher.main(JarLauncher.java:88)
解决方案
- 将jvm参数-Xss设置为512k
-Xss512
-Xss 设置的大小决定了函数调用的深度,如果函数调用的深度大于设置的Xss大小,那么将会抛“java.lang.StackOverflowError“ 异常
- 如果手动配置ES,则将springboot的自动装配ES排除。
@SpringBootApplication(exclude = {ElasticsearchDataAutoConfiguration.class, ElasticsearchRestClientAutoConfiguration.class})