-
Notifications
You must be signed in to change notification settings - Fork 617
Cannot resolve targetEntity in EntityFromDtoInstantiatingConverter. #2505
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
Comments
This might be something different. But I wonder how the targetEntity should become null if you are requesting a known type. Can you provide a reproducer? |
Hello! My class extends org.springframework.security.core.userdetails.User, but the error occurs even with this simple User class below, with a single Boolean (error occurs with either primitive or wrapper type) constructor argument. I stepped it pretty deep into the debugger and found that AbstractMappingContext getPersistentEntity(TypeInformation<?> type) was returning NULL for boolean types.
encounters the following NPE:
My simple User class is below
|
I created an example based on your given explanation about the problem (https://github.com/meistermeier/neo4j-issues-examples/tree/master/gh-2505). |
I think you're right that the problem is the call itself. My property value is a wrapped Boolean (false) but the target property type is a primitive Class (boolean), so it is entering this code block on line 133 when it shouldn't be.
isInstance() always returns false for primitive type Class objects. Unfortunately I can't reproduce this anymore with my simple User example :( will keep trying. |
Ah, I don't encounter the error unless I actually return the Mono in the repo method
|
I also see these warnings in the logs WARNING: An illegal reflective access operation has occurred |
Okay, I'm running the same test now that you created in https://github.com/meistermeier/neo4j-issues-examples and it fails :( |
if I change the enabled field and constructor argument from boolean to Boolean then the test passes. |
In your User class (and also the original one I provided, oops) the type is Boolean, so that is why the test passed in that case. I think this should be enough now to track down the issue. |
Thanks for the investigation. And you are 100% right. The |
You could check out the |
This issue still occurs in 6.2.2. The NPE is now on line 77:
PreferredConstructor> constructor = targetEntity
.getPersistenceConstructor();
Originally posted by @seabamirum in #2395 (comment)
The text was updated successfully, but these errors were encountered: