Skip to content


frustrations with tapestry (or is it hivemind?)

Now don’t get me wrong, I really like tapestry in many ways but I have to admit that it is a little frustrating the spottiness of the documentation and here is the biggest beef the way it is scattered all over the place and not cross-referenced!

But also most importantly a lot of knowledge only exists in email archives. The most recent example of this is how to initialize a service that depends on Tapestry’s infrastructure.

I originally tried to use just the HiveMind EagerLoad feature:

  <contribution configuration-id="hivemind.EagerLoad">
    <load service-id="testData"/>
  </contribution>

But I quickly got this error:

java.lang.IllegalStateException: The Infrastructure service has not yet been initialized.
org.apache.tapestry.services.impl.InfrastructureImpl.getProperty(InfrastructureImpl.java:292)
org.apache.tapestry.services.impl.InfrastructureImpl.getApplicationStateManager(InfrastructureImpl.java:116)
$Infrastructure_10de95366c1.getApplicationStateManager($Infrastructure_10de95366c1.java)
$Infrastructure_10de95366c0.getApplicationStateManager($Infrastructure_10de95366c0.java)

This is because Hivemind is running my service initialization before Tapestry is doing it’s initialization. Now as a research point it may be possible to indicate to Hivemind some dependency ordering here, but the hivemind docs can be just as scattered as the tapestry documentation. Because Tapestry 4.x is so dependent on Hivemind it is not always clear where to look on these configuration issues.

Going out the email lists I found that there is a tapestry ‘contribution’ that to make in your hivemodule.xml file that is supposed to work.

  <contribution configuration-id="tapestry.init.ApplicationInitializers">
    <command after="*" id="myInitializer" object="service:testData"/>
  </contribution>

Unfortunately while the tapestry infrastructure is now available there is no WebRequest object for the session to attach to.

java.lang.NullPointerException: Property ‘webRequest’ of <OuterProxy for tapestry.globals.RequestGlobals(org.apache.tapestry.services.RequestGlobals)> is null.
at $WebRequest_10deb12def2._targetServiceProperty($WebRequest_10deb12def2.java)
at $WebRequest_10deb12def2.getSession($WebRequest_10deb12def2.java)
at $WebRequest_10deb12dec3.getSession($WebRequest_10deb12dec3.java)
at $WebRequest_10deb12dec2.getSession($WebRequest_10deb12dec2.java)
at org.apache.tapestry.engine.state.SessionScopeManager.getSession(SessionScopeManager.java:48)
at org.apache.tapestry.engine.state.SessionScopeManager.get(SessionScopeManager.java:64)
at $StateObjectPersistenceManager_10deb12deed.get($StateObjectPersistenceManager_10deb12deed.java)
at $StateObjectPersistenceManager_10deb12deec.get($StateObjectPersistenceManager_10deb12deec.java)
at org.apache.tapestry.engine.state.StateObjectManagerImpl.get(StateObjectManagerImpl.java:50)
at org.apache.tapestry.engine.state.ApplicationStateManagerImpl.get(ApplicationStateManagerImpl.java:60)

So back to email lists..

Posted in amplafi, technical.


0 Responses

Stay in touch with the conversation, subscribe to the RSS feed for comments on this post.



Some HTML is OK

or, reply to this post via trackback.