-
1. Re: HANamingService IllegalStateException: Must call setClus
starksm64 Oct 14, 2008 12:23 AM (in response to starksm64)Looking at the JBossCacheDistributedTreeManager that is throwing the exception, it is saying that it needs its HAStub property set, but this is not in the hajndi-jboss-beans.xml config:
<!-- Handler for the replicated tree --> <property name="distributedTreeManager"> <bean class="org.jboss.ha.jndi.impl.jbc.JBossCacheDistributedTreeManager"> <property name="clusteredCache"><inject bean="HAPartitionCacheHandler" property="cache"/></property> </bean> </property>
I see the DetachedHANamingService has called setHAStub as part of its startService. It looks like the change to an mcbean for the naming service has broken the lookup of the Naming proxy, although I don't see a related error. -
2. Re: HANamingService IllegalStateException: Must call setClus
starksm64 Oct 14, 2008 12:51 AM (in response to starksm64)Whoops, wrong, its the clusteredCache which is being injected. I guess the HAPartitionCacheHandler has a need to depend on the Naming service as well?
-
3. Re: HANamingService IllegalStateException: Must call setClus
starksm64 Oct 14, 2008 1:03 AM (in response to starksm64)That's not it as that bean is really controlled by the DistributedStateImpl. Adding a naming dependency to it also does not solve the problem. Still trying to navigate the dependency graph to figure out what is not being initialized. Seems like there should be some error prior to this.
-
4. Re: HANamingService IllegalStateException: Must call setClus
starksm64 Oct 14, 2008 2:07 AM (in response to starksm64)Ok, so the dependencies just seem broken/unresolvable and I'm not sure why this would work in general. The problem I see is that:
HAJNDI injects JBossCacheDistributedTreeManager.cache which is injected from HAPartitionCacheHandler.cache
HAPartitionCacheHandler another bean, either DistributedState or HAPartition to initialize its cache by calling acquireCache(), but HAPartitionCacheHandler cannot depend on these because they depend on HAPartitionCacheHandler in order to call methods on it!
What is happening right now is that the JBossCacheDistributedTreeManager.clusteredCache property is being injected from the HAPartitionCacheHandler bean cache property, but the cache property has not been set. The mc is assuming that since the HAPartitionCacheHandler is started, its properties are valid. This is not the case. Adding a dependency to the JBossCacheDistributedTreeManager on HAPartition is not changing when the clusteredCache property is set.
The HAPartitionCacheHandler does not appear to be a valid bean in terms of dependency injection. I'm curious how this works before my reorg of deployments. -
5. Re: HANamingService IllegalStateException: Must call setClus
starksm64 Oct 14, 2008 2:18 AM (in response to starksm64)I created JBAS-6083 for this issue.
-
6. Re: HANamingService IllegalStateException: Must call setClus
brian.stansberry Oct 14, 2008 9:05 AM (in response to starksm64)OK, I'll have a look today and sort this out.
-
7. Re: HANamingService IllegalStateException: Must call setClus
brian.stansberry Oct 14, 2008 9:51 AM (in response to starksm64)Looks like the issue here is JBossCacheDistributedTreeManager should have the HAPartitionCacheHandler injected instead of its cache property. It can then call acquireCache() during the start phase of the HANamingService. The current code works if HAPartition goes through start() before JBossCacheDistributedTreeManager is constructed/has properties injected, which is of course too fragile. I'm assuming your move of stuff out of conf/jboss-service.xml has altered the order in which things occur by allowing a bunch of beans to go through construction/property injection while waiting to go through create/start until the naming service dependency is subsequently satisfied.
This is all a hack to speed startup by allowing HAPartition to start a cache and HAPartition's own core channel in parallel. I've been sorely tempted to make the whole issue go away by reverting DistributedState and HA-JNDI to not use JBoss Cache. Using JBC for these adds a lot of conceptual ugliness for what seems like little benefit.
That's a fairly substantial effort though, so I'll just get the dependencies correct this morning. -
8. Re: HANamingService IllegalStateException: Must call setClus
starksm64 Oct 14, 2008 9:54 AM (in response to starksm64)Using a demand with state Configured on HAPartition as Ales suggested does resolve the issue:
... <!-- Handler for the replicated tree --> <property name="distributedTreeManager"> <bean class="org.jboss.ha.jndi.impl.jbc.JBossCacheDistributedTreeManager"> <property name="clusteredCache"><inject bean="HAPartitionCacheHandle r" property="cache"/></property> <demand state="Configured">HAPartition</demand> </bean> </property>
-
9. Re: HANamingService IllegalStateException: Must call setClus
brian.stansberry Oct 14, 2008 12:00 PM (in response to starksm64)Good to know. That will allow you to proceed.
I'll get a code fix as I described up w/in an hour; as soon as tests run. -
10. Re: HANamingService IllegalStateException: Must call setClus
brian.stansberry Oct 14, 2008 2:55 PM (in response to starksm64)This is done.