hi stephen,
the "bin/BLOCK-INF/block.xml" looks like:
<container name='econ'>
<classloader>
<classpath>
<repository>
<resource id="avalon-framework:avalon-framework-impl" version="4.1.5"/>
</repository>
</classpath>
</classloader>
<component name='hello' class='tutorial.impl.HelloComponent'/>
</container>
in HelloComponent.xinfo there is:
<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE type PUBLIC "-//AVALON/Type DTD Version 1.0//EN"
"http://avalon.apache.org/dtds/meta/type_1_1.dtd" >
<type>
<info>
<name>hello</name>
<version>1.0.0</version>
<lifestyle>singleton</lifestyle>
<collection>hard</collection>
</info>
<dependencies>
<dependency key="random" type="tutorial.RandomGenerator" version="1.0.0"/>
<dependency type="tutorial.Identifiable"/>
</dependencies>
</type>
and the concole shows:
[DEBUG ] (kernel.logger): logging system established
[DEBUG ] (kernel.logger): adding category [kernel]
[DEBUG ] (kernel): logging system established
[DEBUG ] (kernel): repository established: C:\Dokumente und
Einstellungen\Stepper\.avalon\repository, http://www.dpml.net/,
http://www.ibiblio.org/maven/
[DEBUG ] (kernel.logger): adding category [kernel]
[INFO ] (kernel): info report
-----------------------------------------------------------
Merlin Kernel Environment Listing
-----------------------------------------------------------
${user.dir} == C:\develop\workspace\MerlinTest
${user.home} == C:\Dokumente und Einstellungen\Stepper
${avalon.repository.cache} == C:\develop\tools\merlin\system
${avalon.repository.online} == true
${avalon.repository.hosts} == http://www.dpml.net,http://www.ibiblio.org/maven
${merlin.lang} == null
${merlin.home} == C:\develop\tools\merlin
${merlin.system} == C:\develop\tools\merlin\system
${merlin.config} == C:\develop\tools\merlin\config
${merlin.kernel} == file:/C:/develop/tools/merlin/config/kernel.xml
${merlin.logging.implementation} ==
artifact:avalon-logging/avalon-logging-logkit-impl#1.0.0
${merlin.logging.config} == null
${merlin.runtime} == artifact:avalon-activation/avalon-activation-impl#2.0.0
${merlin.override} == null
${merlin.dir} == C:\develop\workspace\MerlinTest
${merlin.temp} == C:\DOKUME~1\Stepper\LOKALE~1\Temp
${merlin.context} == C:\develop\workspace\MerlinTest\home
${merlin.anchor} == C:\develop\workspace\MerlinTest
${merlin.info} == true
${merlin.debug} == true
${merlin.audit} == false
${merlin.server} == true
${merlin.autostart} == true
${merlin.code.security.enabled} == false
${merlin.deployment.timeout} == 1000
${merlin.repository} == C:\Dokumente und Einstellungen\Stepper\.avalon\repository
${merlin.repository.hosts} == http://www.dpml.net/,http://www.ibiblio.org/maven/
${merlin.deployment} ==
-----------------------------------------------------------
[DEBUG ] (kernel): building application model
[DEBUG ] (kernel.logger): adding root category
[DEBUG ] (kernel.logger): adding root category
[DEBUG ] (kernel.logger): adding root category
[DEBUG ] (classloader): base: ${merlin.dir}
[DEBUG ] (classloader): classpath:
[DEBUG ] (classloader.types): type install count: 0
[DEBUG ] (classloader.types): type registration complete
[DEBUG ] (kernel): state: initializing
[DEBUG ] (kernel): kernel established
[DEBUG ] (kernel): state: initialized
[DEBUG ] (kernel): install phase
[DEBUG ] (kernel): customize phase
[DEBUG ] (kernel): startup phase
[DEBUG ] (kernel): application assembly
[DEBUG ] (kernel): state: assembly
[DEBUG ] (): assembly phase
[DEBUG ] (kernel): application deployment
[DEBUG ] (kernel): state: deployment
[DEBUG ] (kernel): state: started
[DEBUG ] (): including composite block: file:bin/BLOCK-INF/block.xml
[DEBUG ] (): installing: econ
[DEBUG ] (kernel.logger): adding category [econ]
[DEBUG ] (kernel.logger): adding category [econ]
[DEBUG ] (econ): creating child classloader for: [econ]
[DEBUG ] (econ.classloader): base: ${merlin.dir}
[DEBUG ] (econ.classloader): classpath: file:/C:/Dokumente und
Einstellungen/Stepper/.avalon/repository/avalon-framework/jars/avalon-framework-impl-4.1.5.jar
[DEBUG ] (econ.classloader.scanner): scanning: file:/C:/Dokumente und
Einstellungen/Stepper/.avalon/repository/avalon-framework/jars/avalon-framework-impl-4.1.5.jar
[DEBUG ] (econ.classloader.types): type install count: 0
[DEBUG ] (econ.classloader.types): type registration complete
[DEBUG ] (kernel.logger): adding category [econ]
[DEBUG ] (kernel.logger): adding category [econ.hello]
org.apache.avalon.composition.model.ModelException: Unable to create a nested
deployment model: hello in the containment model /.
at
org.apache.avalon.composition.model.impl.DefaultContainmentModelComponentHelper.createComponentContext(DefaultContainmentModelCompon
entHelper.java:150)
at
org.apache.avalon.composition.model.impl.DefaultContainmentModel.createComponentModel(DefaultContainmentModel.java:899)
at
org.apache.avalon.composition.model.impl.DefaultContainmentModel.createDeploymentModel(DefaultContainmentModel.java:645)
at
org.apache.avalon.composition.model.impl.DefaultContainmentModel.addModel(DefaultContainmentModel.java:604)
at
org.apache.avalon.composition.model.impl.DefaultContainmentModel.<init>(DefaultContainmentModel.java:182)
at
org.apache.avalon.composition.model.impl.DefaultModelFactory.createContainmentModel(DefaultModelFactory.java:330)
at
org.apache.avalon.composition.model.impl.DefaultContainmentModel.createContainmentModel(DefaultContainmentModel.java:987)
at
org.apache.avalon.composition.model.impl.DefaultContainmentModel.createContainmentModel(DefaultContainmentModel.java:932)
at
org.apache.avalon.composition.model.impl.DefaultContainmentModel.createContainmentModel(DefaultContainmentModel.java:1152)
at
org.apache.avalon.composition.model.impl.DefaultContainmentModel.addContainmentModel(DefaultContainmentModel.java:574)
at
org.apache.avalon.composition.model.impl.DefaultContainmentModel.addContainmentModel(DefaultContainmentModel.java:568)
at MerlinEmbedder.main(MerlinEmbedder.java:62)
Caused by: org.apache.avalon.composition.model.TypeUnknownException: Unable to locate
a component type descriptor for the component
class [tutorial.impl.HelloComponent] in the classloader. Please verify that the
component classname is correct and that a component
type descriptor is included in a jar file available within the container classloader.
at
org.apache.avalon.composition.model.impl.DefaultTypeRepository.getType(DefaultTypeRepository.java:255)
at
org.apache.avalon.composition.model.impl.DefaultTypeRepository.getType(DefaultTypeRepository.java:220)
at
org.apache.avalon.composition.model.impl.DefaultContainmentModelComponentHelper.createComponentContext(DefaultContainmentModelCompon
entHelper.java:125)
... 11 more
does this help further?
/eike
"Stephen McConnell" <[EMAIL PROTECTED]> schrieb im Newsbeitrag news:[EMAIL PROTECTED]
> The above line looks like a problem in the making. The
> "merlin.deployment" property is used when you want to add a set of
> blocks via properties (the merlin.deployment should be a comma separated
> set of block urls). But for the purposes of this example - its not
> needed because your adding a block url explicitly a few lines down.
>
> Instead you may want to replace the line with the following criteria
> modifiers.
>
> criteria.put( "merlin.debug", "true" );
> criteria.put( "merlin.info", "true" );
>
>
> > DefaultKernel kernel = (DefaultKernel) factory.create(criteria);
>
> So assuming you have removed the merlin.deployment line, the result of
> the above would be an empty root container.
>
> > ContainmentModel containmentModel = kernel.getModel();
> > // URL blockURL = new URL("file:bin/BLOCK-INF/block.xml");
> > // ContainmentModel block = containmentModel.addContainmentModel(blockURL);
> > // <====== EXCEPTION 2
> > // block.commission();
>
> You need to add something to your container - so I recommend you
> uncomment the comments . Basically all that is happening is that your
> getting a reference to the root model, and requesting the addition of a
> sub-container based on the block referenced by the url.
>
> ContainmentModel containmentModel = kernel.getModel();
> URL blockURL = new URL("file:bin/BLOCK-INF/block.xml");
> ContainmentModel block =
> containmentModel.addContainmentModel(blockURL);
>
> With the debug policy turned on you should see some messages about the
> registration of component types (whatever is in the supplied block.xml).
> If the next step produces errors then its very probably an issue with
> the contents of the block.
>
> block.commission();
>
> Just for reference - can you post the content of block.xml and any
> exception you get.
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]