Thanks Stephen !! I tried adding block A and then block B, and then commisioning the root container. In my root container , I had entries for both blocks A and B. I even included BlockA within BlockB, but that did not help either. Renaming the .xml to .block did not produce success also.
I took a look at the composition example . In that, the application container has included blocks of "location" and "publisher" and the way Merlin behaves is, it installs application container and then the other two containers, and then commissions the application container which in turn commissions the other two containers. In my case, as was already discussed with Niclas,in earlier thread, http://www.mail-archive.com/users%40avalon.apache.org/msg04997.html I had to initialize the kernel with an empty container and then add the containment blocks to the container. When I do this, the empty container gets initialized and commissioned first. Then the block A gets initialzed and commissioned and when block B tries to initialize, since it is depending upon components in Block A, it fails to assemble the component due to unavailable dependencies. I am having the entry for BlockA within BlockB, but that does not help.. Can some one please tell me how can I break this deadlock?? I already have seen the composition tutorial and it is not of much help to me. Regards, Harvinder -----Original Message----- From: Stephen McConnell [mailto:[EMAIL PROTECTED] Sent: Friday, October 29, 2004 5:12 AM To: 'Avalon framework users'; [EMAIL PROTECTED] Subject: RE: Problem in Block composition > -----Original Message----- > From: Harvinder Singh [mailto:[EMAIL PROTECTED] > Sent: 28 October 2004 18:49 > To: Avalon framework users > Subject: Problem in Block composition > > Hi All, > > I am facing a problem regarding block composition. > I have 3 blocks, an empty block.xml, BlockA.xml and BlockB.xml having the > entries of some components. > I am embedding Merlin and instantiating the kernel with an empty > block.xml, > which just has the following entry: > > <container name="XXX"> > </container> Just for reference - a container declaration in the kernel is the root container and if you don't include any container definition you will get the same as what you are declaring above by default. > Once my kerlnel gets initialized properly, I then add a containment model > like : > > URL blockUrl = new URL("location of BlockA.xml"); > ContainmentModel ContainerA = > ((ContainmentModel)m_root).addContainmentModel(blockUrl); > ContainerA.commission(); > > blockUrl = new URL("location of BlockB.xml"); > ContainmentModel ContainerB = > ((ContainmentModel)m_root).addContainmentModel(blockUrl); > ContainerB.commission(); > > Now my containerA gets commissioned properly but containerB does not get > commisioned since it is having some components which are dependent upon > components present in containerA. It gives me an error : > Unable to assemble component: [/ServiceContainer/ComponentX] due to a > service provider establishment failure. What you should be doing is add BlockA, then add Block B, then commission the root container. Cheers, Steve. --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]