You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@servicemix.apache.org by J- MAN <jm...@hotmail.com> on 2011/08/10 21:38:23 UTC

[Servicemix 4.3] Bundle not calling destroy-method when stopped

Hi,

I'm using an embedded H2 database in my bundle as a spring bean with this in my camel-context.xml file:
     <bean id = "org.h2.tools.Server"
            class="org.h2.tools.Server"
            factory-method="createTcpServer"
            init-method="start"
            destroy-method="stop">
            <constructor-arg value="-tcp,-tcpAllowOthers,true,-tcpPort,8043" />
        </bean>

When i stop my bundle to redeploy changes, the destroy method does not get called and the H2 database server continues to run.  I cannot redeploy my bundle without restarting
 servicemix because the port is still in use.

I see this in the log:

Closing runnable for context OsgiBundleXmlApplicationContext(bundle=cas, config=osgibundle:/META-INF/spring/*.xml) did not finish in 10000ms; consider taking a snapshot and then shutdown the VM in case the thread still hangs


Thanks.