Another strange ClassCastException

From: Michael Schuldt (m..scensys.de)
Date: Mon Nov 17 2003 - 11:07:05 EST

  • Next message: Andrus Adamchik: "Re: Another strange ClassCastException"

    The earlier ClassCastException is now history by using cayenne 1.03. That's
    great.

    But now I've got another one, giving the following output:

    org.objectstyle.cayenne.CayenneRuntimeException: [v.1.0.3 November 16 2003]
    Global exception.
            at
    org.objectstyle.cayenne.access.util.SelectObserver.nextGlobalException(Selec
    tObserver.java:156)
            at
    org.objectstyle.cayenne.access.DataNode.performQueries(DataNode.java:349)
            at
    org.objectstyle.cayenne.access.DataDomain.performQueries(DataDomain.java:466
    )
            at
    org.objectstyle.cayenne.access.DataContext.performQueries(DataContext.java:8
    63)
            at
    org.objectstyle.cayenne.access.DataContext.performQuery(DataContext.java:915
    )
            at
    org.objectstyle.cayenne.access.DataContext.performQuery(DataContext.java:793
    )
            at
    org.objectstyle.cayenne.access.util.RelationshipDataSource.updateListData(Re
    lationshipDataSource.java:97)
            at
    org.objectstyle.cayenne.access.ToManyList.getObjectList(ToManyList.java:120)
            at org.objectstyle.cayenne.access.ToManyList.add(ToManyList.java:128)
            at
    org.objectstyle.cayenne.CayenneDataObject.addToManyTarget(CayenneDataObject.
    java:309)
            at
    org.objectstyle.cayenne.CayenneDataObject.setReverseRelationship(CayenneData
    Object.java:378)
            at
    org.objectstyle.cayenne.CayenneDataObject.setToOneTarget(CayenneDataObject.j
    ava:349)
            at de.best4rest.boerse._TbAngebot.setBelongsToUser(_TbAngebot.java:455)
            at
    de.best4rest.boerse.ProduktEinstellenAction.perform(ProduktEinstellenAction.
    java:437)
            at
    org.apache.struts.action.ActionServlet.processActionPerform(ActionServlet.ja
    va:1787)
            at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1586)
            at org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:492)
            at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
            at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
            at
    org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Application
    FilterChain.java:247)
            at
    org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterCh
    ain.java:193)
            at de.best4rest.boerse.SendMailFilter.doFilter(SendMailFilter.java:81)
            at
    org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Application
    FilterChain.java:213)
            at
    org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterCh
    ain.java:193)
            at de.best4rest.boerse.WerbungFilter.doFilter(WerbungFilter.java:183)
            at
    org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Application
    FilterChain.java:213)
            at
    org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterCh
    ain.java:193)
            at de.best4rest.boerse.UtilFilter.doFilter(UtilFilter.java:513)
            at
    org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Application
    FilterChain.java:213)
            at
    org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterCh
    ain.java:193)
            at
    de.best4rest.boerse.LogRequestParameterFilter.doFilter(LogRequestParameterFi
    lter.java:74)
            at
    org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Application
    FilterChain.java:213)
            at
    org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterCh
    ain.java:193)
            at
    org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.ja
    va:256)
            at
    org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invok
    eNext(StandardPipeline.java:643)
            at
    org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
            at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
            at
    org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.ja
    va:191)
            at
    org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invok
    eNext(StandardPipeline.java:643)
            at
    org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase
    .java:553)
            at
    org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invok
    eNext(StandardPipeline.java:641)
            at
    org.apache.catalina.valves.CertificatesValve.invoke(CertificatesValve.java:2
    46)
            at
    org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invok
    eNext(StandardPipeline.java:641)
            at
    org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
            at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
            at
    org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2408)
            at
    org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:180
    )
            at
    org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invok
    eNext(StandardPipeline.java:643)
            at
    org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.
    java:171)
            at
    org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invok
    eNext(StandardPipeline.java:641)
            at
    org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:172
    )
            at
    org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invok
    eNext(StandardPipeline.java:641)
            at
    org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
            at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
            at
    org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java
    :174)
            at
    org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invok
    eNext(StandardPipeline.java:643)
            at
    org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
            at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
            at org.apache.coyote.tomcat4.CoyoteAdapter.service(CoyoteAdapter.java:223)
            at
    org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:601)
            at
    org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConne
    ction(Http11Protocol.java:392)
            at
    org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:565)
            at
    org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.jav
    a:619)
            at java.lang.Thread.run(Thread.java:536)
    Caused by: java.lang.ClassCastException
            at
    org.objectstyle.cayenne.access.SnapshotManager.isToOneTargetModified(Snapsho
    tManager.java:313)
            at
    org.objectstyle.cayenne.access.SnapshotManager.mergeObjectWithSnapshot(Snaps
    hotManager.java:246)
            at
    org.objectstyle.cayenne.access.DataContext.objectFromDataRow(DataContext.jav
    a:335)
            at
    org.objectstyle.cayenne.access.util.ContextSelectObserver.nextDataRows(Conte
    xtSelectObserver.java:115)
            at org.objectstyle.cayenne.access.DataNode.runSelect(DataNode.java:401)
            at
    org.objectstyle.cayenne.access.DataNode.performQueries(DataNode.java:281)
            ... 62 more

    Maybe the structure of my objects is important for this so I'm enclosing the
    important part of the xml-file.

    And here's the part of the code creating the error:

    -------
    .
    .
    .
    TbAngebot aAngebot = (TbAngebot) ctxt.createAndRegisterNewObject
    ("TbAngebot");

    aAngebot.setReaktiviertVonAlt(altesAngebot); // where altesAngebot is an
    already existing Object of Type TbAngebot earlier read through the
    DataContext ctxt

    aAngebot.setBelongsToUser (aBrUser); // where aBrUser is an already existing
    Object of Type BrUsers earlier read through the DataConext ctxt
    ---------------------

    And the last statement will cause the error. But if I remove the line
    "aAngebot.setReaktiviertVonAlt(altesAngebot);" everything works fine. But to
    me this one is necessary, because I need the relation from an old TbAngebot
    to a new one!

    What can it be?

    Thanks in advance

    Michael





    This archive was generated by hypermail 2.0.0 : Mon Nov 17 2003 - 11:07:25 EST