Re: Invalid Bundle Context errors with 4.0.6, unpredictably

2016-09-19 Thread Freeman Fang
FWIW, for the upcoming pax-exam 4.10, we offer a chance to rerun the test if 
the testcase implements a retry TestRule, so that when the test failed first 
time with such bundle refresh problem,  there’s another chance to rerun it with 
a refreshed Karaf container. PAXEXAM-795[1] tracked this.

[1]https://ops4j1.jira.com/browse/PAXEXAM-795
-
Freeman(Yue) Fang

Red Hat, Inc. 
FuseSource is now part of Red Hat



> On Sep 15, 2016, at 3:35 AM, Guillaume Nodet  wrote:
> 
> Such an error is caused by the bundle being stopped / refreshed / updated, so 
> the reason should appear in the log.
> 
> 2016-09-14 21:10 GMT+02:00 Benson Margulies  >:
> I don't know of any reason for a refresh. The structure is always that
> I have a Karaf assembly; the test launches it and then tests web
> services that it publishes. No test involves any updating or deploying
> features or bundles.
> 
> 
> On Wed, Sep 14, 2016 at 2:59 PM, Guillaume Nodet  > wrote:
> > If your test deploys certain bundles such as eventadmin, it can cause
> > pax-logging-api to be refreshed, which in turn cause almost all bundles to
> > be refreshed, which can cause such problems.
> > If that's the case, you should consider deploying eventamin at the startup
> > stage somehow to avoid the refreshes..
> >
> > 2016-09-14 20:54 GMT+02:00 Benson Margulies  > >:
> >>
> >> Folks,
> >>
> >> One of my pax-exam tests _sometimes_ fails with the backtrace below;
> >> to be more precise, it hangs after showing this backtrace on the
> >> console.
> >>
> >> It seems as if this only happens when all of my ITs run; if I tell
> >> failsafe to just run one, it seems never to happen.
> >>
> >> Any ideas?
> >>
> >> TIA
> >>
> >>
> >> 2016-09-14 14:46:52,074 | WARN  | pool-6-thread-1  | Activator
> >>| 6 - org.apache.karaf.features.core - 4.0.6 | Error
> >> starting activator
> >> java.lang.IllegalStateException: Invalid BundleContext.
> >> at
> >> org.apache.felix.framework.BundleContextImpl.checkValidity(BundleContextImpl.java:511)[org.apache.felix.framework-5.4.0.jar:]
> >> at
> >> org.apache.felix.framework.BundleContextImpl.registerService(BundleContextImpl.java:328)[org.apache.felix.framework-5.4.0.jar:]
> >> at
> >> org.apache.karaf.util.tracker.BaseActivator.registerMBean(BaseActivator.java:293)[6:org.apache.karaf.features.core:4.0.6]
> >> at
> >> org.apache.karaf.features.internal.osgi.Activator.doStart(Activator.java:265)[6:org.apache.karaf.features.core:4.0.6]
> >> at
> >> org.apache.karaf.util.tracker.BaseActivator.run(BaseActivator.java:236)[6:org.apache.karaf.features.core:4.0.6]
> >> at
> >> java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)[:1.8.0_60]
> >> at
> >> java.util.concurrent.FutureTask.run(FutureTask.java:266)[:1.8.0_60]
> >> at
> >> java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)[:1.8.0_60]
> >> at
> >> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)[:1.8.0_60]
> >> at java.lang.Thread.run(Thread.java:745)[:1.8.0_60]
> >
> >
> >
> >
> > --
> > 
> > Guillaume Nodet
> > 
> > Red Hat, Open Source Integration
> >
> > Email: gno...@redhat.com 
> > Web: http://fusesource.com 
> > Blog: http://gnodet.blogspot.com/ 
> >
> 
> 
> 
> -- 
> 
> Guillaume Nodet
> 
> Red Hat, Open Source Integration
> 
> Email: gno...@redhat.com 
> Web: http://fusesource.com 
> Blog: http://gnodet.blogspot.com/ 
> 



karaf-maven-plugin 4.0.6: blacklistFeature error

2016-09-19 Thread 414n
Greetings,

I'm trying to upgrade my karaf distribution to version 4.0.6 using the
same-versioned karaf-maven-plugin but I stumble upon an this error every
time I build my karaf-assembly project:


The 'aBlacklistedFeature' feature is blacklist like this in the pom.xml:


The same pom setting was fine both with the 4.0.4 and 4.0.5 versions of the
karaf-maven-plugin.
Could this be related to the changes in the features' service enforcement
code, as discussed  here

 
?



--
View this message in context: 
http://karaf.922171.n3.nabble.com/karaf-maven-plugin-4-0-6-blacklistFeature-error-tp4048098.html
Sent from the Karaf - User mailing list archive at Nabble.com.


Re: Karaf, gogo shell?

2016-09-19 Thread Jean-Baptiste Onofré

Hi,

did you install shell-compat feature ?

Regards
JB

On 09/19/2016 06:06 PM, t...@quarendon.net wrote:

I'm trying to get started with Karaf, and am having a few issues.

I have created a simple OSGi enroute project using bndtools in eclipse. I have
created a feature.xml file for it and have installed it in karaf. So far so
good.

The default project that bndtools generates includes a gogo command. It's just a
"hello world".

When I run this within eclipse under the normal OSGi environment there, I can
run my command from the gogo shell.

Naively I tried doing the same from within the karaf shell. No joy.

I feel I'm back to square one in terms of diagnostics. Tools I used to rely on
like "lb", "inspect capabilities" and so on don't exist as far as I can tell, so
I can't really tell what might be going wrong.
"bundle:diag" shows no unsatisfied requirements though.

Should I expect such a command to work?

Thanks.



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


Re: Karaf, gogo shell?

2016-09-19 Thread Benson Margulies
What version of karaf?

Did you install the shell-compat feature, which is required for gogo commands?


On Mon, Sep 19, 2016 at 12:06 PM,   wrote:
> I'm trying to get started with Karaf, and am having a few issues.
>
> I have created a simple OSGi enroute project using bndtools in eclipse. I have
> created a feature.xml file for it and have installed it in karaf. So far so
> good.
>
> The default project that bndtools generates includes a gogo command. It's 
> just a
> "hello world".
>
> When I run this within eclipse under the normal OSGi environment there, I can
> run my command from the gogo shell.
>
> Naively I tried doing the same from within the karaf shell. No joy.
>
> I feel I'm back to square one in terms of diagnostics. Tools I used to rely on
> like "lb", "inspect capabilities" and so on don't exist as far as I can tell, 
> so
> I can't really tell what might be going wrong.
> "bundle:diag" shows no unsatisfied requirements though.
>
> Should I expect such a command to work?
>
> Thanks.


Karaf, gogo shell?

2016-09-19 Thread tom
I'm trying to get started with Karaf, and am having a few issues.

I have created a simple OSGi enroute project using bndtools in eclipse. I have
created a feature.xml file for it and have installed it in karaf. So far so
good. 

The default project that bndtools generates includes a gogo command. It's just a
"hello world".

When I run this within eclipse under the normal OSGi environment there, I can
run my command from the gogo shell. 

Naively I tried doing the same from within the karaf shell. No joy.

I feel I'm back to square one in terms of diagnostics. Tools I used to rely on
like "lb", "inspect capabilities" and so on don't exist as far as I can tell, so
I can't really tell what might be going wrong. 
"bundle:diag" shows no unsatisfied requirements though.

Should I expect such a command to work?

Thanks.