Re: Using a Redis connection pool from Karaf

2015-04-29 Thread Achim Nierbeck
Hi, just another thought that crossed my mind. Did you check how camel is doing it? Cause camel got a redis connector [1] (might want to switch to that anyways? :-) ) regards, Achim [1] - http://camel.apache.org/redis.html 2015-04-28 14:45 GMT+02:00 Jurgen Voorneveld

Re: Using a Redis connection pool from Karaf

2015-04-29 Thread Guillaume Nodet
I does not look like dependency problem to me, rather a class loading problem. 2015-04-29 9:54 GMT+02:00 Jurgen Voorneveld jurgen.voornev...@redsocks.nl: Still stuck.. I tried using different versions of Karaf: 2.4.2 and 4.0.0.M2. Didn't help same error. Also tried installing servicemix, it

Re: Using a Redis connection pool from Karaf

2015-04-29 Thread Jurgen Voorneveld
success! I got it to work.. stupid stupid issue. As it turns out even though my code doesn't use the commons pool directly by adding commons pool to the imports list in the manifest the bug went away. Counter intuitive though, I only use jedis and jedis uses and loads the pool. I don't

Re: Using a Redis connection pool from Karaf

2015-04-29 Thread Achim Nierbeck
The reason could very well be the following. As Jedis doesn' t know that it is running in an OSGi env. it does make a class for name with the current Thread.classloader. Therefore it doesn't find it as the current thread is started by your application. Ergo as your bundle doesn't import the

Re: Using a Redis connection pool from Karaf

2015-04-29 Thread Jurgen Voorneveld
Still stuck.. I tried using different versions of Karaf: 2.4.2 and 4.0.0.M2. Didn't help same error. Also tried installing servicemix, it has a commons pools built in, but it doesn't work. I also tried switching to equinox instead of felix, didn't work either still same error. All libraries

Re: Using a Redis connection pool from Karaf

2015-04-29 Thread Jurgen Voorneveld
Yeah that makes sense. It's not fun that I have to keep track of the dependencies of my dependencies, so far it's just one but that list could easily grow. If ever I get ClassNotFoundException's I'm going to assume the problem is something like this and just liberally add packages to the import

Re: Using a Redis connection pool from Karaf

2015-04-28 Thread Guillaume Nodet
Not sure what the exact usage of command-pool is, but given the stack trace, it could be that a class is loaded from its name (i suspect it comes from the configuration). In such a case, to make it work in OSGi, the correct class loader needs to be used, one can't rely on the thread context class

Re: Using a Redis connection pool from Karaf

2015-04-28 Thread Achim Nierbeck
hi Jurgen, a quick googling for Redis + OSGi gave me this [1]. Looks like someone is using jedis to connect to his redis server via blueprint. Might want to take a look at this. regards, Achim [1] -

Re: Using a Redis connection pool from Karaf

2015-04-28 Thread Jurgen Voorneveld
On 04/28/2015 01:59 PM, Achim Nierbeck wrote: hi Jurgen, a quick googling for Redis + OSGi gave me this [1]. Looks like someone is using jedis to connect to his redis server via blueprint. Might want to take a look at this. regards, Achim [1] -

Using a Redis connection pool from Karaf

2015-04-28 Thread Jurgen Voorneveld
I couldn't get the Apache Commons Pool libary to load under Karaf so I tried rewriting the app to use BoneCP instead of HikariCP. Bone doesn't have this dependency. This appears to work. BoneCP does want to load. Unfortunately I also have a Redis database which also has the dependency on Apache

Re: Using a Redis connection pool from Karaf

2015-04-28 Thread Achim Nierbeck
Hi Jurgen, do you have the right imports for it configured on your bundles? So which bundle doesn't start? Take a look at the bundle:headers ID of this bundle and check if it actually imports the package you are looking for. If not, make sure the bundle does import it. regards, Achim

Re: Using a Redis connection pool from Karaf

2015-04-28 Thread Jurgen Voorneveld
I have no idea how Redis uses this library, I haven't read the code. My code does this: new JedisPool(new JedisPoolConfig(), redis_driver[0], Integer.parseInt(redis_driver[1]), 1800, password); On 04/28/2015 01:41 PM, Guillaume Nodet wrote: Not sure what the exact usage of command-pool is, but

Re: Using a Redis connection pool from Karaf

2015-04-28 Thread Jurgen Voorneveld
I'd love to know how to do that. This page: https://github.com/sneakybeaky/jedis-osgi lists this information: dependency groupIdredis.clients/groupId artifactIdcom.ninedemons.jedis/artifactId version2.1.0-SNAPSHOT/version /dependency When I go to maven central website and search for

Re: Using a Redis connection pool from Karaf

2015-04-28 Thread Jurgen Voorneveld
Getting closer.. after loading that servicemix jedis bundle I got this error while running my code: Error executing command: Error executing command on bundles: Unable to execute command on bundle 113: Unresolved constraint in bundle nl.redsocks.farm.analyzer [113]: Unable to resolve

Re: Using a Redis connection pool from Karaf

2015-04-28 Thread Achim Nierbeck
Hi, did you check if the bundle you are looking for is now released? Cause usually the snapshots are deleted the minute a release is through. regards, Achim 2015-04-28 14:11 GMT+02:00 Jurgen Voorneveld jurgen.voornev...@redsocks.nl : On 04/28/2015 01:59 PM, Achim Nierbeck wrote: hi Jurgen,

Re: Using a Redis connection pool from Karaf

2015-04-28 Thread Jurgen Voorneveld
Hey Achim, right now I have one bundle that contains the Redis client classes themselves but not the Apache Commons Pool classes. (I haven't figured out how to install jedis as a separate bundle from maven yet, errors...) Those classes are loaded using the import statement in the manifest:

Re: Using a Redis connection pool from Karaf

2015-04-28 Thread Achim Nierbeck
Oh and one, more I think there is a redis OSGi client available from the servicemix bundles. Might want to look at that too. Could be that you need to split your application a lot faster then you thought :D regards, Achim 2015-04-28 13:59 GMT+02:00 Achim Nierbeck bcanh...@googlemail.com: hi