Forgot to include one more problem:

When I was trying this out, I was getting the below error due to the
included tag in BlockB.xml

Unable to include block [ComponentContainer] into the containmment model
[/ServiceContainer] because of a repository related error.

Caused by: org.apache.avalon.repository.RepositoryException: Failed to
download artifact to local cache file C:\Documents and
Settings\hsingh4\.maven\repository\BlockA\jars\BlockA.jar from hosts:

It is trying to look up for the particular BlockA as a jar file rather than
an xml file even though I have specified the type as xml in the include tag.
Thus I put the BlockA.xml file in the above required jar file too and tried
but then I was getting the same error as stated in the below mail.
Please let me know how to specify the containment correctly.

Regards,
Harvinder


-----Original Message-----
From: Harvinder Singh [mailto:[EMAIL PROTECTED]
Sent: Thursday, October 28, 2004 11:49 AM
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>

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.

My BlockA.xml looks like :

<container name="ComponentContainer">
<classloader>
....
</classloader>
....components specification.....
</container>

My BlockB.xml looks like :

<container name="ServiceContainer">
<classloader>
....
</classloader>
<include name="ComponentContainer" id="BlockA" type="xml">
....components specification.....
</container>

Now how do i specify the containment of BlockA in BlockB so that my
components in BlockB can look up for components in BlockA.
What I feel is that now the components in BlockB look for the dependent
components in BlockB itself rather than in BlockA.
Am I going the correct way ? Can someone throw some light on this ?

Regards,
Harvinder


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to