awake calls appendToResponse?!? and inheritance wackiness

Zak Burke <[email protected]>
Newsgroups gmane.comp.web.webobjects.devel
Message-ID <[email protected]>
I am encountering some weirdness with my template system where my
development and server machines are handling things differently. The
only difference between the machines is that on is 10.4.7 client and one
is 10.4.7 server.

I have the following inheritance hierarchy:

WOComponent < Template < CmsContentPage

Template calls chrome() in awake(); CmsContentPage overrides chrome but
does nothing in awake except clear a boolean and call super.awake(). The
weird part is that Template.chrome() and CmsContentPage.chrome() are
both being called. My development box seems to keep the bindings that
are set by CmsContentPage.chrome() but my server keeps the values from
Template.chrome().

When I throw/catch a RuntimeException in chrome just to trace the call
hierarchy, the results for the first call are as expected, but the
second call shows that Template.awake() is being called down the line
from CmsContentPage.appendToResponse(). Wha...?

My main concern is why both methods are called. The fact that two
similar boxes render the output so differently is troubling, but may be
just an artifact of the other problem.

Thanks for any insights,

zak.


Here is the stacktrace I'm not expecting:

DEBUG [2006-10-05 11:04:12,339] (Template.java:117) -
java.lang.RuntimeException
at org.thei3p.pages.templates.Template.chrome(Template.java:116)
at org.thei3p.pages.templates.Template.awake(Template.java:101)
at
com.webobjects.appserver.WOComponent._awakeInContext(WOComponent.java:862)
at
com.webobjects.appserver._private.WOComponentReference._pushComponentInContext(WOComponentReference.java:80)
at
com.webobjects.appserver._private.WOComponentReference.appendToResponse(WOComponentReference.java:110)
at
com.webobjects.appserver._private.WODynamicGroup.appendChildrenToResponse(WODynamicGroup.java:121)
at
com.webobjects.appserver._private.WODynamicGroup.appendToResponse(WODynamicGroup.java:130)
at
com.webobjects.appserver.WOComponent.appendToResponse(WOComponent.java:992)
at
org.thei3p.pages.cms.CmsContentPage.appendToResponse(CmsContentPage.java:100)
at
com.webobjects.appserver.WOComponent._appendPageToResponse(WOComponent.java:1388)
at
com.webobjects.appserver.WOComponent._generateResponseInContext(WOComponent.java:1356)
at
com.webobjects.appserver.WOComponent.generateResponse(WOComponent.java:1351)
at
com.webobjects.appserver._private.WOActionRequestHandler._handleRequest(WOActionRequestHandler.java:259)
at
com.webobjects.appserver._private.WOActionRequestHandler.handleRequest(WOActionRequestHandler.java:145)
at
com.webobjects.appserver.WOApplication.dispatchRequest(WOApplication.java:1306)
at org.thei3p.Application.dispatchRequest(Application.java:168)
at
com.webobjects.appserver._private.WOWorkerThread.runOnce(WOWorkerThread.java:173)
at
com.webobjects.appserver._private.WOWorkerThread.run(WOWorkerThread.java:254)
at java.lang.Thread.run(Thread.java:552)


and here is the one that happens first, as expected:

DEBUG [2006-10-05 11:04:12,207] (CmsContentPage.java:161) -
java.lang.RuntimeException
at org.thei3p.pages.cms.CmsContentPage.chrome(CmsContentPage.java:160)
at org.thei3p.pages.templates.Template.awake(Template.java:101)
at org.thei3p.pages.cms.CmsContentPage.awake(CmsContentPage.java:141)
at
com.webobjects.appserver.WOComponent._awakeInContext(WOComponent.java:862)
at
com.webobjects.appserver.WOApplication.pageWithName(WOApplication.java:1962)
at com.webobjects.appserver.WOAction.pageWithName(WOAction.java:98)
at org.thei3p.DirectAction.performActionNamed(DirectAction.java:199)
at
com.webobjects.appserver._private.WOActionRequestHandler._handleRequest(WOActionRequestHandler.java:240)
at
com.webobjects.appserver._private.WOActionRequestHandler.handleRequest(WOActionRequestHandler.java:145)
at
com.webobjects.appserver.WOApplication.dispatchRequest(WOApplication.java:1306)
at org.thei3p.Application.dispatchRequest(Application.java:168)
at
com.webobjects.appserver._private.WOWorkerThread.runOnce(WOWorkerThread.java:173)
at
com.webobjects.appserver._private.WOWorkerThread.run(WOWorkerThread.java:254)
at java.lang.Thread.run(Thread.java:552)
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.