cayenne-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Nikita Timofeev (Jira)" <j...@apache.org>
Subject [jira] [Updated] (CAY-2631) Can no longer use "byte[]" as root of scalar SQLSelect
Date Thu, 17 Oct 2019 08:27:00 GMT

     [ https://issues.apache.org/jira/browse/CAY-2631?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Nikita Timofeev updated CAY-2631:
---------------------------------
    Fix Version/s: 4.2.M1

> 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: Derby DB (this fails in a test), Cayenne 4.1.RC1
>            Reporter: Andrus Adamchik
>            Assignee: Nikita Timofeev
>            Priority: Major
>             Fix For: 4.1.RC2, 4.2.M1
>
>
> 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)

Mime
View raw message