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

Already found parameter binding with same index / parameter name but differing binding type; #3127

Closed
miriyalajanardhan opened this issue Aug 28, 2023 · 10 comments
Labels
status: duplicate A duplicate of another issue status: feedback-provided Feedback has been provided

Comments

@miriyalajanardhan
Copy link

After upgrading to spring boot 3.1.3 getting the below error.

Below is the condition which is causing the error. (List regions
)
and ( :regions is null OR lower(c.region) IN (:regions) )

Caused by: java.lang.IllegalArgumentException: Already found parameter binding with same index / parameter name but differing binding type; Already have: ParameterBinding [identifier: regions, origin: MethodInvocationArgument[identifier=regions]], found ParameterBinding [identifier: regions, origin: MethodInvocationArgument[identifier=regions]]; If you bind a parameter multiple times make sure they use the same binding

Same code is working in spring boot 3.1.2

@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged label Aug 28, 2023
@mp911de
Copy link
Member

mp911de commented Aug 28, 2023

This has been fixed with #3126. Care to retest against the latest snapshots?

@mp911de mp911de added status: duplicate A duplicate of another issue status: waiting-for-feedback We need additional information before we can continue and removed status: waiting-for-triage An issue we've not yet triaged labels Aug 28, 2023
@miriyalajanardhan
Copy link
Author

Retried with 3.1.4-SNAPSHOT, still the issue is same.

@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 labels Aug 30, 2023
@mp911de
Copy link
Member

mp911de commented Aug 30, 2023

Can you please provide a reproducer so we can debug the issue on our side?

@HengCC
Copy link

HengCC commented Sep 1, 2023

same at #3126 (comment)

@HengCC
Copy link

HengCC commented Sep 4, 2023

@mp911de
When I downgraded to version 3.0.9, there were no errors,

@gregturn
Copy link
Contributor

gregturn commented Sep 8, 2023

@HengCC Could you include a link to a reproducer, staged on github, ideally using https://start.spring.io, H2 (or Testcontainers for PostGreSQL, etc.), and the version of Spring Boot aligned with your issue?

Citing a single comment from another ticket isn't sufficient to hammer out this issue.

It's quite natural that downgrading to an older version that didn't properly support re-used bindings might work, but it reintroduces an older problem we solved.

@HengCC
Copy link

HengCC commented Sep 11, 2023

@gregturn Thanks for reply, Downgrading can temporarily resolve the issue of the project not running. However,You are correct; downgrading may reintroduce old problems. I have provided a temporary repository for reproducing this issue.

https://github.com/HengCC/jpa-param-index-demo.git

@mp911de
Copy link
Member

mp911de commented Sep 13, 2023

I'm not able to reproduce the issue anymore, hence closing this ticket.

@mp911de mp911de closed this as not planned Won't fix, can't repro, duplicate, stale Sep 13, 2023
@HengCC
Copy link

HengCC commented Sep 13, 2023

@mp911de thanks , I think I've know the reason of this issue . It's still the same demo as above. With the current configuration, the issue no longer occurs
image
At the very beginning, spring-boot-starter-data-jpa:3.1.4-snapshot still depends on spring-data-jpa:3.1.3.
Perhaps this is due to the IDE's cache or Maven's caching mechanism? Now that I've reverted the configuration, spring-boot-starter-data-jpa:3.1.4-snapshot now depends on spring-data-jpa:3.1.4-snapshot. The issue can no longer be reproduced.

@mp911de
Copy link
Member

mp911de commented Sep 13, 2023

Spring Boot manages starter versions that do not necessarily map to Spring Data versions. Redeclaring either individual dependency versions, or better, specifying the Spring Data version property (<spring-data-bom.version>2023.0.4-SNAPSHOT</spring-data-bom.version>) is the way to override a dependency.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: duplicate A duplicate of another issue status: feedback-provided Feedback has been provided
Projects
None yet
Development

No branches or pull requests

5 participants