admin管理员组

文章数量:1384402

I am setting up a soap service using Spring boot 3.4.3 and Apache cxf 4.1.1.
I use the simpelest setup from Spring initializer only selecting web dependency and apache cxf like below:

<dependencies>
        <dependency>
            <groupId>.springframework.boot</groupId>
            <artifactId>spring-boot-starter-web</artifactId>
        </dependency>
        <dependency>
            <groupId>.apache.cxf</groupId>
            <artifactId>cxf-spring-boot-starter-jaxws</artifactId>
            <version>4.1.1</version>
        </dependency>
 </dependencies>

Maven build runs without problems, however when I startup the spring boot app, setting the log level to debug, it logs the following exception:

''2025-03-18 14:17:41 DEBUG o.s.b.f.s.DefaultListableBeanFactory - Creating shared instance of singleton bean 'cxf'
''2025-03-18 14:17:41 DEBUG o.a.c.c.spring.ConfigurerImpl - Could not determine bean name for instance of class .apache.cxf.ws.policy.PolicyAnnotationListener.
''2025-03-18 14:17:41 DEBUG o.a.c.c.spring.ConfigurerImpl - Could not determine bean name for instance of class .apache.cxf.service.factory.FactoryBeanListenerManager.
''2025-03-18 14:17:41 DEBUG o.a.c.c.spring.ConfigurerImpl - Could not determine bean name for instance of class .apache.cxf.ws.policy.PolicyEngineImpl.
''2025-03-18 14:17:41 DEBUG o.a.c.c.spring.ConfigurerImpl - Could not determine bean name for instance of class .apache.cxf.ws.policy.PolicyDataEngineImpl.
''2025-03-18 14:17:41 DEBUG o.a.c.c.spring.ConfigurerImpl - Could not determine bean name for instance of class .apache.cxf.bus.managers.CXFBusLifeCycleManager.
''2025-03-18 14:17:41 DEBUG o.a.c.c.spring.ConfigurerImpl - Could not determine bean name for instance of class .apache.cxf.bus.managers.ServerRegistryImpl.
''2025-03-18 14:17:41 DEBUG o.a.c.c.spring.ConfigurerImpl - Could not determine bean name for instance of class .apache.cxf.io.DelayedCachedOutputStreamCleaner.
''2025-03-18 14:17:41 DEBUG o.a.c.r.DefaultResourceManager - resolving resource <.apache.cxf.io.DelayedCachedOutputStreamCleaner/bus> type <interface .apache.cxf.Bus>
''2025-03-18 14:17:41 DEBUG o.a.c.r.DefaultResourceManager - resolving resource <null> type <interface .apache.cxf.Bus>
''2025-03-18 14:17:41 DEBUG o.s.b.f.s.DefaultListableBeanFactory - Creating shared instance of singleton bean 'cxf'
''2025-03-18 14:17:41 DEBUG o.a.c.r.DefaultResourceManager - run into exception when using.apache.cxf.bus.spring.BusApplicationContextResourceResolver
'.springframework.beans.factory.BeanCurrentlyInCreationException: Error creating bean with name 'cxf': Requested bean is currently in creation: Is there an unresolvable circular reference?
    at .springframework.beans.factory.support.DefaultSingletonBeanRegistry.beforeSingletonCreation(DefaultSingletonBeanRegistry.java:355)
    at .springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:227)
    at .springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:335)
    at .springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:205)
    at .springframework.context.support.AbstractApplicationContext.getBean(AbstractApplicationContext.java:1249)
    at .apache.cxf.bus.spring.BusApplicationContextResourceResolver.resolve(BusApplicationContextResourceResolver.java:72)
    at .apache.cxf.resource.DefaultResourceManager.findResource(DefaultResourceManager.java:118)
    at .apache.cxf.resource.DefaultResourceManager.resolveResource(DefaultResourceManager.java:62)
    at .apache.cxfmon.injection.ResourceInjector.resolveResource(ResourceInjector.java:436)
    at .apache.cxfmon.injection.ResourceInjector.visitMethod(ResourceInjector.java:233)
    at .apache.cxfmon.annotation.AnnotationProcessor.processMethods(AnnotationProcessor.java:89)
    at .apache.cxfmon.annotation.AnnotationProcessor.accept(AnnotationProcessor.java:72)
    at .apache.cxfmon.injection.ResourceInjector.inject(ResourceInjector.java:121)
    at .apache.cxfmon.injection.ResourceInjector.inject(ResourceInjector.java:115)
    at .apache.cxf.bus.extension.ExtensionManagerImpl.loadAndRegister(ExtensionManagerImpl.java:227)
    at .apache.cxf.bus.extension.ExtensionManagerImpl.getBeansOfType(ExtensionManagerImpl.java:333)
    at .apache.cxf.bus.spring.SpringBeanLocator.getBeansOfType(SpringBeanLocator.java:154)
    at .apache.cxf.bus.managers.CXFBusLifeCycleManager.initComplete(CXFBusLifeCycleManager.java:81)
    at .apache.cxf.bus.extension.ExtensionManagerBus.initialize(ExtensionManagerBus.java:254)
    at .apache.cxf.bus.spring.SpringBus.setApplicationContext(SpringBus.java:90)
    at .springframework.context.support.ApplicationContextAwareProcessor.invokeAwareInterfaces(ApplicationContextAwareProcessor.java:110)
    at .springframework.context.support.ApplicationContextAwareProcessor.postProcessBeforeInitialization(ApplicationContextAwareProcessor.java:85)
    at .springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyBeanPostProcessorsBeforeInitialization(AbstractAutowireCapableBeanFactory.java:422)
    at .springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1798)
    at .springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:600)
    at .springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:522)
    at .springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:337)
    at .springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:234)
    at .springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:335)
    at .springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:200)
    at .springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:975)
    at .springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:971)
    at .springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:625)
    at .springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:146)
    at .springframework.boot.SpringApplication.refresh(SpringApplication.java:754)
    at .springframework.boot.SpringApplication.refreshContext(SpringApplication.java:456)
    at .springframework.boot.SpringApplication.run(SpringApplication.java:335)
    at .springframework.boot.SpringApplication.run(SpringApplication.java:1363)
    at .springframework.boot.SpringApplication.run(SpringApplication.java:1352)
    at nl.rce.test.demo.DemoApplication.main(DemoApplication.java:10)
'2025-03-18 14:17:41 DEBUG o.s.b.f.s.DefaultListableBeanFactory - Creating shared instance of singleton bean '.apache.cxf.spring.boot.autoconfigure.jaxws.CxfJaxwsAutoConfiguration'
''2025-03-18 14:17:41 DEBUG o.s.b.f.s.DefaultListableBeanFactory - Creating shared instance of singleton bean '.springframework.boot.autoconfigure.jmx.JmxAutoConfiguration'
''2025-03-18 14:17:41 DEBUG o.s.b.f.s.DefaultListableBeanFactory - Creating shared instance of singleton bean 'spring.jmx-.springframework.boot.autoconfigure.jmx.JmxProperties'
''2025-03-18 14:17:41 DEBUG o.s.b.f.s.DefaultListableBeanFactory - Autowiring by type from bean name '.springframework.boot.autoconfigure.jmx.JmxAutoConfiguration' via constructor to bean named 'spring.jmx-.springframework.boot.autoconfigure.jmx.JmxProperties'
''2025-03-18 14:17:41 DEBUG o.s.b.f.s.DefaultListableBeanFactory - Creating shared instance of singleton bean 'mbeanExporter'

It looks like the bean with the name cxf is being created 2 times and the second time this exception occurs.

I have tried various (downgraded) versions of both Spring boot and Apache cxf but the exception remains.

This exception only occurs at debug level and when I ignore this exception the application starts up successfully and the webservice call works as desired. So I am wondering is this a bug? and should it be ignored?

Thanks in advance for your advice

本文标签: Spring bootApache cxf logs BeanCurrentlyInCreationException at RuntimeStack Overflow