Hi,

I'm new to avalon and tried to set up a small example.

Here is the configuration file for the roles:

<role-list>
        <role name="components.CastorSelector" shorthand="castors"
default-class="org.apache.avalon.excalibur.component.ExcaliburComponentSelec
tor">
                <hint shorthand="castorPortal"
class="components.CastorPortalImpl"/>
        </role>
</role-list>


In my java- class I set up the componentManager in the following way:


                        SAXParserFactory factory =
SAXParserFactory.newInstance();
                        XMLReader reader =
factory.newSAXParser().getXMLReader();

                        ExcaliburComponentManager manager = new
ExcaliburComponentManager();
                        manager.setLogger(logger);

                        Configuration roleConfig = null;

                        SAXConfigurationHandler b = new
SAXConfigurationHandler();
                        InputStream inputStream = new
FileInputStream("avalon_roles.xml");
                        InputSource is = new InputSource(inputStream);

                        reader.setContentHandler(b);
                        reader.parse(is);

                        roleConfig = b.getConfiguration();

                        DefaultRoleManager drm = new DefaultRoleManager();
                        drm.setLogger(logger);
                        drm.configure(roleConfig);

                        manager.setRoleManager(drm);
                        manager.initialize();




Now comes the problem: If I try the following to retrieve the Component for
castorPortal:


                        selector = (ComponentSelector)
manager.lookup(Castor.ROLE + "Selector");
                        castor = (Castor) selector.select("castorPortal");


I get this error:


UnnamedSelector: ComponentSelector could not find the component for hint:
castorPortal


Does anybody have any idea?


Thanks in advance,

Silvio

<<attachment: winmail.dat>>

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

Reply via email to