You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cayenne.apache.org by "Andrus Adamchik (Jira)" <ji...@apache.org> on 2019/10/16 15:49:00 UTC
[jira] [Updated] (CAY-2631) Can no longer use "byte[]" as root of
scalar SQLSelect
[ https://issues.apache.org/jira/browse/CAY-2631?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Andrus Adamchik updated CAY-2631:
---------------------------------
Summary: Can no longer use "byte[]" as root of scalar SQLSelect (was: Ca no longer use "byte[]" as root of scalar SQLSelect)
> Can no longer use "byte[]" as root of scalar SQLSelect
> ------------------------------------------------------
>
> Key: CAY-2631
> URL: https://issues.apache.org/jira/browse/CAY-2631
> Project: Cayenne
> Issue Type: Bug
> Affects Versions: 4.1.RC1
> Environment: MySQL 5.1.x, Cayenne 4.1.RC1
> Reporter: Andrus Adamchik
> Priority: Major
>
> Just switched from 4.0.x to 4.1.RC1. The following query that worked before started printing warnings and throwing an exception:
> {noformat}
> // "bytes"
> byte[] bytes = SQLSelect
> .scalarQuery(byte[].class, "SELECT bytes FROM sometable")
> .selectOne(context);
> {noformat}
> {noformat}
> o.a.c.a.t.SerializableTypeFactory: Haven't found suitable ExtendedType for class 'byte[]'. Most likely you need to define a custom ExtendedType.
> o.a.c.a.t.SerializableTypeFactory: SerializableType will be used for type conversion.
> o.a.c.l.JdbcEventLogger: *** error.
> java.io.StreamCorruptedException: invalid stream header: 79FC63D0
> at java.io.ObjectInputStream.readStreamHeader(ObjectInputStream.java:808)
> at java.io.ObjectInputStream.<init>(ObjectInputStream.java:301)
> at org.apache.cayenne.access.types.SerializableTypeFactory$SerializableType.toJavaObject(SerializableTypeFactory.java:106)
> at org.apache.cayenne.access.types.SerializableTypeFactory$SerializableType.toJavaObject(SerializableTypeFactory.java:70)
> at org.apache.cayenne.access.types.ExtendedTypeDecorator.materializeObject(ExtendedTypeDecorator.java:53)
> at org.apache.cayenne.access.jdbc.reader.ScalarRowReader.readRow(ScalarRowReader.java:50)
> {noformat}
> The cause seems to related to the incorrect class name extraction for "byte[]" class, so extended type lookup is failing.
--
This message was sent by Atlassian Jira
(v8.3.4#803005)