Hi,I'm using SCR to get instance of service like LogService,
ConfigurationAdmin and it work well.I tried to do the same with JMS Factory
with the activemq-cf feature and my service can't resolve the
ConnectionFactory...* @Reference private LogService logService;* *
@Reference private ConfigurationAdmin configAdmin;* *
@Reference(target="(osgi.jndi.service.name=jms/activemq-moss)") private
ConnectionFactory jmsConnectionFactory;*In console :*karaf@root()>
service:list ConnectionFactory
15:48:40[javax.jms.ConnectionFactory]-----------------------------
osgi.jndi.service.name = jms/activemq-moss service.bundleid = 38 service.id
= 180 service.scope = singletonProvided by : activemq-cf
(38)**karaf@root()> jndi:names JNDI Name │
Class Nameosgi:service/jms/activemq-moss │
org.apache.activemq.jms.pool.PooledConnectionFactoryosgi:service/mossorder
│ org.postgresql.jdbc2.optional.SimpleDataSourceosgi:service/jndi
│ org.apache.karaf.jndi.internal.JndiServiceImpl*when installing the feature
:*resolution:=mandatory [caused by: Unable to resolve
myservice/1.0.0.SNAPSHOT: missing requirement [myservice/1.0.0.SNAPSHOT]
osgi.service; filter:="(objectClass=javax.jms.ConnectionFactory)";
effective:=active]]*However, if I do this in the activate method of my
service :*jmsConnectionFactory =
bndContext.getService(bndContext.getServiceReferences(ConnectionFactory.class,
"(osgi.jndi.service.name=jms/activemq-moss)").iterator().next());*It's work
!
--
View this message in context:
http://karaf.922171.n3.nabble.com/Reference-annotation-null-instance-with-javax-jms-ConnectionFactory-tp4051118.html
Sent from the Karaf - User mailing list archive at Nabble.com.