You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by pickerel yee <pi...@gmail.com> on 2005/09/12 04:03:17 UTC

how to attach a service to an application state object in hivemind.xml?

there's a aso object, i configured it in the hivemind.xml:
    <contribution configuration-id="tapestry.state.ApplicationObjects">
        <state-object name="application" scope="application">
            <create-instance class="adds.web.ApplicationObject"/>
        </state-object>
    </contribution>

it's ok.
now i add a property 'context' to the aso object, and i want to attach
it to the reference of  service tapestry.globals.WebContext,  so i had
to change the hivemind.xml to :
    <service-point id="ApplicationObjectFactory"
interface="org.apache.tapestry.engine.state.StateObjectFactory">
        <invoke-factory>
            <construct class="adds.web.ApplicationObjectFactory">
                <set-object property="context"
                            value="service:tapestry.globals.WebContext"/>
            </construct>
        </invoke-factory>
    </service-point>

    <contribution configuration-id="tapestry.state.ApplicationObjects">
        <state-object name="application" scope="application">
            <invoke-factory object="service:ApplicationObjectFactory"/>
        </state-object>
    </contribution>

now exception be throwed:
Unable to construct service tapestry.state.StateObjectManagerRegistry:
Error building service tapestry.state.StateObjectManagerRegistry:
Error at jar:file:/opt/resin3/webapps/adds/WEB-INF/lib/tapestry-4.0.jar!/META-INF/tapestry.state.xml,
line 186: Unable to initialize service
tapestry.state.StateObjectManagerRegistry (by invoking method
initializeService on
org.apache.tapestry.engine.state.SOMRegistryImpl): Unable to construct
configuration tapestry.state.ApplicationObjects: Element
state-object/invoke-factory (at context:/WEB-INF/hivemodule.xml, line
14) contains errors: Attribute 'object' is required but no value was
provided.

anyone can give me some suggestion?

---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org