Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't use HttpServiceProxyFactory#builder with both spring-boot-starter-web and spring-boot-starter-webflux #32869

Closed
batetolast1 opened this issue Oct 25, 2022 · 2 comments
Labels
for: external-project For an external project and not something we can fix status: duplicate A duplicate of another issue

Comments

@batetolast1
Copy link

While using Spring Boot 3.0.0-RC1 with both spring-boot-starter-web and spring-boot-starter-webflux dependencies (Gradle), creating HttpServiceProxyFactory via

@Bean
HttpServiceProxyFactory httpServiceProxyFactory(WebClient webClient) {
    return HttpServiceProxyFactory.builder(WebClientAdapter.forClient(webClient)).build();
}

throws the following exception

...
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'httpServiceProxyFactory' defined in class path resource [...]: HttpServiceProxyFactory was created through the builder
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:606) ~[spring-beans-6.0.0-RC2.jar:6.0.0-RC2]
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:521) ~[spring-beans-6.0.0-RC2.jar:6.0.0-RC2]
	at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:326) ~[spring-beans-6.0.0-RC2.jar:6.0.0-RC2]
	at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:234) ~[spring-beans-6.0.0-RC2.jar:6.0.0-RC2]
	at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:324) ~[spring-beans-6.0.0-RC2.jar:6.0.0-RC2]
	at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:200) ~[spring-beans-6.0.0-RC2.jar:6.0.0-RC2]
	at org.springframework.beans.factory.config.DependencyDescriptor.resolveCandidate(DependencyDescriptor.java:254) ~[spring-beans-6.0.0-RC2.jar:6.0.0-RC2]
	at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:1375) ~[spring-beans-6.0.0-RC2.jar:6.0.0-RC2]
	at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:1295) ~[spring-beans-6.0.0-RC2.jar:6.0.0-RC2]
	at org.springframework.beans.factory.support.ConstructorResolver.resolveAutowiredArgument(ConstructorResolver.java:880) ~[spring-beans-6.0.0-RC2.jar:6.0.0-RC2]
	at org.springframework.beans.factory.support.ConstructorResolver.createArgumentArray(ConstructorResolver.java:784) ~[spring-beans-6.0.0-RC2.jar:6.0.0-RC2]
	... 47 common frames omitted
Caused by: java.lang.IllegalStateException: HttpServiceProxyFactory was created through the builder
	at org.springframework.util.Assert.state(Assert.java:76) ~[spring-core-6.0.0-RC2.jar:6.0.0-RC2]
	at org.springframework.web.service.invoker.HttpServiceProxyFactory.setEmbeddedValueResolver(HttpServiceProxyFactory.java:134) ~[spring-web-6.0.0-RC2.jar:6.0.0-RC2]
	at org.springframework.context.support.ApplicationContextAwareProcessor.invokeAwareInterfaces(ApplicationContextAwareProcessor.java:94) ~[spring-context-6.0.0-RC2.jar:6.0.0-RC2]
	at org.springframework.context.support.ApplicationContextAwareProcessor.postProcessBeforeInitialization(ApplicationContextAwareProcessor.java:85) ~[spring-context-6.0.0-RC2.jar:6.0.0-RC2]
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyBeanPostProcessorsBeforeInitialization(AbstractAutowireCapableBeanFactory.java:420) ~[spring-beans-6.0.0-RC2.jar:6.0.0-RC2]
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1745) ~[spring-beans-6.0.0-RC2.jar:6.0.0-RC2]
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:599) ~[spring-beans-6.0.0-RC2.jar:6.0.0-RC2]
	... 57 common frames omitted

Creating HttpServiceProxyFactory via

@Bean
HttpServiceProxyFactory httpServiceProxyFactory(WebClient webClient) {
    return new HttpServiceProxyFactory(WebClientAdapter.forClient(webClient));
}

works just fine.

@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged label Oct 25, 2022
@mdeinum
Copy link
Contributor

mdeinum commented Oct 25, 2022

Related / Duplicate of : spring-projects/spring-framework#29376

@wilkinsona
Copy link
Member

Thanks, @mdeinum.

@wilkinsona wilkinsona closed this as not planned Won't fix, can't repro, duplicate, stale Oct 25, 2022
@wilkinsona wilkinsona added status: duplicate A duplicate of another issue for: external-project For an external project and not something we can fix and removed status: waiting-for-triage An issue we've not yet triaged labels Oct 25, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
for: external-project For an external project and not something we can fix status: duplicate A duplicate of another issue
Projects
None yet
Development

No branches or pull requests

4 participants