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

Generic Type error in spring boot 3.4.1 #34166

Open
kumardhrubajyoti opened this issue Dec 24, 2024 · 6 comments
Open

Generic Type error in spring boot 3.4.1 #34166

kumardhrubajyoti opened this issue Dec 24, 2024 · 6 comments
Labels
status: waiting-for-feedback We need additional information before we can continue status: waiting-for-triage An issue we've not yet triaged or decided on

Comments

@kumardhrubajyoti
Copy link

kumardhrubajyoti commented Dec 24, 2024

I ve below code :

@ResponseBody
public class ControllerGenericImpl<T extends EnterpriseEntity> implements ControllerGeneric<T> {
	
	@Autowired
	private ServiceGeneric<T> genericService;

getting error at ->
Field genericService in ControllerGenericImpl required a single bean, but 12 were found:
Action:

Consider marking one of the beans as @primary, updating the consumer to accept multiple beans, or using @qualifier to identify the bean that should be consumed.

This is coming in spring boot 3.4.1 in 3.4.0 or below it was working properly.

@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged or decided on label Dec 24, 2024
@SaeidKazemi78
Copy link

Hi, please share more about your issue's detail . or send us gihub link of your project if it is publicly available .

@xeruvimov
Copy link

I have a similar problem, but with beans of type java.util.Map. If I don't set @qualifier, all my Map beans are just empty and it causes NPE due to Map.get() returning null.

@snicoll
Copy link
Member

snicoll commented Dec 26, 2024

@kumardhrubajyoti and @xeruvimov please share a small sample we can run ourselves that reproduces the problem. You can attach a zip here or push the code to a separate GitHub repository.

@snicoll snicoll added the status: waiting-for-feedback We need additional information before we can continue label Dec 26, 2024
@snicoll snicoll transferred this issue from spring-projects/spring-boot Dec 27, 2024
@spring-projects-issues
Copy link
Collaborator

If you would like us to look at this issue, please provide the requested information. If the information is not provided within the next 7 days this issue will be closed.

@spring-projects-issues spring-projects-issues added the status: feedback-reminder We've sent a reminder that we need additional information before we can continue label Jan 2, 2025
@zyro23
Copy link

zyro23 commented Jan 3, 2025

looks like a duplicate of #34119

@spring-projects-issues spring-projects-issues added status: feedback-provided Feedback has been provided and removed status: waiting-for-feedback We need additional information before we can continue status: feedback-reminder We've sent a reminder that we need additional information before we can continue labels Jan 3, 2025
@snicoll snicoll added status: waiting-for-feedback We need additional information before we can continue and removed status: feedback-provided Feedback has been provided labels Jan 3, 2025
@snicoll
Copy link
Member

snicoll commented Jan 3, 2025

Thank you for trying to help @zyro23 but your comment switched off the feedback label that's waiting on a repro. It very well might be a duplicate but we'd like to hear from those that are affected one way or the other. Right now, the issue doesn't have enough details.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: waiting-for-feedback We need additional information before we can continue status: waiting-for-triage An issue we've not yet triaged or decided on
Projects
None yet
Development

No branches or pull requests

6 participants