cannot access referenced service in destroy-method
--------------------------------------------------
Key: ARIES-612
URL: https://issues.apache.org/jira/browse/ARIES-612
Project: Aries
Issue Type: Bug
Components: Blueprint
Affects Versions: 0.3
Environment: Ubuntu
Reporter: Tang Kin Chuen
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="xxx.yyy.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 [Thread: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]
Reference mailing list entry http://bit.ly/e0WbRk
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira