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
org.postgresql.util.PGobject is in unnamed module of loader 'app' #2366
Comments
Do you have the rest of the exception. I'd like to see what happens before this is thrown. |
I checked, the code was was doing something like this: Object[] values = (Object[]) resultSet.getArray("some-field").getArray();
String firstValue = ((PGobject) values[0]).getValue() I changed it to: Object[] values = (Object[]) resultSet.getArray("some-field").getArray();
String firstValue = (String) values[0]; which can be simplified to: String[] values = (String[]) resultSet.getArray("some-field").getArray();
String firstValue = values[0]; That fixed it. Which is fine for us, but maybe good to know that it was a breaking change. |
It seems to affect enum arrays. I looks like it's now automatically returned like an array of strings instead of a before: Map<String, Object> actionDefault = template.queryForMap("SELECT * FROM ...");
assertThat(actionDefault).containsEntry("action", create("someType", "SOME_VALUE"));
private static PGobject create(String type, String value) {
PGobject pGobject = new PGobject();
pGobject.setType(type);
try {
pGobject.setValue(value);
} catch (SQLException e) {
throw new IllegalArgumentException(e);
}
return pGobject;
} after: Map<String, Object> actionDefault = template.queryForMap("SELECT * FROM ...");
assertThat(actionDefault).containsEntry("action", "SOME_VALUE"); |
Please read https://stackoverflow.com/help/minimal-reproducible-example
Describe the issue
A clear and concise description of what the issue is.
Driver Version?
42.2.23 and 42.2.24
Java Version?
openjdk 15.0.1
OS Version?
Mac OS
PostgreSQL Version?
Postgres 10
Since version
42.2.23
we get this error:maybe it's related to
#2153 or #1949 (not sure though)
Any ideas?
The text was updated successfully, but these errors were encountered: