Skip to content

Instantly share code, notes, and snippets.

@hugith
Created Sep 22, 2015
Embed
What would you like to do?
java.lang.ClassCastException: org.apache.cayenne.map.DefaultScalarResultSegment cannot be cast to org.apache.cayenne.query.EntityResultSegment
at org.apache.cayenne.access.translator.ejbql.EJBQLTranslationContext.nextEntityResult(EJBQLTranslationContext.java:444)
at org.apache.cayenne.access.translator.ejbql.EJBQLSelectColumnsTranslator$1.processTerminatingRelationship(EJBQLSelectColumnsTranslator.java:81)
at org.apache.cayenne.access.translator.ejbql.EJBQLPathTranslator.processLastPathComponent(EJBQLPathTranslator.java:175)
at org.apache.cayenne.access.translator.ejbql.EJBQLPathTranslator.visitPath(EJBQLPathTranslator.java:73)
at org.apache.cayenne.ejbql.parser.EJBQLPath.visitChild(EJBQLPath.java:71)
at org.apache.cayenne.ejbql.parser.SimpleNode.visit(SimpleNode.java:63)
at org.apache.cayenne.access.translator.ejbql.EJBQLSelectColumnsTranslator.visitPath(EJBQLSelectColumnsTranslator.java:151)
at org.apache.cayenne.ejbql.parser.EJBQLPath.visitNode(EJBQLPath.java:66)
at org.apache.cayenne.ejbql.parser.SimpleNode.visit(SimpleNode.java:59)
at org.apache.cayenne.ejbql.parser.SimpleNode.visitChild(SimpleNode.java:83)
at org.apache.cayenne.ejbql.parser.SimpleNode.visit(SimpleNode.java:63)
at org.apache.cayenne.ejbql.parser.SimpleNode.visitChild(SimpleNode.java:83)
at org.apache.cayenne.ejbql.parser.SimpleNode.visit(SimpleNode.java:63)
at org.apache.cayenne.access.translator.ejbql.EJBQLSelectTranslator.visitSelectExpressions(EJBQLSelectTranslator.java:99)
at org.apache.cayenne.ejbql.parser.EJBQLSelectExpressions.visitNode(EJBQLSelectExpressions.java:34)
at org.apache.cayenne.ejbql.parser.SimpleNode.visit(SimpleNode.java:59)
at org.apache.cayenne.ejbql.parser.SimpleNode.visitChild(SimpleNode.java:83)
at org.apache.cayenne.ejbql.parser.SimpleNode.visit(SimpleNode.java:63)
at org.apache.cayenne.ejbql.parser.SimpleNode.visitChild(SimpleNode.java:83)
at org.apache.cayenne.ejbql.parser.SimpleNode.visit(SimpleNode.java:63)
at org.apache.cayenne.access.jdbc.EJBQLAction$1.visitSelect(EJBQLAction.java:66)
at org.apache.cayenne.ejbql.parser.EJBQLSelect.visitNode(EJBQLSelect.java:34)
at org.apache.cayenne.ejbql.parser.SimpleNode.visit(SimpleNode.java:59)
at org.apache.cayenne.access.jdbc.EJBQLAction.performAction(EJBQLAction.java:61)
at org.apache.cayenne.access.DataNodeQueryAction.runQuery(DataNodeQueryAction.java:97)
at org.apache.cayenne.access.DataNode.performQueries(DataNode.java:302)
at org.apache.cayenne.access.DataDomainQueryAction.runQuery(DataDomainQueryAction.java:439)
at org.apache.cayenne.access.DataDomainQueryAction.access$000(DataDomainQueryAction.java:71)
at org.apache.cayenne.access.DataDomainQueryAction$2.perform(DataDomainQueryAction.java:412)
at org.apache.cayenne.tx.DefaultTransactionManager.performInTransaction(DefaultTransactionManager.java:53)
at org.apache.cayenne.access.DataDomainQueryAction.runQueryInTransaction(DataDomainQueryAction.java:409)
at org.apache.cayenne.access.DataDomainQueryAction.execute(DataDomainQueryAction.java:121)
at org.apache.cayenne.access.DataDomain.onQueryNoFilters(DataDomain.java:560)
at org.apache.cayenne.access.DataDomain$DataDomainQueryFilterChain.onQuery(DataDomain.java:744)
at org.apache.cayenne.access.DataDomain.onQuery(DataDomain.java:552)
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:985)
at org.apache.cayenne.access.DataContext.performQuery(DataContext.java:974)
at strimillinn.temp.DistinctTest.main(DistinctTest.java:16)
Exception in thread "main" org.apache.cayenne.CayenneRuntimeException: [v.4.0.M2 Feb 26 2015 08:16:32] Query exception.
at org.apache.cayenne.access.DataDomainQueryAction.nextQueryException(DataDomainQueryAction.java:582)
at org.apache.cayenne.access.DataNode.performQueries(DataNode.java:308)
at org.apache.cayenne.access.DataDomainQueryAction.runQuery(DataDomainQueryAction.java:439)
at org.apache.cayenne.access.DataDomainQueryAction.access$000(DataDomainQueryAction.java:71)
at org.apache.cayenne.access.DataDomainQueryAction$2.perform(DataDomainQueryAction.java:412)
at org.apache.cayenne.tx.DefaultTransactionManager.performInTransaction(DefaultTransactionManager.java:53)
at org.apache.cayenne.access.DataDomainQueryAction.runQueryInTransaction(DataDomainQueryAction.java:409)
at org.apache.cayenne.access.DataDomainQueryAction.execute(DataDomainQueryAction.java:121)
at org.apache.cayenne.access.DataDomain.onQueryNoFilters(DataDomain.java:560)
at org.apache.cayenne.access.DataDomain$DataDomainQueryFilterChain.onQuery(DataDomain.java:744)
at org.apache.cayenne.access.DataDomain.onQuery(DataDomain.java:552)
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:985)
at org.apache.cayenne.access.DataContext.performQuery(DataContext.java:974)
at strimillinn.temp.DistinctTest.main(DistinctTest.java:16)
Caused by: java.lang.ClassCastException: org.apache.cayenne.map.DefaultScalarResultSegment cannot be cast to org.apache.cayenne.query.EntityResultSegment
at org.apache.cayenne.access.translator.ejbql.EJBQLTranslationContext.nextEntityResult(EJBQLTranslationContext.java:444)
at org.apache.cayenne.access.translator.ejbql.EJBQLSelectColumnsTranslator$1.processTerminatingRelationship(EJBQLSelectColumnsTranslator.java:81)
at org.apache.cayenne.access.translator.ejbql.EJBQLPathTranslator.processLastPathComponent(EJBQLPathTranslator.java:175)
at org.apache.cayenne.access.translator.ejbql.EJBQLPathTranslator.visitPath(EJBQLPathTranslator.java:73)
at org.apache.cayenne.ejbql.parser.EJBQLPath.visitChild(EJBQLPath.java:71)
at org.apache.cayenne.ejbql.parser.SimpleNode.visit(SimpleNode.java:63)
at org.apache.cayenne.access.translator.ejbql.EJBQLSelectColumnsTranslator.visitPath(EJBQLSelectColumnsTranslator.java:151)
at org.apache.cayenne.ejbql.parser.EJBQLPath.visitNode(EJBQLPath.java:66)
at org.apache.cayenne.ejbql.parser.SimpleNode.visit(SimpleNode.java:59)
at org.apache.cayenne.ejbql.parser.SimpleNode.visitChild(SimpleNode.java:83)
at org.apache.cayenne.ejbql.parser.SimpleNode.visit(SimpleNode.java:63)
at org.apache.cayenne.ejbql.parser.SimpleNode.visitChild(SimpleNode.java:83)
at org.apache.cayenne.ejbql.parser.SimpleNode.visit(SimpleNode.java:63)
at org.apache.cayenne.access.translator.ejbql.EJBQLSelectTranslator.visitSelectExpressions(EJBQLSelectTranslator.java:99)
at org.apache.cayenne.ejbql.parser.EJBQLSelectExpressions.visitNode(EJBQLSelectExpressions.java:34)
at org.apache.cayenne.ejbql.parser.SimpleNode.visit(SimpleNode.java:59)
at org.apache.cayenne.ejbql.parser.SimpleNode.visitChild(SimpleNode.java:83)
at org.apache.cayenne.ejbql.parser.SimpleNode.visit(SimpleNode.java:63)
at org.apache.cayenne.ejbql.parser.SimpleNode.visitChild(SimpleNode.java:83)
at org.apache.cayenne.ejbql.parser.SimpleNode.visit(SimpleNode.java:63)
at org.apache.cayenne.access.jdbc.EJBQLAction$1.visitSelect(EJBQLAction.java:66)
at org.apache.cayenne.ejbql.parser.EJBQLSelect.visitNode(EJBQLSelect.java:34)
at org.apache.cayenne.ejbql.parser.SimpleNode.visit(SimpleNode.java:59)
at org.apache.cayenne.access.jdbc.EJBQLAction.performAction(EJBQLAction.java:61)
at org.apache.cayenne.access.DataNodeQueryAction.runQuery(DataNodeQueryAction.java:97)
at org.apache.cayenne.access.DataNode.performQueries(DataNode.java:302)
... 15 more
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment