Hello,
I'm trying to use the Spring-DM service-reference to inject a service exportet by a backend bundle into a frontend bundle, but I keep getting a Null pointer, as if the service didn't exist. I checked and the backend bundle with the service is up an running with the correct interface.
Here is a look at the ServiceConnector of the frontend bundle and it's configuration:
Code:public class ServiceConnector implements IServiceConnector { private IUserSessionLifecycle userSessionServiceReference; public ServiceConnector() { super(); } public IUserSession getValidUserSession(String email, String password) { return userSessionServiceReference.getUserSession(email, password); } }When the service-connector is invoked it throws a null pointer, so it definitely means the userSessionService is not being injected.Code:<osgi:reference id="userSessionServiceReference" interface="de.idarewest.backend.service.transaction.IUserSessionLifecycle"/> <bean id="serviceConnector" scope="prototype" class="de.pascada.idarewest.ServiceConnector"> <property name="userSessionServiceReference" ref="userSessionServiceReference"/> </bean>
The userSessionService is configured as follows:
Code:public interface IUserSessionLifecycle { public abstract IUserSession getUserSession(String email, String password); public abstract IUserAccount getUserAccountByEmail(String email); }After the deployment of both bundles Spring-DM confirms the service import as follows:Code:<bean id="IUserSession" name="userSessionBean" scope="prototype" class="de.idarewest.backend.service.transaction.UserSessionLifecycle"> </bean> <osgi:service id="userSessionService" ref="userSessionBean" interface="de.idarewest.backend.service.transaction.IUserSessionLifecycle" />
Any ideas why this Spring-DM is not injecting the service ?Code:17:42:47,195 INFO OsgiServiceProxyFactoryBean:470 - Looking for mandatory OSGi service dependency for bean [userSessionServiceReference] matching filter (objectClass=de.idarewest.backend.service.transaction.IUserSessionLifecycle) 17:42:47,369 INFO OsgiServiceProxyFactoryBean:476 - Found mandatory OSGi service for bean [userSessionServiceReference]
Thanks for any help


