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

DATAJPA-1172 (backport) Log when an exception gets swallowed during setting of parameters. #217

Closed
wants to merge 2 commits into from

Conversation

schauder
Copy link
Contributor

@schauder schauder commented Sep 8, 2017

No description provided.

It looks like we could actually get rid of catching the exception and just let it propagate.
But we are not confident enough in this to take such a risk so late in the release life cycle just to get better error reporting.
@schauder schauder changed the base branch from master to 1.11.x September 8, 2017 14:23
odrotbohm pushed a commit that referenced this pull request Sep 8, 2017
It looks like we could actually get rid of catching the exception and just let it propagate.
But we are not confident enough in this to take such a risk so late in the release life cycle just to get better error reporting.

Original pull request: #217.
odrotbohm added a commit that referenced this pull request Sep 8, 2017
Avoid explicit line breaks by reorganizing code.

Original pull request: #217.
odrotbohm pushed a commit that referenced this pull request Sep 8, 2017
It looks like we could actually get rid of catching the exception and just let it propagate.
But we are not confident enough in this to take such a risk so late in the release life cycle just to get better error reporting.

Original pull request: #217.
odrotbohm added a commit that referenced this pull request Sep 8, 2017
Avoid explicit line breaks by reorganizing code.

Original pull request: #217.
odrotbohm pushed a commit that referenced this pull request Sep 8, 2017
It looks like we could actually get rid of catching the exception and just let it propagate.
But we are not confident enough in this to take such a risk so late in the release life cycle just to get better error reporting.

Original pull request: #217.
odrotbohm added a commit that referenced this pull request Sep 8, 2017
Avoid explicit line breaks by reorganizing code.

Original pull request: #217.
@odrotbohm odrotbohm closed this Sep 8, 2017
@odrotbohm odrotbohm deleted the issue/DATAJPA-1172-backport branch September 8, 2017 16:09
@FireWolf2007
Copy link

FireWolf2007 commented Sep 20, 2017

After upgrading to last modifications we have following exceptions:

2017-09-19 22:33:17.954  WARN 8 --- [ XNIO-2 task-54] SpelExpressionStringQueryParameterBinder : Setting the parameter with name 'null' and position '2' lead to an exception.

java.lang.IllegalArgumentException: Unknown parameter position: 2
	at org.hibernate.query.internal.QueryParameterBindingsImpl.getBinding(QueryParameterBindingsImpl.java:240)

Problem reproduces with select which has 2 identical SpEL expressions "?#{principal.username}"

Simplified part of JPQL causes this warning:

(EXISTS
	(
	SELECT 1 FROM User user LEFT JOIN user.authorities userAuthority
	WHERE user.login = ?#{principal.username} AND userAuthority.name IN('ADMIN','USER')
	)
	OR
 EXISTS
	(
	SELECT 1 FROM Employee employee INNER JOIN employee.userAccount user 
	WHERE user.login = ?#{principal.username} 
	)
)

Whats wrong and why we have this warning?

@schauder
Copy link
Contributor Author

This PR has uncovered a minor bug, which now triggers these warning.
There is a little more information in spring-projects/spring-data-examples#293
There is already a PR for a fix for the underlying bug.

Other than the warnings in the logs there shouldn't be any negative effects for you or your application. And the logs should go away with an update in the near future.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants