Hi all,
I have made a Selector which creates a number of selectable components based on it's configuration (DefaultFileHandlerSelector).
These selectable components depend on another component (a DataSourceSelector named datasources).
I have supplied a DataSourceSelector to my Selector during service() and attempt to create my selectable components during initialize() (DAFStoreFileHandler)
When I create a selectable component I pass my servicemanager to it so that it can access my DataSourceSelector however I get an exception:
Exception: org.apache.avalon.framework.service.ServiceException
Message: Unknown key: datasources (Key='datasources')
---- stack trace ------------------------------------------------------------
org.apache.avalon.framework.service.ServiceException: Unknown key: datasources (Key='datasources')
org.apache.avalon.activation.appliance.impl.DefaultServiceManager.lookup(DefaultServiceManager.java:110)
au.com.wcmgroup.liberty.blocks.filehandler.DAFStoreFileHandler.service(DAFStoreFileHandler.java:102)
au.com.wcmgroup.liberty.blocks.filehandler.DefaultFileHandlerSelector.initialize(DefaultFileHandlerSelector.java:122)
org.apache.avalon.activation.appliance.impl.DefaultAppliance.applyInitialization(DefaultAppliance.java:917)
My understanding of the lifecycle and automatic dependency resolving clearly needs work, without posting a bunch of sources could someone suggest where I have gone wrong.
More investigation leads me to believe the custom selector doesn't have a dependency on DataSourceSelector so it's not in the servicemanager.
As the components are dynamically created their dependencies aren't resolved by merlin.
Any suggestions about how to provide dependencies to dynamically created components? Especially where I don't want to declare the DataSourceSelector as a dependency of my Custom Selector, (although I tried this with manual dependency resolution and still didn't get an instance in the service manager).
Jon
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]