karaf-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jean-Baptiste Onofré ...@nanthrax.net>
Subject Re: What to do about an invalid bundleContext in a karaf bundle in a test?
Date Fri, 28 Aug 2015 04:59:48 GMT
Hi Benson,

it's probably due to a refresh: the original bundle context has been 
reloaded and so if you try to use it's no more invalid.

Check if your test doesn't imply a refresh (for instance if you install 
a feature during the test that resolve an optional import, and so 
trigger a refresh).

Regards
JB

On 08/28/2015 01:52 AM, Benson Margulies wrote:
> This is a pax-exam test using pax-exam 4.6.0 and karaf 4.0.1. The test
> hangs after producing this message.
>
> 2015-08-27 19:49:41,138 | WARN  | pool-10-thread-1 | Activator
>                 | 8 - org.apache.karaf.features.core - 4.0.1 | Error
> starting activator
> java.lang.IllegalStateException: Invalid BundleContext.
> at org.apache.felix.framework.BundleContextImpl.checkValidity(BundleContextImpl.java:511)[org.apache.felix.framework-5.0.1.jar:]
> at org.apache.felix.framework.BundleContextImpl.registerService(BundleContextImpl.java:328)[org.apache.felix.framework-5.0.1.jar:]
> at org.apache.karaf.util.tracker.BaseActivator.registerMBean(BaseActivator.java:290)[8:org.apache.karaf.features.core:4.0.1]
> at org.apache.karaf.features.internal.osgi.Activator.doStart(Activator.java:262)[8:org.apache.karaf.features.core:4.0.1]
> at org.apache.karaf.util.tracker.BaseActivator.run(BaseActivator.java:233)[8:org.apache.karaf.features.core:4.0.1]
> at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)[:1.8.0_05]
> at java.util.concurrent.FutureTask.run(FutureTask.java:266)[:1.8.0_05]
> at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)[:1.8.0_05]
> at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)[:1.8.0_05]
> at java.lang.Thread.run(Thread.java:745)[:1.8.0_05]
>

-- 
Jean-Baptiste Onofré
jbonofre@apache.org
http://blog.nanthrax.net
Talend - http://www.talend.com

Mime
View raw message