Please help

"Silvio Katzan" <[email protected]>
Newsgroups gmane.comp.jakarta.avalon.apps.devel,gmane.comp.jakarta.avalon.devel
Message-ID <[email protected]>
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

--
To unsubscribe, e-mail:   <mailto:[email protected]>
For additional commands, e-mail: <mailto:[email protected]>
winmail.dat (application/ms-tnef, 2 KB) - not displayed
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.