Hi Ryan,

You are probably running into an issue where some dependency of Mongo is
triggering a refresh of the system bundles inside Karaf. Mongo probably
isn't "hijacking" jline; it's just causing jline + karaf shell to
refresh which kills your client shell. There are several ways to do this
on Karaf 4.1, I documented one way to do it (with Apache MINA) in this bug:

https://issues.apache.org/jira/browse/KARAF-5384

If you use:

feature:install -t -v your-problematic-feature

then you should be able to track down which bundle is triggering the
refresh. Also, what version of Karaf are you using?

Seth Leger
The OpenNMS Group


On 1/21/18 12:23 PM, Ryan Moquin wrote:
> This might be better to ask of the Embed Mongo team, but I am not
> entirely sure.  I've been experimenting with an Embedded Mongo running
> inside Karaf, which I've gotten to work successfully with one caveat
> that is driving me crazy trying to troubleshoot (I think I understand
> what's happening, but not exactly what makes it happen).  If I have a
> feature which installs a bundle that created and starts a Flapdoodle
> Embed Mongo instance, then the Karaf console will "hang" since I think
> the Embed Mongo code, kind of "hijacking" the Karaf JLine input stream
> (it attaches some input streams for the Mongo process.)  I did switch
> the outputstreams to use SLF4J which helped a bit, but there is one last
> small issue I can't figure out.  The reason I'm wondering if someone on
> this list might have some ideas is because if when I install that
> feature, I force kill the Karaf process and start it back up, then the
> Embed Mongo process ends up running in the background without
> "hijacking" the Karaf jline console.
> 
> I guess I'm wondering if there is a way to initially install my embed
> mongo feature and prevent it from grabbing the Karaf JLine stream if I
> understand how the feature startup is different than than when
> installing a feature (around the Karaf console input).  I hope what I'm
> asking actually makes sense to someone.  Basically, the feature command
> doesn't return control to the Karaf console after installing that
> feature due to what the Embedded mongo process does under the covers....
> I've been debugging the embed mongo code to see if I can figure out how
> this conflict is happening.. it appears one of the threads that reads an
> inputstream from mongod is the culprit, but this is only a problem when
> installing the feature, not running karaf after the feature has been
> installed.....
> 
> Thanks for any advice!
> 
> Ryan

Reply via email to