Hi all,

I am still trying to bootstrap our project using fortress. I have a very strange problem. After doing some tests it seems that there is a problem looking up a component that does'n have a configuration entry in the "xconf" file. If I do have an entry the lookup works as expected but if
there is no entry the following exception is thrown by lookup method:


org.apache.avalon.framework.service.ServiceException: Unable to provide implementation for fr.infologic.superviseur.services.hibernate.MyService (Key='fr.infologic.superviseur.services.hibernate.MyService')
at org.apache.avalon.framework.service.DefaultServiceManager.lookup(DefaultServiceManager.java:117)
at org.apache.avalon.framework.service.DefaultServiceManager.lookup(DefaultServiceManager.java:112)
at org.apache.avalon.fortress.impl.lookup.FortressServiceManager.lookup(FortressServiceManager.java:106)
at


Most of our components won't need a special configuration so I don't implement the Configurable interface and don't put any configuration inside the xconf file. I would be very unpleasant to have to manage another file besides with roles.
I am hoping that there is something wrong with the fortress setup code
so I am providing if below. Maybe somebody can point me some problems in it:


final org.apache.avalon.fortress.util.FortressConfig config = new org.apache.avalon.fortress.util.FortressConfig();
config.setLoggerManager(new Log4JLoggerManager());
config.setContextDirectory( context.getRealPath("./") );
config.setWorkDirectory( context.getRealPath("./") );
config.setContainerConfiguration( "resource://superviseur.xconf" );
config.setLoggerCategory("fortress");
config.setRoleManagerConfiguration( "resource://superviseur.roles" );
ContainerManager containerManager = new org.apache.avalon.fortress.impl.DefaultContainerManager(
config.getContext());


ContainerUtil.initialize( containerManager );

DefaultContainer container = (DefaultContainer) containerManager.getContainer();
ServiceManager serviceManager = container.getServiceManager();

context.setAttribute(Constants.SERVICE_MANAGER_KEY, serviceManager);



Regards, Peter.



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



Reply via email to