Hi have bundle A with a springA.xml file that depends on beans from bundle B
springB.xml
I've added a springA-osgi.xml with declared services and on bundle A
activation everything works and I have
| INFO | tenderThread-114 | OsgiServiceFactoryBean |
r.support.OsgiServiceFactoryBean 301 | 42 - org.springframework.osgi.core -
1.2.0 | Publishing service under classes
[{in.laz.storage.mongo.StorageTemplate}]
INFO | tenderThread-114 | OsgiServiceFactoryBean |
r.support.OsgiServiceFactoryBean 301 | 42 - org.springframework.osgi.core -
1.2.0 | Publishing service under classes [{com.mongodb.Mongo}]
both of them (even if I really need to export the first as service, being
the second injected in the first, anyway.
Then bundleB have a StorageTemplate (first service) autowired into a bean.
That does not work:
"No matching bean of type [in.laz.storage.mongo.StorageTemplate] found for
dependency"
even if in springB,xml I import both springA and springA-osgi xml (which I
thiink should not be necessary).
Two question here:
1. What am I possibly missing that's not making it work?
2. I'd like that every bundle that imports springA.xml create some new
instances of the beans defined there, but I do not think that's what is
happening: I thing that bundle A instance the beans and export them as
services, and the same instance is eventually injected into the beans of
bundle B. That's not what I want, I just want the spring beans definition to
stay in bundle A so I do not have to duplicate it in every other bundle, how
can I achieve that?