Hi, i've got a working blueprint bundle to register some default OBR repositories on initialization of the bundle.
The xml config looks like: <?xml version="1.0" encoding="UTF-8" standalone="no"?> <blueprint xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0"> <bean class="play.osgi.bundle.config.RepositoryRegistrationBean" init-method="init" destroy-method="shutdown"> <argument index="0" ref="blueprintBundleContext"/> <argument index="1" ref="repositoryAdmin"/> </bean> <reference id="repositoryAdmin" interface="org.apache.felix.bundlerepository.RepositoryAdmin"> </reference> </blueprint> Both BundleContext & RepositoryAdmin are injected to RepositoryRegistrationBean's constructor. The init() works. However, when i try to access the RepositoryAdmin during shutdown(), i got this exception: 2011-03-15 22:06:49,899 INFO [Gogo shell] [8/org.apache.aries.blueprint/0.3.0] org.apache.aries.blueprint.container.BeanRecipe - Error invoking destroy method org.osgi.service.blueprint.container.ServiceUnavailableException: The Blueprint container is being or has been destroyed at org.apache.aries.blueprint.container.ReferenceRecipe.getService(ReferenceRecipe.java:176) at org.apache.aries.blueprint.container.ReferenceRecipe.access$000(ReferenceRecipe.java:49) at org.apache.aries.blueprint.container.ReferenceRecipe$ServiceDispatcher.call(ReferenceRecipe.java:201) at org.apache.aries.proxy.impl.ProxyHandler$1.invoke(ProxyHandler.java:50) at org.apache.aries.proxy.impl.DefaultWrapper.invoke(DefaultWrapper.java:31) at org.apache.aries.proxy.impl.ProxyHandler.invoke(ProxyHandler.java:78) at $Proxy6.removeRepository(Unknown Source) at play.osgi.bundle.config.RepositoryRegistrationBean.shutdown(RepositoryRegistrationBean.java:39) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)[:1.6.0_24] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)[:1.6.0_24] Does it mean that we cannot access referenced services in destroy-method? Any place I can read up on these? A slightly unrelated question....how come INFO log is used instead of ERROR log?
