[
Date Prev][
Date Next][
Thread Prev][
Thread Next][
Date Index][
Thread Index]
[
List Home]
Re: [eclipselink-users] ClassCastException when exeuting query
|
Hello James,
is there a work-around?
Do You know what causes the bug "to bite"?
Is it the combination of hints, we're using?
- Michael
James Sutherland schrieb:
> This is a bug in the triggerJoinExpressions() method, please log a bug for
> this.
>
>
> Michael Simons wrote:
>> Hello,
>>
>> When executing the query
>> Query query = getEntityManager ().createQuery ("SELECT DISTINCT x FROM
>> Trip x WHERE
>> x.plan.exportId = :exportId"); //$NON-NLS-1$
>> query.setParameter ("exportId", exportId); //$NON-NLS-1$
>> query.setHint (QueryHints.LEFT_FETCH, "x.events");
>> query.setHint (QueryHints.REFRESH, true);
>>
>> we sometimes get the following ClassCastException.
>>
>> Does anybody have an idea what might be the reason?
>> Might this be a bug in EL?
>>
>> Kind Regards, Michael
>>
>>
>>
>>
>> de.optitool.ext.imp.pcs.actual.ImportFailedException: java.util.ArrayList
>> cannot be cast to org.eclipse.persistence.indirection.IndirectContainer
>> at
>> de.optitool.ext.imp.pcs.actual.ActualDataService.work(ActualDataService.java
>> :324)
>> at
>> de.optitool.console.ConsoleApplication.run(ConsoleApplication.java:203)
>> at
>> de.optitool.console.GenericConsoleApplication.run(GenericConsoleApplication.
>> java:298)
>> at
>> de.optitool.ext.imp.pcs.actual.ActualDataService.main(ActualDataService.java
>> :1412)
>> Caused by: java.lang.ClassCastException: java.util.ArrayList cannot be
>> cast
>> to org.eclipse.persistence.indirection.IndirectContainer
>> at
>> org.eclipse.persistence.queries.ObjectBuildingQuery.triggerJoinExpressions(O
>> bjectBuildingQuery.java:414)
>> at
>> org.eclipse.persistence.queries.ObjectBuildingQuery.registerIndividualResult
>> (ObjectBuildingQuery.java:392)
>> at
>> org.eclipse.persistence.internal.descriptors.ObjectBuilder.buildWorkingCopyC
>> loneNormally(ObjectBuilder.java:588)
>> at
>> org.eclipse.persistence.internal.descriptors.ObjectBuilder.buildObjectInUnit
>> OfWork(ObjectBuilder.java:549)
>> at
>> org.eclipse.persistence.internal.descriptors.ObjectBuilder.buildObject(Objec
>> tBuilder.java:489)
>> at
>> org.eclipse.persistence.internal.descriptors.ObjectBuilder.buildObject(Objec
>> tBuilder.java:441)
>> at
>> org.eclipse.persistence.queries.ObjectLevelReadQuery.buildObject(ObjectLevel
>> ReadQuery.java:635)
>> at
>> org.eclipse.persistence.queries.ReadAllQuery.registerResultInUnitOfWork(Read
>> AllQuery.java:838)
>> at
>> org.eclipse.persistence.queries.ReadAllQuery.executeObjectLevelReadQuery(Rea
>> dAllQuery.java:464)
>> at
>> org.eclipse.persistence.queries.ObjectLevelReadQuery.executeDatabaseQuery(Ob
>> jectLevelReadQuery.java:997)
>> at
>> org.eclipse.persistence.queries.DatabaseQuery.execute(DatabaseQuery.java:675
>> )
>> at
>> org.eclipse.persistence.queries.ObjectLevelReadQuery.execute(ObjectLevelRead
>> Query.java:958)
>> at
>> org.eclipse.persistence.queries.ReadAllQuery.execute(ReadAllQuery.java:432)
>> at
>> org.eclipse.persistence.queries.ObjectLevelReadQuery.executeInUnitOfWork(Obj
>> ectLevelReadQuery.java:1021)
>> at
>> org.eclipse.persistence.internal.sessions.UnitOfWorkImpl.internalExecuteQuer
>> y(UnitOfWorkImpl.java:2863)
>> at
>> org.eclipse.persistence.internal.sessions.AbstractSession.executeQuery(Abstr
>> actSession.java:1225)
>> at
>> org.eclipse.persistence.internal.sessions.AbstractSession.executeQuery(Abstr
>> actSession.java:1207)
>> at
>> org.eclipse.persistence.internal.sessions.AbstractSession.executeQuery(Abstr
>> actSession.java:1181)
>> at
>> org.eclipse.persistence.internal.jpa.EJBQueryImpl.executeReadQuery(EJBQueryI
>> mpl.java:453)
>> at
>> org.eclipse.persistence.internal.jpa.EJBQueryImpl.getSingleResult(EJBQueryIm
>> pl.java:702)
>> at
>> de.optitool.consumer.GPSConsumer.retrieveTripOfTourWithExportIdEager(GPSCons
>> umer.java:144)
>> at de.optitool.consumer.GPSConsumer.getTrip(GPSConsumer.java:117)
>> at
>> de.optitool.ext.imp.pcs.actual.ActualDataService.process(ActualDataService.j
>> ava:1223)
>> at
>> de.optitool.ext.imp.pcs.actual.ActualDataService.createActualPositionData(Ac
>> tualDataService.java:435)
>> at
>> de.optitool.ext.imp.pcs.actual.ActualDataService.retrieveData(ActualDataServ
>> ice.java:396)
>> at
>> de.optitool.ext.imp.pcs.actual.ActualDataService.retrieveDataFromBytes(Actua
>> lDataService.java:1357)
>> at
>> de.optitool.ext.imp.pcs.actual.ActualDataService.work(ActualDataService.java
>> :318)
>> ... 3 more
>>
>> _______________________________________________
>> eclipselink-users mailing list
>> eclipselink-users@xxxxxxxxxxx
>> https://dev.eclipse.org/mailman/listinfo/eclipselink-users
>>
>>
>
>
> -----
> http://wiki.eclipse.org/User:James.sutherland.oracle.com James Sutherland
> http://www.eclipse.org/eclipselink/
> EclipseLink , http://www.oracle.com/technology/products/ias/toplink/
> TopLink
> Wiki: http://wiki.eclipse.org/EclipseLink EclipseLink ,
> http://wiki.oracle.com/page/TopLink TopLink
> Forums: http://forums.oracle.com/forums/forum.jspa?forumID=48 TopLink ,
> http://www.nabble.com/EclipseLink-f26430.html EclipseLink
> Book: http://en.wikibooks.org/wiki/Java_Persistence Java Persistence