question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Array parameters encoding fails

See original GitHub issue

Version: 0.10.1

This query fails: pool.preparedQuery("select $1", Tuple.of(new Integer[] { 1, 2, 3, 4 }), System.out::println); with this exception: java.lang.ClassCastException: java.base/[Ljava.lang.Integer; cannot be cast to java.base/java.lang.String

Reading the message formats (https://www.postgresql.org/docs/10/static/protocol-message-formats.html), I see we can send the parameters data types.

And this project seems to have handle that in the past, because now it’s commented out: https://github.com/reactiverse/reactive-pg-client/blob/master/src/main/java/io/reactiverse/pgclient/impl/codec/encoder/MessageEncoder.java#L225

Maybe it’s not the source of the issue? But it seems related.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:10 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
vietjcommented, Aug 30, 2018

great, I’m releasing a 0.10.2 today with this fix

0reactions
vietjcommented, Aug 31, 2018

thanks @atvictor I will investigate on this case

Read more comments on GitHub >

github_iconTop Results From Across the Web

Error Encoding Arguments with Array of Objects
transact to merkle.mint errored: Error encoding arguments: Error: cannot encode object for signature with missing names (argument="values", ...
Read more >
Error encoding array of Encodable · Issue #285 - GitHub
In a simplistic example, if you pass an Encodable object to setBody , then it encodes into JSON and returns the payload as...
Read more >
JavaScript - Url encoding of Array type parameters
I can't figure out how to URL encode array params in an elegant way, in order to send XHR requests from my Vue.js...
Read more >
sklearn.preprocessing.OrdinalEncoder
Encode categorical features as an integer array. ... When the parameter handle_unknown is set to 'use_encoded_value', this parameter is required and will ...
Read more >
encodeURI() - JavaScript - MDN Web Docs
The encodeURI() function encodes a URI by replacing each instance of certain characters by one, two, three, or four escape sequences representing the...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found