Hello all and thank you! Well, I cannot easily copy the stack because it comes from a server I'm connected to in VPN and remote desktop, and I cannot make copy&paste so I've copied the first line of the stack from one of my searches for info on the web.
Interestingly, we use Spring-DM, so we don't use directly OSGi API, and the exception was thrown from a Camel Route (the full stack trace has org.apache.camel.core.... entries just below top entries from org.apache.felix.framework.BundleContextImpl). More interestingly, the Camel error shows that the Invalid Bundle context exception is thrown at the end of a route, with id route33, which is not listed anymore as soon as I launch the camel:route-list command ! I was involved in the issue late, but the developer told me that he restarted a bundle, and after the restart camel started logging many exceptions on the route, Camel exceptions with a cause of type IllegalStateException originating from org.apache.felix.framework.BundleContextImpl The bundle that has been restarted is connected to another bundle via a camel vm: endpoint, the bundle that has been restarted is the consumer (it has the <from uri="vm:..." />) and after the restart it seems like the exchanges keep being sent to a reference of the previous camel context created before, this is a reasonable cause of the invalid bundle context but I do not have an idea of I we got into this situation. it is important to point out that we are using ServiceMix 5.3.0 on that server, which has Camel 2.13.2: it could be that this version has a buggy vm: component and maybe now this problem is fixed. I ask myself if there is something I can do to prevent this happening agian and ho I can safely manage the life cycle of these bundle so I can restart them individualyl. I ask if the bundle with the "bad" design is the one that produce on the vm or the one that consumes on the vm, or if it is a camel bug :-) If you have any other idea please give me some more hint! I would appreciate it. Thank you all, Cristiano Il giorno gio 30 giu 2016 alle ore 21:01 Nick Baker <[email protected]> ha scritto: > A more complete stack trace would help us point you to the offending code. > I can say that I usually see this when a Service is still held by someone > when it should have been removed from "play" by a ServiceTracker or other > similar mechanism. > > -Nick > > From: Cristiano Costantini <[email protected]> > Date: Thu Jun 30 2016 14:57:18 GMT-0400 (EDT) > To: [email protected] <[email protected]> > Subject: Reasons that triggers IllegalStateException: Invalid > BundleContext > > Hello All, > > I'n our application it happen sometime to find in situations where we get > the "Invalid BundleContext" exception: > > java.lang.IllegalStateException: Invalid BundleContext. > at > org.apache.felix.framework.BundleContextImpl.checkValidity(BundleContextImpl.java:453) > > > What are the potential reasons such exception may be thrown? > I'm searching to understand so I can hunt for a potential design issue in > some of our bundles... I've searched the web but I've found no hint. > > Thank you! > Cristiano > >
