-
Notifications
You must be signed in to change notification settings - Fork 2.9k
HQL console in DevUI is not working #47663
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
/cc @cescoffier (devui), @phillip-kruger (devui) |
@mbladel ^^^ |
i didn't see the hql console - but are we really serializing the object graph to the ui here? that seems not necessary as on client side we would just do tostring anyway wouldnt we? |
That's a temporary implementation which -- as explained in the error message -- is very limited.
This does seem like a much simpler temporary solution indeed, but quite limiting (people don't always implement The fact remains that the error reported in this issue doesn't seem normal at all. I would guess the implementation depends on the presence of Jackson, which is absent in the reproducer? Something like that? |
Thanks @omasseau for reporting the issue and providing the steps to reproduce it. I've debugged the error, and it seems like it's caused by the The method is marked as Lines 104 to 107 in b93740b
Diving a bit deeper into the error, it looks like the
Since the internal implementation uses a Reminder that the
@maxandersen we need a JSON-representation of the object tree returned by the query, to present results in a formatted table. We are manually invoking serialization (instead of relying on the default JSON marshaling) because managed entities might have lazy fields and / or circular associations which need special handling. For now circularity is not prevented, as we're waiting for the feature to be included on the Hibernate side and released, so we are producing a special error message. |
We can't guarantee that Jackson is available on the runtime class path, that is why we always use the one from deployment. You can always go object to map in your jsonrpc service. That should then ignore the field, once it gets to dev ui it will go map to json |
+1 just hit this error myself. |
@phillip-kruger Not sure what you mean by this: are you saying I should create a |
Yes, we're dealing with arbitrary data here, I don't think this would work. I'd say we have three options:
Looks like either 1 or 2 (copy-pasting alternative) could be implemented in a realistic time frame, as a quick fix? |
I meant using Jackson to go from Object to Map (rather than json) |
So at the moment you create an object that you return in your JsonRPC Service (right ?). On the way back to the browser that object gets to the Dev UI JsonRPC Router and there we use Jackson to create json to send to the browser. That Jackson is not the one you want (right ?) I am saying, creating a Map from the object in your JsonRPC service using your Jackson should solve the issue. Then the map will get to the JsonRPC Router and go to json. |
@yrodiere thanks for the suggestions. Regarding 2., merging it into ORM is not really an easy option as we're waiting for the final release of 7 (which will take some time before being available in Quarkus I'm guessing), and the new features would probably land in 7.1. Let's see what we can do, and at worst fall back to 1. for the moment. @phillip-kruger no, we are not returning an object and using the default serialization. We are actually manually invoking serialization on the query results here: Line 158 in 244937a
We don't know the structure of the arbitrary objects we're serializing so I don't know how we would create a map from them. |
Uh oh!
There was an error while loading. Please reload this page.
Describe the bug
See: #46728
The DevUI HQL console is not working in latest version of quarkus (3.22.1)
It just display this error :
Error executing query: Unable to encode results as JSON. Note circular associations are not supported at the moment, use @JsonIgnore to break circles.
Expected behavior
HQL Console should work with such a basic entity :
Actual behavior
HQL Console displays an error.
The error message is misleading (there are no cicular associations here).
How to Reproduce?
To reproduce the problem:
insert into myentity (id, field) values(1, 'field-1');
Output of
uname -a
orver
No response
Output of
java -version
21.0.3
Quarkus version or git rev
3.22.1
Build tool (ie. output of
mvnw --version
orgradlew --version
)maven 3.9.9
Additional information
No response
The text was updated successfully, but these errors were encountered: