Please find my questions/doubts at the end of the mail.
From: Stephen McConnell [mailto:mcconnell@apac...]
Sent: Thursday, September 30, 2004 9:27 AM
To: 'Avalon framework users'; hsingh4@hous... Subject: RE: Error while running embedded merlin
> -----Original Message-----
> From: Harvinder Singh [mailto:hsingh4@hous...]
> Sent: 30 September 2004 01:28
> To: Avalon framework users
> Subject: Error while running embedded merlin
> Hi All,
> I am trying to use Merlin in embedded scenario.
> I am having many components and have generated all the xinfos for them
> one particular location. The corresponding class files are generated
> some other folder structure. In order to recognise these components, I
> specified the above location for xinfos in the classloader
> directive in block.xml (having the entries for all the components).
> when I run a test class having the embedded Merlin, it gives me the
> following exception :
> Unable to locate a component type descriptor for the component class
> in the classloader.
> Please verify that the component classname is correct and that a
> type descriptor is included
> in a jar file available within the container classloader.
> Going by the above statement, I zipped up all the xinfos in a jar file
> included it in the classpath
> in the classloader directive. Now it is able to find out the type
> but it starts giving me a different error:
> org.apache.avalon.composition.model.ModelException: Cannot load
> type because the type class XXX does not exist in the classloader.
> I also included the jar file(having the classes) in the classpath but
> still gives the same error.
> I just have a hunch whether the xinfo and the particular class files
> should be present in the same folder since in all the tutorials I
> referred, I noticed that the xinfos and class files are in the same
> and put in the same jar file?
> Can someone give me a pointer to resolve this. I need it quite
Classes and xinfo files are resolved relative to a classloader - as such
there is no problem with splitting up classes and xinfo files into
different directories - providing that the path for the class and the
xinfo is the same. For example - a class reference to something like:
Providing the class and xinfo share the same address space - everything
should be ok.
Question : Does this mean then that "MyComponent" will get resolved only if
it has the same class name as the xinfo file name.
Infact I tried with a sample component having the classname different from
the xinfo file name, and it did not get reolved and gave me an error. Issue
here is what suppose if I want to use the same implementation for two
different components.( my components have very similar functionality and
thus I wud like to use the same implementation passing a flag each time
which component to use.)
I will define both the components in block.xml having the same class names
and also an attribute 'type' which would suggest which one to use.
But the way merlin is behaving, it will need 2 different classes and two
Will something like this work in Merlin :
MyComponent1.xinfo and MyComponent.class - resolves 1st component
MyComponent2.xinfo and MyComponent.class - resolves 2nd component
If not then please let me know how to achieve that?