cayenne-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "John Huss (JIRA)" <j...@apache.org>
Subject [jira] [Created] (CAY-1941) Crypto - class cast exception when using java.lang.String with VARBINARY column
Date Thu, 07 Aug 2014 19:45:14 GMT
John Huss created CAY-1941:
------------------------------

             Summary: Crypto - class cast exception when using java.lang.String with VARBINARY
column
                 Key: CAY-1941
                 URL: https://issues.apache.org/jira/browse/CAY-1941
             Project: Cayenne
          Issue Type: Bug
          Components: Core Library
    Affects Versions: 3.2M1
         Environment: Commit 9eb1f32305ff6d232ae938ea91a9eeed9c9ed584
            Reporter: John Huss


When using the cayenne-crypto module with a VARBINARY column mapped to a java.lang.String
attribute, a class cast exception is thrown because the jdbc data is deserialized as a String
when it was expected to be a byte[].

java.lang.ClassCastException: java.lang.String cannot be cast to [B
	at org.apache.cayenne.crypto.transformer.value.BytesToBytesConverter.toBytes(BytesToBytesConverter.java:30)
	at org.apache.cayenne.crypto.transformer.value.DefaultValueDecryptor.decrypt(DefaultValueDecryptor.java:50)
	at org.apache.cayenne.crypto.transformer.DefaultMapTransformer.transform(DefaultMapTransformer.java:50)
	at org.apache.cayenne.crypto.reader.CryptoRowReaderFactoryDecorator$1.readRow(CryptoRowReaderFactoryDecorator.java:75)
	at org.apache.cayenne.access.jdbc.JDBCResultIterator.nextRow(JDBCResultIterator.java:104)
	at org.apache.cayenne.access.jdbc.JDBCResultIterator.allRows(JDBCResultIterator.java:80)
	at org.apache.cayenne.access.jdbc.SelectAction.performAction(SelectAction.java:181)
	at org.apache.cayenne.access.DataNodeQueryAction.runQuery(DataNodeQueryAction.java:97)
	at org.apache.cayenne.access.DataNode.performQueries(DataNode.java:293)
	at org.apache.cayenne.access.DataDomainQueryAction.runQuery(DataDomainQueryAction.java:438)
	at org.apache.cayenne.access.DataDomainQueryAction.access$0(DataDomainQueryAction.java:417)
	at org.apache.cayenne.access.DataDomainQueryAction$2.transform(DataDomainQueryAction.java:411)
	at org.apache.cayenne.access.DataDomain.runInTransaction(DataDomain.java:720)
	at org.apache.cayenne.access.DataDomainQueryAction.runQueryInTransaction(DataDomainQueryAction.java:407)
	at org.apache.cayenne.access.DataDomainQueryAction.execute(DataDomainQueryAction.java:121)
	at org.apache.cayenne.access.DataDomain.onQueryNoFilters(DataDomain.java:610)
	at org.apache.cayenne.access.DataDomain$DataDomainQueryFilterChain.onQuery(DataDomain.java:847)
	at org.apache.cayenne.access.DataDomain.onQuery(DataDomain.java:602)
	at org.apache.cayenne.util.ObjectContextQueryAction.runQuery(ObjectContextQueryAction.java:350)
	at org.apache.cayenne.util.ObjectContextQueryAction.executePostCache(ObjectContextQueryAction.java:106)
	at org.apache.cayenne.util.ObjectContextQueryAction.execute(ObjectContextQueryAction.java:93)
	at org.apache.cayenne.access.DataContext.onQuery(DataContext.java:968)
	at org.apache.cayenne.access.DataContext.performQuery(DataContext.java:957)
	at org.apache.cayenne.BaseContext.select(BaseContext.java:302)
	at org.apache.cayenne.tutorial.Main.main(Main.java:50)



--
This message was sent by Atlassian JIRA
(v6.2#6252)

Mime
View raw message