cayenne-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Andrus Adamchik (JIRA)" <j...@apache.org>
Subject [jira] [Created] (CAY-2367) ClassCastException reading object with an attribute of type 'char'
Date Sat, 23 Sep 2017 15:01:07 GMT
Andrus Adamchik created CAY-2367:
------------------------------------

             Summary: ClassCastException reading object with an attribute of type 'char' 
                 Key: CAY-2367
                 URL: https://issues.apache.org/jira/browse/CAY-2367
             Project: Cayenne
          Issue Type: Bug
    Affects Versions: 4.1.M1
            Reporter: Andrus Adamchik
            Assignee: Nikita Timofeev


I found this issue when testing 4.1.M1 with LinkRest, but I wouldn't be surprised if it existed
before and was hidden by the generic nature of CayenneDataObject:

DbAttribute: CHAR(1)
ObjAttribute: char

When selecting this object, a warning about ExtendedType is printed, and the exception like
the one below is thrown:

{noformat}
[main] WARN org.apache.cayenne.access.types.SerializableTypeFactory - Haven't found suitable
ExtendedType for class 'char'. Most likely you need to define a custom ExtendedType.
[main] INFO org.apache.cayenne.log.JdbcEventLogger - === returned 1 row. - took 17 ms.
[main] INFO org.apache.cayenne.log.JdbcEventLogger - +++ transaction committed.
[main] WARN com.nhl.link.rest.provider.CayenneRuntimeExceptionMapper - Cayenne exception
org.apache.cayenne.reflect.PropertyException: [v.4.1.M1 Sep 22 2017 12:43:32] Error writing
DataObject property: charPrimitive
	at org.apache.cayenne.reflect.generic.DataObjectBaseProperty.writePropertyDirectly(DataObjectBaseProperty.java:88)
	at org.apache.cayenne.access.DataRowUtils$1.visitAttribute(DataRowUtils.java:93)
	at org.apache.cayenne.reflect.generic.DataObjectAttributeProperty.visit(DataObjectAttributeProperty.java:50)
	at org.apache.cayenne.reflect.PersistentDescriptor.visitProperties(PersistentDescriptor.java:400)
	at org.apache.cayenne.reflect.LazyClassDescriptorDecorator.visitProperties(LazyClassDescriptorDecorator.java:174)
	at org.apache.cayenne.access.DataRowUtils.refreshObjectWithSnapshot(DataRowUtils.java:86)
	at org.apache.cayenne.access.DataRowUtils.mergeObjectWithSnapshot(DataRowUtils.java:62)
	at org.apache.cayenne.access.ObjectResolver.objectFromDataRow(ObjectResolver.java:170)
	at org.apache.cayenne.access.ObjectResolver.objectFromDataRow(ObjectResolver.java:134)
	at org.apache.cayenne.access.ObjectResolver.objectsFromDataRows(ObjectResolver.java:119)
	at org.apache.cayenne.access.ObjectResolver.synchronizedObjectsFromDataRows(ObjectResolver.java:99)
	at org.apache.cayenne.access.ObjectResolver.synchronizedRootResultNodeFromDataRows(ObjectResolver.java:90)
	at org.apache.cayenne.access.DataDomainQueryAction$ObjectConversionStrategy.toResultsTree(DataDomainQueryAction.java:637)
	at org.apache.cayenne.access.DataDomainQueryAction$SingleObjectConversionStrategy.convert(DataDomainQueryAction.java:687)
	at org.apache.cayenne.access.DataDomainQueryAction.interceptObjectConversion(DataDomainQueryAction.java:501)
	at org.apache.cayenne.access.DataDomainQueryAction.execute(DataDomainQueryAction.java:130)
	at org.apache.cayenne.access.DataDomain.onQueryNoFilters(DataDomain.java:564)
	at org.apache.cayenne.access.DataDomain$DataDomainQueryFilterChain.onQuery(DataDomain.java:748)
	at org.apache.cayenne.tx.TransactionFilter.onQuery(TransactionFilter.java:49)
	at org.apache.cayenne.access.DataDomain$DataDomainQueryFilterChain.onQuery(DataDomain.java:748)
	at com.nhl.link.rest.it.fixture.DynamicModelLoader.onQuery(DynamicModelLoader.java:39)
	at org.apache.cayenne.access.DataDomain$DataDomainQueryFilterChain.onQuery(DataDomain.java:748)
	at org.apache.cayenne.access.DataDomain.onQuery(DataDomain.java:556)
	at org.apache.cayenne.util.ObjectContextQueryAction.runQuery(ObjectContextQueryAction.java:406)
	at org.apache.cayenne.util.ObjectContextQueryAction.executePostCache(ObjectContextQueryAction.java:107)
	at org.apache.cayenne.util.ObjectContextQueryAction.execute(ObjectContextQueryAction.java:94)
	at org.apache.cayenne.access.DataContext.onQuery(DataContext.java:965)
	at org.apache.cayenne.access.DataContext.performQuery(DataContext.java:954)
	at org.apache.cayenne.BaseContext.select(BaseContext.java:307)
Caused by: java.lang.ClassCastException: java.lang.String cannot be cast to java.lang.Character
	at com.nhl.link.rest.it.fixture.cayenne.auto._E19.writePropertyDirectly(_E19.java:405)
	at org.apache.cayenne.reflect.generic.DataObjectBaseProperty.writePropertyDirectly(DataObjectBaseProperty.java:84)
	... 95 more
{noformat}



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

Mime
View raw message