> >
> >3. In one of my other services, I try to use the datasource like this
> >
> > DataSourceComponent ds =
> >(DataSourceComponent)_dsSelector.select("maindb");
> >
>
> First off - your attempting to narrow to a component implementation
> instread of the service it exposes. I would have assumed that you
would
> resolve the DataSourceSelector service from the service manager, then
> incoke select on the returned selector.
I believe that I am already doing that
/**
* Servicing of the component by the container during which service
* dependencies declared under the component can be resolved using
the
* supplied service manager.
*
* @avalon.dependency type="com.choreoworks.sap.logger.Logger"
key="logger"
* @avalon.dependency
type="com.choreoworks.sap.uuid.spi.UUIDGenerator:1.0"
key="uuid-generator"
* @avalon.dependency
type="com.choreoworks.sap.scheduler.spi.JobScheduler:1.0"
key="job-scheduler"
* @avalon.dependency
type="com.choreoworks.sap.queue.spi.QueueManager:1.0"
key="queue-manager"
* @avalon.dependency
type="org.apache.avalon.cornerstone.services.threads.ThreadManager:1.0"
key="thread-manager"
* @avalon.dependency
type="org.apache.avalon.cornerstone.services.sockets.SocketManager:1.0"
key="socket-manager"
* @avalon.dependency
type="org.apache.avalon.cornerstone.services.datasources.DataSourceSelec
tor:1.0" key="data-source-selector"
*
* @param manager - the service manager
* @throws ServiceException
*/
public void service(final ServiceManager manager)
throws ServiceException {
_scheduler = (JobScheduler)manager.lookup("job-scheduler");
_uuidGenerator =
(UUIDGenerator)manager.lookup("uuid-generator");
_queueManager = (QueueManager)manager.lookup("queue-manager");
_socketManager =
(SocketManager)manager.lookup("socket-manager");
_threadManager =
(ThreadManager)manager.lookup("thread-manager");
_dsSelector =
(DataSourceSelector)manager.lookup("data-source-selector");
}
>
> >
> >But when this service executes I get the following error
> >
> >java.lang.NullPointerException
> >
>
> Umm .. this is a worry - you should not be getting a NPE.
>
> Any chance you could throw together a testcase?
>
Yep I can do something over the next couple of days.
cheers
</jima>
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]