-
Notifications
You must be signed in to change notification settings - Fork 228
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
Error in type converter CoerceUtil #689
Comments
I haven't had a chance to run this under a debugger yet, but are you saying it tried to convert to UUID by using Or is it just providing the wrong type entirely? The constructor for UUID takes 2 |
In class BeanUtilsBean register uuid converter:
But when I debugged the code that I understand the registered converter of type UUID disappears as bin is created anew and it already does not have a converter for UUID type. |
Would you be willing to provide a minimal, verifiable example? This will help us in tracking down what's causing your issue. |
To repeat the exception: |
I looked into this a bit this morning. When |
Hi @stanyslav, sorry for the delay on this. I am unable to reproduce your issue without any overrides to |
Hello, i am no overrides to BeanUtilsBean. |
@stanyslav we have tests for UUID primary keys generally. It looks like you’re using some Postgres specific features. Can you please provide a minimal reproducible example so we can help diagnose you’re issue? Sent with GitHawk |
I prepared an example with the exception of UUID |
Hi @stanyslav, thank you for the example! I do see that I can reproduce this now with your example. After some investigation, it looks like we're getting bit by classloader issues. You will notice that both ContextClassLoaderLocal#get and ContextClassLoaderLocal#set both call The problem here is that when we start up and the That leaves the looming question as to why this is only happening now. Namely, why in My proposed solution is to properly cope with multiple classloaders; it shouldn't be the responsibility of |
Hi @stanyslav, I have a PR here to address this issue: #693 Feel free to pull down the branch and test locally to ensure this addresses your issues. However, my local tests with your examples demonstrates to me that this will work. |
The change has been merged and should be available with release 4.2.7 |
Closing issue since the fix has been merged and released. Please reopen if you experience further issues. |
When using UUID as the primary key of the entity, when requesting data from the database, throws an exception:
The problem in the class com.yahoo.elide.utils.coerce.CoerceUtil, maybe because BeanUtilsBean uses his loader and got that he is not a singleton:
BeanUtilsBean.setInstance(new BeanUtilsBean(new BidirectionalConvertUtilBean() ...
My entity:
The text was updated successfully, but these errors were encountered: