spring-projects / spring-projects/spring-framework
ImportHttpServices scans concrete classes implementing @HttpExchange interfaces
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 60.2k
- Forks
- 38.8k
- Avg merge
- 5d 2h
- Merged PRs (30d)
- 27
Description
spring-web:7.0.8
When currently attempting to adapt and extend based on an httpclient interface, it will inject this class into the httpServiceProxyRegistry-bean. However, in reality, it is a regular class rather than an interface. Can non-interface classes be filtered out during the filtering process.
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'httpServiceProxyRegistry': [com.feeyo.common.client.limitx.ClientLimitxService] is not an interface
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1815)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:603)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:525)
at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:333)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:371)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:331)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:201)
at org.springframework.web.service.registry.AbstractHttpServiceRegistrar.getProxyInstance(AbstractHttpServiceRegistrar.java:204)
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start in AbstractHttpServiceRegistrar.java, especially getProxyInstance, and trace how ImportHttpServices discovers types annotated with @HttpExchange. Reproduce the failure with a concrete class implementing such an interface, then verify that registry creation ignores the concrete class while still handling the interface proxy.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java, spring
- Domain
- api, backend
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 58/100